|
@@ -30,12 +30,13 @@
|
|
|
|
|
|
<template #menu="{ size, row, index }">
|
|
|
<el-button
|
|
|
- icon="el-icon-refresh"
|
|
|
- text
|
|
|
- @click="queryDiffList(row.id)"
|
|
|
- type="primary"
|
|
|
- :size="size"
|
|
|
- >同步</el-button>
|
|
|
+ icon="el-icon-refresh"
|
|
|
+ text
|
|
|
+ @click="queryDiffList(row.id)"
|
|
|
+ type="primary"
|
|
|
+ :size="size"
|
|
|
+ >同步</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
|
|
|
<template #customFieldName-form="scope">
|
|
@@ -85,13 +86,15 @@
|
|
|
</avue-crud>
|
|
|
<ExcelUpload ref="uploadRef" @finished="uploadFinished" />
|
|
|
<el-dialog
|
|
|
- v-model="dialog.visible"
|
|
|
- :title="dialog.title"
|
|
|
- width="950px"
|
|
|
- @close="dialog.visible = false"
|
|
|
+ v-model="dialog.visible"
|
|
|
+ :title="dialog.title"
|
|
|
+ width="950px"
|
|
|
+ @close="dialog.visible = false"
|
|
|
>
|
|
|
- <div style="width:100%;height:10px;color:#fa0303;">已经开始生产的工艺路线,请到工艺路线中进行单个更改!!!</div>
|
|
|
- <difference :diffList="diffList" @syncList="clickSyncList"/>
|
|
|
+ <div style="width: 100%; height: 10px; color: #fa0303">
|
|
|
+ 已经开始生产的工艺路线,请到工艺路线中进行单个更改!!!
|
|
|
+ </div>
|
|
|
+ <difference :diffList="diffList" @syncList="clickSyncList" />
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
|
<el-button type="primary" @click="handleSubmit">同 步</el-button>
|
|
@@ -99,14 +102,13 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import { ref, getCurrentInstance } from "vue";
|
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
|
import { useCommonStoreHook, useDictionaryStore } from "@/store";
|
|
|
-import { syncOperation, checkSyncList} from "@/api/craft/process";
|
|
|
+import { syncOperation, checkSyncList } from "@/api/craft/process";
|
|
|
import difference from "./component/difference.vue";
|
|
|
// 数据字典相关
|
|
|
const { dicts } = useDictionaryStore();
|
|
@@ -114,7 +116,7 @@ const dialog = reactive({
|
|
|
title: "差异列表",
|
|
|
visible: false,
|
|
|
});
|
|
|
-const isDisabled=ref(false);
|
|
|
+const isDisabled = ref(false);
|
|
|
// 传入一个url,后面不带/
|
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
useCrud({
|
|
@@ -127,31 +129,34 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
|
|
|
|
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
|
|
|
-const clickObjId = ref(null)
|
|
|
+const clickObjId = ref(null);
|
|
|
|
|
|
-const clickSyncRouteList = ref([])
|
|
|
+const clickSyncRouteList = ref([]);
|
|
|
onMounted(() => {
|
|
|
// console.log("crudRef", crudRef)
|
|
|
dataList();
|
|
|
});
|
|
|
const clickSyncList = (list) => {
|
|
|
clickSyncRouteList.value = list;
|
|
|
-}
|
|
|
-const handleSubmit = ()=>{
|
|
|
- if(clickSyncRouteList.value.length > 0){
|
|
|
- syncOperation({"baseId": clickObjId.value,"routeIds":clickSyncRouteList.value}).then((data)=>{
|
|
|
- if(data.code === '200'){
|
|
|
- clickSyncRouteList.value = []
|
|
|
+};
|
|
|
+const handleSubmit = () => {
|
|
|
+ if (clickSyncRouteList.value.length > 0) {
|
|
|
+ syncOperation({
|
|
|
+ baseId: clickObjId.value,
|
|
|
+ routeIds: clickSyncRouteList.value,
|
|
|
+ }).then((data) => {
|
|
|
+ if (data.code === "200") {
|
|
|
+ clickSyncRouteList.value = [];
|
|
|
dialog.visible = false;
|
|
|
ElMessage.success(data.msg);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
ElMessage.error(data.msg);
|
|
|
}
|
|
|
});
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
ElMessage.error("请选择需要同步的数据");
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
const diffList = ref([]);
|
|
|
|
|
|
/**
|
|
@@ -196,18 +201,18 @@ const customFieldChange = (val) => {
|
|
|
form.value.customFieldName = JSON.stringify(result);
|
|
|
};
|
|
|
|
|
|
-const queryDiffList = (id) =>{
|
|
|
+const queryDiffList = (id) => {
|
|
|
clickObjId.value = id;
|
|
|
- checkSyncList(id).then((data)=>{
|
|
|
- if(data.data){
|
|
|
- diffList.value = []
|
|
|
- dialog.visible = true
|
|
|
- data.data.forEach((item)=>{
|
|
|
- diffList.value.push(item)
|
|
|
- })
|
|
|
+ checkSyncList(id).then((data) => {
|
|
|
+ if (data.data) {
|
|
|
+ diffList.value = [];
|
|
|
+ dialog.visible = true;
|
|
|
+ data.data.forEach((item) => {
|
|
|
+ diffList.value.push(item);
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
-}
|
|
|
+};
|
|
|
const beforeOpenDialog = (done, type, loading) => {
|
|
|
if (
|
|
|
form.value.customFieldName &&
|
|
@@ -218,16 +223,16 @@ const beforeOpenDialog = (done, type, loading) => {
|
|
|
(item) => item.value
|
|
|
);
|
|
|
}
|
|
|
- if(type=="view"){
|
|
|
- isDisabled.value=true;
|
|
|
- }else{
|
|
|
- isDisabled.value=false;
|
|
|
+ if (type == "view") {
|
|
|
+ isDisabled.value = true;
|
|
|
+ } else {
|
|
|
+ isDisabled.value = false;
|
|
|
}
|
|
|
if (
|
|
|
!form.value.customFieldName ||
|
|
|
JSON.parse(form.value.customFieldName)?.length == 0
|
|
|
) {
|
|
|
- customFieldNameValues.value =[];
|
|
|
+ customFieldNameValues.value = [];
|
|
|
}
|
|
|
done();
|
|
|
};
|
|
@@ -299,6 +304,7 @@ option.value = Object.assign(option.value, {
|
|
|
label: "工艺条件",
|
|
|
prop: "processAsk",
|
|
|
span: 12,
|
|
|
+ minWidth: 300,
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|