|
@@ -134,7 +134,24 @@
|
|
|
<el-table-column label="序号" type="index" width="60" />
|
|
|
<el-table-column label="物料类别" prop="workCode">
|
|
|
<template v-slot="{ row }">
|
|
|
- <el-text>{{ row.workCode }}</el-text>
|
|
|
+ <el-text v-if="dialogType === 1 || form.state > 0">{{
|
|
|
+ row.stockLabel
|
|
|
+ }}</el-text>
|
|
|
+ <el-select
|
|
|
+ v-else
|
|
|
+ size="small"
|
|
|
+ filterable
|
|
|
+ v-model="row.workCode"
|
|
|
+ placeholder="请选择领用人员"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="option in dictInStock"
|
|
|
+ :key="option.dictValue"
|
|
|
+ :label="option.dictLabel"
|
|
|
+ :value="option.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="零、部(组)件图号" prop="materialCode" />
|
|
@@ -339,7 +356,7 @@
|
|
|
size="small"
|
|
|
filterable
|
|
|
v-model="form.approveUser"
|
|
|
- placeholder="请选择审批人员"
|
|
|
+ placeholder="请选择物料类别"
|
|
|
clearable
|
|
|
>
|
|
|
<el-option
|
|
@@ -487,6 +504,7 @@ import {
|
|
|
} from "@/api/order";
|
|
|
import { getUserList } from "@/api/system/user";
|
|
|
import { useCommonStoreHook } from "@/store";
|
|
|
+import { queryDictDataByType } from "@/api/system/dict";
|
|
|
const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
|
const test = () => {
|
|
|
isShowTable.value = true;
|
|
@@ -507,12 +525,27 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
|
|
|
const { username } = useUserStoreHook().user;
|
|
|
const minusItem = (row) => {
|
|
|
tableDataList.value = tableDataList.value.filter(
|
|
|
- (item) => item.id !== row.id
|
|
|
+ (item) => item.materialCode !== row.materialCode
|
|
|
);
|
|
|
+ // tableDataList.value.splice(row, 1);
|
|
|
};
|
|
|
+const dictInStock = ref([]);
|
|
|
const changeOrder = (val) => {
|
|
|
queryApplyInfoDetails({ workOrderCode: val }).then((data) => {
|
|
|
tableDataList.value = data.data;
|
|
|
+ if (
|
|
|
+ Object.keys(tableDataList).length > 0 &&
|
|
|
+ Object.keys(dictInStock).length > 0
|
|
|
+ ) {
|
|
|
+ tableDataList.value.map((obj) => {
|
|
|
+ let dictData = dictInStock.value.find(
|
|
|
+ (item) => item.dictValue === obj.workCode
|
|
|
+ );
|
|
|
+ if (dictData !== undefined) {
|
|
|
+ obj.stockLabel = dictData.dictLabel;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
};
|
|
|
const saveForm = (type) => {
|
|
@@ -525,10 +558,10 @@ const saveForm = (type) => {
|
|
|
return;
|
|
|
}
|
|
|
for (let item of tableDataList.value) {
|
|
|
- /*if(!item.workCode){
|
|
|
- ElMessage.error("工作令号不能为空")
|
|
|
+ if (!item.workCode) {
|
|
|
+ ElMessage.error("物料类型不能为空");
|
|
|
return;
|
|
|
- }*/
|
|
|
+ }
|
|
|
if (!item.num || item.num <= 0) {
|
|
|
ElMessage.error("物料数量不正确");
|
|
|
return;
|
|
@@ -631,7 +664,21 @@ const openDialog = (type, row) => {
|
|
|
if (type !== 0) {
|
|
|
queryApplyInfoDetails({ applyCode: row.applyCode }).then((data) => {
|
|
|
tableDataList.value = data.data;
|
|
|
+ if (
|
|
|
+ Object.keys(tableDataList).length > 0 &&
|
|
|
+ Object.keys(dictInStock).length > 0
|
|
|
+ ) {
|
|
|
+ tableDataList.value.map((obj) => {
|
|
|
+ let dictData = dictInStock.value.find(
|
|
|
+ (item) => item.dictValue === obj.workCode
|
|
|
+ );
|
|
|
+ if (dictData !== undefined) {
|
|
|
+ obj.stockLabel = dictData.dictLabel;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
+
|
|
|
form.value = row;
|
|
|
}
|
|
|
form.value.countersign = [];
|
|
@@ -768,6 +815,10 @@ onMounted(() => {
|
|
|
url.indexOf("workOrderCode") + 14
|
|
|
);
|
|
|
}
|
|
|
+ //获取入库物料类别字典
|
|
|
+ queryDictDataByType("stock_material_type").then((data) => {
|
|
|
+ dictInStock.value = data.data;
|
|
|
+ });
|
|
|
queryWorkOrderList({}).then((data) => {
|
|
|
if (!data.data) {
|
|
|
ElMessage.warning("请维护物料BOM");
|