|
@@ -24,10 +24,20 @@
|
|
icon="el-icon-delete"
|
|
icon="el-icon-delete"
|
|
:size="size"
|
|
:size="size"
|
|
@click="multipleDelete"
|
|
@click="multipleDelete"
|
|
- >删除</el-button
|
|
|
|
|
|
+ >删除111</el-button
|
|
>
|
|
>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
+ <template #menu="{ size, row, index }">
|
|
|
|
+ <el-button
|
|
|
|
+ icon="el-icon-refresh"
|
|
|
|
+ text
|
|
|
|
+ @click="queryDiffList(row.id)"
|
|
|
|
+ type="primary"
|
|
|
|
+ :size="size"
|
|
|
|
+ >同步</el-button>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
<template #customFieldName-form="scope">
|
|
<template #customFieldName-form="scope">
|
|
<el-select
|
|
<el-select
|
|
v-model="customFieldNameValues"
|
|
v-model="customFieldNameValues"
|
|
@@ -73,18 +83,36 @@
|
|
</template>
|
|
</template>
|
|
</avue-crud>
|
|
</avue-crud>
|
|
<ExcelUpload ref="uploadRef" @finished="uploadFinished" />
|
|
<ExcelUpload ref="uploadRef" @finished="uploadFinished" />
|
|
|
|
+ <el-dialog
|
|
|
|
+ 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"/>
|
|
|
|
+ <template #footer>
|
|
|
|
+ <div class="dialog-footer">
|
|
|
|
+ <el-button type="primary" @click="handleSubmit">同 步</el-button>
|
|
|
|
+ <el-button @click="dialog.visible = false">取 消</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script setup>
|
|
<script setup>
|
|
import { ref, getCurrentInstance } from "vue";
|
|
import { ref, getCurrentInstance } from "vue";
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
-import dictDataUtil from "@/common/configs/dictDataUtil";
|
|
|
|
-import ButtonPermKeys from "@/common/configs/buttonPermission";
|
|
|
|
import { useCommonStoreHook, useDictionaryStore } from "@/store";
|
|
import { useCommonStoreHook, useDictionaryStore } from "@/store";
|
|
-
|
|
|
|
|
|
+import { syncOperation, checkSyncList} from "@/api/craft/process";
|
|
|
|
+import difference from "./component/difference.vue";
|
|
// 数据字典相关
|
|
// 数据字典相关
|
|
const { dicts } = useDictionaryStore();
|
|
const { dicts } = useDictionaryStore();
|
|
-
|
|
|
|
|
|
+const dialog = reactive({
|
|
|
|
+ title: "差异列表",
|
|
|
|
+ visible: false,
|
|
|
|
+});
|
|
// 传入一个url,后面不带/
|
|
// 传入一个url,后面不带/
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
useCrud({
|
|
useCrud({
|
|
@@ -94,20 +122,35 @@ const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
Methords; //增删改查
|
|
Methords; //增删改查
|
|
const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
-// checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
|
|
|
|
-// const permission = reactive({
|
|
|
|
-// delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
|
|
|
|
-// addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
|
|
|
|
-// editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
|
|
|
|
-// menu: true,
|
|
|
|
-// });
|
|
|
|
|
|
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
|
|
|
|
|
+const clickObjId = ref(null)
|
|
|
|
+
|
|
|
|
+const clickSyncRouteList = ref([])
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
// console.log("crudRef", crudRef)
|
|
// console.log("crudRef", crudRef)
|
|
dataList();
|
|
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 = []
|
|
|
|
+ dialog.visible = false;
|
|
|
|
+ ElMessage.success(data.msg);
|
|
|
|
+ }else{
|
|
|
|
+ ElMessage.error(data.msg);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }else{
|
|
|
|
+ ElMessage.error("请选择需要同步的数据");
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+const diffList = ref([]);
|
|
|
|
|
|
/**
|
|
/**
|
|
* 上传excel相关
|
|
* 上传excel相关
|
|
@@ -150,6 +193,19 @@ const customFieldChange = (val) => {
|
|
|
|
|
|
form.value.customFieldName = JSON.stringify(result);
|
|
form.value.customFieldName = JSON.stringify(result);
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+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)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+}
|
|
const beforeOpenDialog = (done, type, loading) => {
|
|
const beforeOpenDialog = (done, type, loading) => {
|
|
if (
|
|
if (
|
|
type === "edit" &&
|
|
type === "edit" &&
|