|
@@ -43,6 +43,15 @@
|
|
v-if="row.materialState === '0'"
|
|
v-if="row.materialState === '0'"
|
|
size="small"
|
|
size="small"
|
|
@click="handleEdit(row,0)"
|
|
@click="handleEdit(row,0)"
|
|
|
|
+ ><i-ep-edit />发起准备
|
|
|
|
+ </el-button>
|
|
|
|
+
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ link
|
|
|
|
+ v-if="row.materialState === '1'"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="handleEdit(row,0)"
|
|
><i-ep-edit />编辑准备
|
|
><i-ep-edit />编辑准备
|
|
</el-button>
|
|
</el-button>
|
|
<!-- <el-button
|
|
<!-- <el-button
|
|
@@ -112,24 +121,49 @@
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
<el-row :gutter="24" v-for="(item,index) in templates">
|
|
<el-row :gutter="24" v-for="(item,index) in templates">
|
|
- <el-col :span="24">
|
|
|
|
|
|
+ <el-col :span="8">
|
|
<el-form-item :label="templates[index].str" >
|
|
<el-form-item :label="templates[index].str" >
|
|
<el-switch
|
|
<el-switch
|
|
|
|
+ @change="changeItem(templates[index])"
|
|
class="mb-2"
|
|
class="mb-2"
|
|
v-model="templates[index].state"
|
|
v-model="templates[index].state"
|
|
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
|
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
|
active-text="完成"
|
|
active-text="完成"
|
|
inactive-text="未完成"
|
|
inactive-text="未完成"
|
|
|
|
+ :disabled="form.materialState === '0' || form.materialState === '1' && userStore.user.username !== templates[index].userName"
|
|
active-value="1"
|
|
active-value="1"
|
|
inactive-value="0"
|
|
inactive-value="0"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <el-form-item label="准备人员" >
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="templates[index].userName"
|
|
|
|
+ placeholder="准备人员"
|
|
|
|
+ size="large"
|
|
|
|
+ :disabled="form.materialState === '1'"
|
|
|
|
+ filterable
|
|
|
|
+ style="width: 240px">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in userList"
|
|
|
|
+ :key="item.userName"
|
|
|
|
+ :label="item.userName"
|
|
|
|
+ :value="item.userName"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <el-form-item label="完成时间" v-if="templates[index].time">
|
|
|
|
+ {{templates[index].time}}
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</el-form>
|
|
</el-form>
|
|
<template #footer>
|
|
<template #footer>
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
- <el-button type="primary" @click="onSubmit">确 定</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="onSubmit">{{form.materialState === '0' ? '发起准备' : '提交'}}</el-button>
|
|
<el-button @click="dialog1.visible = false">取 消</el-button>
|
|
<el-button @click="dialog1.visible = false">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -142,14 +176,17 @@ import { ref, getCurrentInstance } from "vue";
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
import {prepareCheckInfo,refreshPrepareCheckInfo} from "@/api/order"
|
|
import {prepareCheckInfo,refreshPrepareCheckInfo} from "@/api/order"
|
|
import {queryChildrenInfo} from "@/api/process"
|
|
import {queryChildrenInfo} from "@/api/process"
|
|
-import { useCommonStoreHook } from "@/store";
|
|
|
|
|
|
+import { useCommonStoreHook,useUserStore } from "@/store";
|
|
import { queryDictDataByType } from "@/api/system/dict";
|
|
import { queryDictDataByType } from "@/api/system/dict";
|
|
|
|
+import { getUserList } from "@/api/system/user";
|
|
const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
const test = () => {
|
|
const test = () => {
|
|
isShowTable.value = true;
|
|
isShowTable.value = true;
|
|
tableType.value = tableType.value == 1 ? 2 : 1;
|
|
tableType.value = tableType.value == 1 ? 2 : 1;
|
|
};
|
|
};
|
|
|
|
+const userStore = useUserStore();
|
|
|
|
+const userList = ref([]);
|
|
const templates = ref([])
|
|
const templates = ref([])
|
|
// 传入一个url,后面不带/
|
|
// 传入一个url,后面不带/
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
@@ -159,7 +196,20 @@ const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
|
|
const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
|
|
const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
-
|
|
|
|
|
|
+const changeItem =(item)=>{
|
|
|
|
+ let time = ""
|
|
|
|
+ if(item.state === '1'){
|
|
|
|
+ let dateIn = new Date();
|
|
|
|
+ let y=dateIn.getFullYear();
|
|
|
|
+ let m=dateIn.getMonth()+1;
|
|
|
|
+ let d=dateIn.getDate();
|
|
|
|
+ let h = dateIn.getHours();
|
|
|
|
+ let mm = dateIn.getMinutes();
|
|
|
|
+ let s = dateIn.getSeconds();
|
|
|
|
+ time = y+(m<10?"-0":"-")+m+(d<10?"-0":"-")+d + " " + (h < 10 ? "0":"") + h + (mm < 10 ? ":0":":")+mm + (s < 10 ? ":0":":")+s;
|
|
|
|
+ }
|
|
|
|
+ item.time = time
|
|
|
|
+}
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
const dialog = reactive({
|
|
const dialog = reactive({
|
|
title: "订单选择",
|
|
title: "订单选择",
|
|
@@ -171,6 +221,9 @@ const dialog1 = reactive({
|
|
});
|
|
});
|
|
const onSubmit = (done,loading) => {
|
|
const onSubmit = (done,loading) => {
|
|
form.value.materialStr = JSON.stringify(templates.value)
|
|
form.value.materialStr = JSON.stringify(templates.value)
|
|
|
|
+ if(form.value.materialState === '0'){
|
|
|
|
+ form.value.materialState = '1'
|
|
|
|
+ }
|
|
updateRow(done,loading)
|
|
updateRow(done,loading)
|
|
dialog1.visible = false
|
|
dialog1.visible = false
|
|
}
|
|
}
|
|
@@ -431,7 +484,11 @@ option.value = Object.assign(option.value, {
|
|
},*/
|
|
},*/
|
|
],
|
|
],
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+const queryUserList = () => {
|
|
|
|
+ getUserList({}).then((data) => {
|
|
|
|
+ userList.value = data.data;
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
form.value.routeId = "1"
|
|
form.value.routeId = "1"
|
|
@@ -489,6 +546,7 @@ onMounted(() => {
|
|
}
|
|
}
|
|
)
|
|
)
|
|
})
|
|
})
|
|
|
|
+ queryUserList();
|
|
dataList();
|
|
dataList();
|
|
});
|
|
});
|
|
|
|
|