|
@@ -48,52 +48,57 @@
|
|
|
<!-- <el-table-column type="selection" width="40" align="center" /> -->
|
|
|
<el-table-column type="index" label="行号" width="50" align="center" />
|
|
|
|
|
|
- <el-table-column label="图纸" prop="drawingName" align="center">
|
|
|
- <template #default="scope">
|
|
|
- <el-button link type="primary">{{
|
|
|
- scope.row.drawingName }}</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column label="图纸" prop="drawingName" align="center" />
|
|
|
+ <el-table-column label="类型" prop="pattern" align="center" width="80" />
|
|
|
<el-table-column label="状态" width="80px" prop="status" align="center">
|
|
|
<template #default="scope">
|
|
|
<dict-tag :options="drawing_status" :value="scope.row.status" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="是否废弃" width="80px" prop="abandoned" align="center">
|
|
|
+ <!-- <el-table-column label="是否废弃" width="80px" prop="abandoned" align="center">
|
|
|
<template #default="scope">
|
|
|
<dict-tag :options="drawing_type" :value="scope.row.abandoned" />
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column label="制作人" width="100px" prop="producer" align="center" />
|
|
|
<el-table-column label="审核人" width="100px" prop="reviewer" align="center" />
|
|
|
<el-table-column label="批准人" width="100px" prop="issuer" align="center" />
|
|
|
- <el-table-column fixed="right" label="操作" align="center" width="280px">
|
|
|
+ <el-table-column fixed="right" label="操作" align="center">
|
|
|
<template #default="scope">
|
|
|
- <el-button v-if="scope.row.status == 0 && scope.row.abandoned == 0" link type="primary"
|
|
|
- v-hasPermi="['business:electronicDrawings:examine']"
|
|
|
- @click="handlePreview(scope.row)">审核
|
|
|
- </el-button>
|
|
|
- <el-button v-if="scope.row.status == 1" link type="success" plain
|
|
|
- v-hasPermi="['business:electronicDrawings:raift']"
|
|
|
- @click="handlePreview(scope.row)">批准</el-button>
|
|
|
-
|
|
|
- <el-upload :action="webHost + '/common/upload'" :headers="headers" :limit="1"
|
|
|
- :on-success="handleReplaceSuccess" :on-exceed="handleReplaceExceed"
|
|
|
- :before-upload="beforeUpload" :show-file-list="false">
|
|
|
+ <el-button-group
|
|
|
+ style="display: flex;align-items: center; justify-content: center; flex-wrap: nowrap;">
|
|
|
+ <el-button v-if="scope.row.status == 0 && scope.row.abandoned == 0" link
|
|
|
+ type="primary" v-hasPermi="['business:electronicDrawings:examine']"
|
|
|
+ @click="handlePreview(scope.row)">审核
|
|
|
+ </el-button>
|
|
|
+ <el-button v-if="scope.row.status == 1" link type="success" plain
|
|
|
+ v-hasPermi="['business:electronicDrawings:raift']"
|
|
|
+ @click="handlePreview(scope.row)">批准</el-button>
|
|
|
+
|
|
|
+ <!-- <el-upload style="display: flex;align-items: center; justify-content: center;"
|
|
|
+ :action="webHost + '/common/upload'" :headers="headers" :limit="1"
|
|
|
+ :on-success="handleReplaceSuccess" :on-exceed="handleReplaceExceed"
|
|
|
+ :before-upload="beforeUpload" :show-file-list="false">
|
|
|
+ <el-button v-if="scope.row.status == 2 && scope.row.abandoned == 0" link
|
|
|
+ type="warning" plain
|
|
|
+ v-hasPermi="['business:electronicDrawings:replace']">替换</el-button>
|
|
|
+ </el-upload> -->
|
|
|
+
|
|
|
+ <el-button v-if="scope.row.status == 2 && scope.row.abandoned == 0" link
|
|
|
+ type="warning" v-hasPermi="['business:electronicDrawings:replace']"
|
|
|
+ @click="replaceClick(scope.row)">替换
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ v-if="(scope.row.status == 0 || scope.row.status == 1) && scope.row.abandoned == 0"
|
|
|
+ link type="danger" v-hasPermi="['business:electronicDrawings:NG']"
|
|
|
+ @click="handleDrawingNG(scope.row)">NG
|
|
|
+ </el-button>
|
|
|
<el-button v-if="scope.row.status == 2 && scope.row.abandoned == 0" link
|
|
|
- type="warning" plain
|
|
|
- v-hasPermi="['business:electronicDrawings:replace']">替换</el-button>
|
|
|
- </el-upload>
|
|
|
-
|
|
|
- <el-button
|
|
|
- v-if="(scope.row.status == 0 || scope.row.status == 1) && scope.row.abandoned == 0"
|
|
|
- link type="danger" v-hasPermi="['business:electronicDrawings:NG']"
|
|
|
- @click="handleDrawingNG(scope.row)">NG
|
|
|
- </el-button>
|
|
|
- <el-button v-if="scope.row.status == 2 && scope.row.abandoned == 0" link type="danger"
|
|
|
- v-hasPermi="['business:electronicDrawings:remove']"
|
|
|
- @click="handleDrawingRemove(scope.row)">作废
|
|
|
- </el-button>
|
|
|
+ type="danger" v-hasPermi="['business:electronicDrawings:remove']"
|
|
|
+ @click="handleDrawingRemove(scope.row)">作废
|
|
|
+ </el-button>
|
|
|
+ </el-button-group>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -119,7 +124,7 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 添加图纸对话框 -->
|
|
|
- <el-dialog title="上传文件" v-model="open" width="500px" append-to-body>
|
|
|
+ <el-dialog title="上传文件" v-model="open" width="500px" @close="cancel" append-to-body>
|
|
|
<el-form ref="drawingRef" :model="form" :rules="rules" label-width="120px" v-loading="formLoading">
|
|
|
|
|
|
|
|
@@ -139,7 +144,7 @@
|
|
|
<template #append>
|
|
|
<el-upload :disabled="!form.technologicalProcessDetailId" :action="webHost + '/common/upload'"
|
|
|
:headers="headers" :limit="1" :on-success="handleSuccess" :on-exceed="handleExceed"
|
|
|
- :before-upload="beforeUpload" :show-file-list="false">
|
|
|
+ :before-upload="beforeUpload" :show-file-list="false" ref="uploadrefss">
|
|
|
<el-button icon="Upload"></el-button>
|
|
|
</el-upload>
|
|
|
</template>
|
|
@@ -174,7 +179,8 @@ const hostUrl = import.meta.env.VITE_HOST_URL
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const { drawing_status } = proxy.useDict("drawing_status");
|
|
|
const { drawing_type } = proxy.useDict("drawing_type");
|
|
|
-
|
|
|
+const uploadrefss = ref()
|
|
|
+const parentName = ref("")
|
|
|
const total = ref(0)
|
|
|
const route = useRoute();
|
|
|
const coverName = ref("")
|
|
@@ -188,7 +194,7 @@ const technologicalDetailId = ref(null)
|
|
|
const open = ref(false)
|
|
|
const draform = ref({})
|
|
|
const currentDrawing = ref({})
|
|
|
-const replaceForm = ref({})
|
|
|
+const replaceForm = ref({})
|
|
|
const repeatingDrawings = ref([])
|
|
|
const loading = ref(false);
|
|
|
const drawingList = ref([])
|
|
@@ -206,6 +212,7 @@ const data = reactive({
|
|
|
form: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
+ parentId: null,
|
|
|
technologicalProcessDetailId: null,
|
|
|
groupDetailList: [],
|
|
|
code: "",
|
|
@@ -327,6 +334,7 @@ function getDrawing() {
|
|
|
/**上传成功回调 */
|
|
|
function handleSuccess(row) {
|
|
|
form.value.url = row.fileName
|
|
|
+
|
|
|
var fileDrawing = {}
|
|
|
fileDrawing.drawingName = row.originalFilename
|
|
|
fileDrawing.technologicalProcessDetailId = currentTechnologicalDetail.value.id
|
|
@@ -342,7 +350,7 @@ function handleSuccess(row) {
|
|
|
formLoading.value = false
|
|
|
} else {
|
|
|
//判断重名文件状态是否已发行需要替换
|
|
|
- if (repeatingDrawings.value[0].status == 0) {
|
|
|
+ if (repeatingDrawings.value[0].status == 2) {
|
|
|
proxy.$modal.msgWarning("待审核中已有相同文件");
|
|
|
var item = {}
|
|
|
item = repeatingDrawings.value[0]
|
|
@@ -381,12 +389,38 @@ function handleReplaceSuccess(row) {
|
|
|
handleReplace(item)
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+function replaceClick(row) {
|
|
|
+ form.value.parentId = row.id
|
|
|
+ form.value.technologicalProcessDetailId = row.technologicalProcessDetailId
|
|
|
+ open.value = true
|
|
|
+}
|
|
|
function submitForm() {
|
|
|
proxy.$refs["drawingRef"].validate((valid) => {
|
|
|
console.log(proxy.$refs["drawingRef"])
|
|
|
if (valid) {
|
|
|
- open.value = false
|
|
|
- saveDrawingDetail()
|
|
|
+
|
|
|
+ if (form.value.parentId) {
|
|
|
+ proxy.$modal
|
|
|
+ .confirm("是否确认替换图纸?")
|
|
|
+ .then(function () {
|
|
|
+ if (currentTechnologicalDetail.value.id !== undefined && currentTechnologicalDetail.value.id !== null && currentTechnologicalDetail.value.id !== 'undefined') {
|
|
|
+ form.value.technologicalProcessDetailId = currentTechnologicalDetail.value.id
|
|
|
+ }
|
|
|
+ return replace(form.value);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ reset()
|
|
|
+ getList();
|
|
|
+ open.value = false
|
|
|
+ proxy.$modal.msgSuccess("替换成功");
|
|
|
+ })
|
|
|
+ .catch(() => { });
|
|
|
+ } else {
|
|
|
+ console.log(form.value, 79)
|
|
|
+ saveDrawingDetail()
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -395,6 +429,7 @@ function saveDrawingDetail() {
|
|
|
if (currentTechnologicalDetail.value.id !== undefined && currentTechnologicalDetail.value.id !== null && currentTechnologicalDetail.value.id !== 'undefined') {
|
|
|
form.value.technologicalProcessDetailId = currentTechnologicalDetail.value.id
|
|
|
}
|
|
|
+
|
|
|
form.value.drawingName = coverName.value
|
|
|
|
|
|
var itemList = []
|
|
@@ -404,7 +439,7 @@ function saveDrawingDetail() {
|
|
|
reset();
|
|
|
getList();
|
|
|
formLoading.value = false
|
|
|
-
|
|
|
+ open.value = false
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -431,16 +466,17 @@ function reset() {
|
|
|
drawingName: null,
|
|
|
type: false
|
|
|
};
|
|
|
- currentProduct.value = {}
|
|
|
currentTechnologicalDetail.value = {}
|
|
|
- currentTechnological.value = {}
|
|
|
coverName.value = ''
|
|
|
repeatingDrawings.value = []
|
|
|
proxy.resetForm("drawingRef");
|
|
|
}
|
|
|
// 取消按钮
|
|
|
function cancel() {
|
|
|
+ uploadrefss.value.clearFiles()
|
|
|
+
|
|
|
open.value = false
|
|
|
+
|
|
|
reset()
|
|
|
}
|
|
|
/**版本change事件 */
|