|
@@ -18,6 +18,7 @@
|
|
|
@selection-change="selectionChange"
|
|
|
:span-method="spanMethod"
|
|
|
>
|
|
|
+
|
|
|
<template #orderCode="{ row }">
|
|
|
<el-text v-if="row.orderCode">{{row.orderCode}}</el-text>
|
|
|
<div style="width: 100%; height: 100%;display: flex" v-if="!row.orderCode && row.operationDetails">
|
|
@@ -36,41 +37,23 @@
|
|
|
<el-tag v-if="row.workOrderCode === '-' && row.stockNum === '0'" type="danger">库存数量:{{ row.stockNum }}</el-tag>
|
|
|
</template>
|
|
|
<template #menu="{size,row,index}">
|
|
|
-<!-- <el-button
|
|
|
+ <el-button
|
|
|
type="primary"
|
|
|
link
|
|
|
- v-if="row.bom === '0' || row.dataFile === '0'|| row.routeId === '0'|| row.craftFile === '0'"
|
|
|
+ v-if="row.materialState === '0'"
|
|
|
size="small"
|
|
|
@click="handleEdit(row,0)"
|
|
|
- ><i-ep-edit />编辑
|
|
|
- </el-button>-->
|
|
|
- <el-button
|
|
|
+ ><i-ep-edit />编辑准备
|
|
|
+ </el-button>
|
|
|
+<!-- <el-button
|
|
|
type="primary"
|
|
|
link
|
|
|
v-if="row.deviceState === '0' || row.bom === '-' || row.craftFile === '-' || row.materialState === '0'"
|
|
|
size="small"
|
|
|
@click="handleRefresh(row.workOrderCode)"
|
|
|
><i-ep-edit />刷新
|
|
|
- </el-button>
|
|
|
-<!-- <el-button
|
|
|
- type="primary"
|
|
|
- link
|
|
|
- v-if="row.bom === '0' || row.dataFile === '0'|| row.routeId === '0'|| row.craftFile === '0' || row.materialState === '0' || row.deviceState === '0'"
|
|
|
- size="small"
|
|
|
- @click="deleteRow(row)"
|
|
|
- ><i-ep-edit />删除
|
|
|
</el-button>-->
|
|
|
</template>
|
|
|
-<!-- <template #menu-left="{ size }">
|
|
|
- <el-button
|
|
|
- :disabled="toDeleteIds.length < 1"
|
|
|
- type="danger"
|
|
|
- icon="el-icon-delete"
|
|
|
- :size="size"
|
|
|
- @click="multipleDelete"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
- </template>-->
|
|
|
</avue-crud>
|
|
|
<el-dialog
|
|
|
v-model="dialog.visible"
|
|
@@ -80,6 +63,77 @@
|
|
|
>
|
|
|
<work-order-page queryType="1" @orderInfo="orderInfo"/>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialog1.visible"
|
|
|
+ :title="dialog1.title"
|
|
|
+ width="45%"
|
|
|
+ @close="dialog1.visible = false"
|
|
|
+ >
|
|
|
+ <el-form ref="dataFormRef" :model="form" label-width="90px">
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="工单编码" prop="materialCode">
|
|
|
+ <el-input v-model="form.workOrderCode" disabled/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="订单编码" prop="materialName">
|
|
|
+ <el-input v-model="form.orderCode" disabled/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="订单名称" prop="materialModel">
|
|
|
+ <el-input v-model="form.orderName" disabled/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="物料编码" prop="materialCode">
|
|
|
+ <el-input v-model="form.materialCode" disabled/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="物料名称" prop="materialName">
|
|
|
+ <el-input v-model="form.materialName" disabled/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="物料型号" prop="materialModel">
|
|
|
+ <el-input v-model="form.materialModel" disabled/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="工单数量" prop="materialModel">
|
|
|
+ <el-input v-model="form.workOrderNum" disabled/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24" v-for="(item,index) in templates">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item :label="templates[index].str" >
|
|
|
+ <el-switch
|
|
|
+ class="mb-2"
|
|
|
+ v-model="templates[index].state"
|
|
|
+ style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
|
|
+ active-text="完成"
|
|
|
+ inactive-text="未完成"
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="0"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="onSubmit">确 定</el-button>
|
|
|
+ <el-button @click="dialog1.visible = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -89,13 +143,14 @@ import { useCrud } from "@/hooks/userCrud";
|
|
|
import {prepareCheckInfo,refreshPrepareCheckInfo} from "@/api/order"
|
|
|
import {queryChildrenInfo} from "@/api/process"
|
|
|
import { useCommonStoreHook } from "@/store";
|
|
|
+import { queryDictDataByType } from "@/api/system/dict";
|
|
|
const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
|
const router = useRouter();
|
|
|
const test = () => {
|
|
|
isShowTable.value = true;
|
|
|
tableType.value = tableType.value == 1 ? 2 : 1;
|
|
|
};
|
|
|
-
|
|
|
+const templates = ref([])
|
|
|
// 传入一个url,后面不带/
|
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
useCrud({
|
|
@@ -110,6 +165,15 @@ const dialog = reactive({
|
|
|
title: "订单选择",
|
|
|
visible: false,
|
|
|
});
|
|
|
+const dialog1 = reactive({
|
|
|
+ title: "生产准备",
|
|
|
+ visible: false,
|
|
|
+});
|
|
|
+const onSubmit = (done,loading) => {
|
|
|
+ form.value.materialStr = JSON.stringify(templates.value)
|
|
|
+ updateRow(done,loading)
|
|
|
+ dialog1.visible = false
|
|
|
+}
|
|
|
const merginState = ref(false)
|
|
|
const spanMethod = ({ row, column, rowIndex, columnIndex })=>{
|
|
|
if(row.hasParent){
|
|
@@ -144,7 +208,10 @@ const treeLoad = (tree, treeNode, resolve) =>{
|
|
|
})
|
|
|
}
|
|
|
const handleEdit =(row,index)=>{
|
|
|
- crudRef.value && crudRef.value.rowEdit(row,index);
|
|
|
+ dialog1.visible = true
|
|
|
+ form.value = row
|
|
|
+ templates.value = []
|
|
|
+ templates.value = JSON.parse(row.materialStr)
|
|
|
}
|
|
|
const handleRefresh =(code)=>{
|
|
|
refreshPrepareCheckInfo(code).then((data)=>{
|
|
@@ -175,6 +242,7 @@ option.value = Object.assign(option.value, {
|
|
|
lazy: true,
|
|
|
menuWidth: 100,
|
|
|
rowKey: 'workOrderCode',
|
|
|
+ defaultExpandedKeys: [],
|
|
|
addBtn: false,
|
|
|
dialogWidth: '45%', // 设置编辑弹窗的宽度为50%
|
|
|
column: [
|
|
@@ -182,7 +250,7 @@ option.value = Object.assign(option.value, {
|
|
|
label: "工单号",
|
|
|
prop: "workOrderCode",
|
|
|
search: true,
|
|
|
- minWidth: 200,
|
|
|
+ minWidth: 120,
|
|
|
editDisabled : true,
|
|
|
rules: [
|
|
|
{
|
|
@@ -284,7 +352,7 @@ option.value = Object.assign(option.value, {
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
- {
|
|
|
+ /*{
|
|
|
label: "文件资料",
|
|
|
width: 350,
|
|
|
overHidden: true,
|
|
@@ -360,19 +428,7 @@ option.value = Object.assign(option.value, {
|
|
|
}
|
|
|
return '<b class="el-tag el-tag--danger el-tag--light">'+val.materialStr+'</b>';
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- label: "创建时间",
|
|
|
- prop: "created",
|
|
|
- width: 200,
|
|
|
- display: false
|
|
|
- },
|
|
|
- {
|
|
|
- label: "创建人",
|
|
|
- width: 200,
|
|
|
- prop: "creator",
|
|
|
- display: false
|
|
|
- },
|
|
|
+ },*/
|
|
|
],
|
|
|
});
|
|
|
|
|
@@ -384,6 +440,55 @@ onMounted(() => {
|
|
|
if(url.includes("workOrderCode")){
|
|
|
search.value.workOrderCode = url.substring(url.indexOf("workOrderCode")+ 14)
|
|
|
}
|
|
|
+ queryDictDataByType("prepare_template").then((res)=>{
|
|
|
+ if(res.data){
|
|
|
+ //templates.value = res.data
|
|
|
+ res.data.forEach((item)=>{
|
|
|
+ option.value.column.push(
|
|
|
+ {
|
|
|
+ label: item.dictLabel,
|
|
|
+ prop: item.dictValue,
|
|
|
+ width: 100,
|
|
|
+ slot: true,
|
|
|
+ display: false,
|
|
|
+ html: true,
|
|
|
+ formatter: (val) => {
|
|
|
+ let state = "-1"
|
|
|
+ if(val.materialStr){
|
|
|
+ let list = JSON.parse(val.materialStr);
|
|
|
+ let obj = list.find(option => option.name === item.dictValue);
|
|
|
+ if(obj){
|
|
|
+ state = obj.state;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (state === '1') {
|
|
|
+ return '<b class="el-tag el-tag--success el-tag--light">已完成</b>';
|
|
|
+ }else if(state === '0'){
|
|
|
+ return '<b class="el-tag el-tag--danger el-tag--light">未完成</b>';
|
|
|
+ }
|
|
|
+ return '<b class="el-tag el-tag--warrning el-tag--light">未配置</b>';
|
|
|
+ },
|
|
|
+ }
|
|
|
+ )
|
|
|
+ })
|
|
|
+ }
|
|
|
+ option.value.column.push(
|
|
|
+ {
|
|
|
+ label: "创建时间",
|
|
|
+ prop: "created",
|
|
|
+ width: 200,
|
|
|
+ display: false
|
|
|
+ }
|
|
|
+ )
|
|
|
+ option.value.column.push(
|
|
|
+ {
|
|
|
+ label: "创建人",
|
|
|
+ width: 200,
|
|
|
+ prop: "creator",
|
|
|
+ display: false
|
|
|
+ }
|
|
|
+ )
|
|
|
+ })
|
|
|
dataList();
|
|
|
});
|
|
|
|