|
@@ -15,7 +15,12 @@
|
|
|
select: selectRow,
|
|
|
'select-all':selectRow
|
|
|
}" @get-list="getList">
|
|
|
-
|
|
|
+ <template #pic="{ item }">
|
|
|
+ <div v-if="item.fileList &&item.fileList.length > 0">
|
|
|
+ <img :src="item.fileList[0].fileUrl" class="pic" @click="handleClickFile(item.fileList[0])" />
|
|
|
+ </div>
|
|
|
+ <div v-else></div>
|
|
|
+ </template>
|
|
|
</byTable>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="已备料" name="second">
|
|
@@ -46,11 +51,11 @@
|
|
|
<td style="width: 80px; text-align: center">数量</td>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
- <tbody v-if="selectData && selectData.length > 0">
|
|
|
- <tr v-for="(item, index) in selectData" :key="index">
|
|
|
+ <tbody v-if="printList && printList.length > 0">
|
|
|
+ <tr v-for="(item, index) in printList" :key="index">
|
|
|
<td style="text-align: center">{{ index +1}}</td>
|
|
|
- <td>{{ item.artworkName }}</td>
|
|
|
- <td>{{ item.skuSpecCode }}</td>
|
|
|
+ <td>{{ item.materialName }}</td>
|
|
|
+ <td>{{ item.materialCode }}</td>
|
|
|
<td style="text-align: center">{{ item.quantity }}</td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
@@ -84,6 +89,7 @@ const sourceList = ref({
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
keyword: "",
|
|
|
+ status: "0",
|
|
|
},
|
|
|
});
|
|
|
const treeData = ref([]);
|
|
@@ -109,78 +115,67 @@ const config = ref([
|
|
|
width: 60,
|
|
|
},
|
|
|
},
|
|
|
- {
|
|
|
- attrs: {
|
|
|
- label: "设计图",
|
|
|
- prop: "code",
|
|
|
- },
|
|
|
- },
|
|
|
+
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "物料图片",
|
|
|
- prop: "code",
|
|
|
+ slot: "pic",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "物料编码",
|
|
|
- prop: "code",
|
|
|
+ prop: "materialCode",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "物料名称",
|
|
|
- prop: "name",
|
|
|
+ prop: "materialName",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "数量",
|
|
|
- prop: "name",
|
|
|
+ prop: "quantity",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "时间",
|
|
|
- prop: "deptName",
|
|
|
+ prop: "preparationDeadline",
|
|
|
},
|
|
|
},
|
|
|
]);
|
|
|
const configOne = ref([
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "设计图",
|
|
|
- prop: "code",
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- attrs: {
|
|
|
label: "物料图片",
|
|
|
- prop: "code",
|
|
|
+ slot: "pic",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "物料编码",
|
|
|
- prop: "code",
|
|
|
+ prop: "materialCode",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "物料名称",
|
|
|
- prop: "name",
|
|
|
+ prop: "materialName",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "数量",
|
|
|
- prop: "name",
|
|
|
+ prop: "quantity",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "投产时间",
|
|
|
- prop: "deptName",
|
|
|
+ prop: "productionTime",
|
|
|
},
|
|
|
},
|
|
|
]);
|
|
@@ -233,17 +228,27 @@ const getList = async (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
loading.value = true;
|
|
|
proxy
|
|
|
- .post("/produceOrderDetail/page", sourceList.value.pagination)
|
|
|
+ .post("/materialPreparation/page", sourceList.value.pagination)
|
|
|
.then((res) => {
|
|
|
sourceList.value.data = res.rows.map((x) => ({ ...x, isCheck: true }));
|
|
|
sourceList.value.pagination.total = res.total;
|
|
|
setTimeout(() => {
|
|
|
loading.value = false;
|
|
|
}, 200);
|
|
|
+ const productIdList = res.rows.map((x) => x.materialId);
|
|
|
+ // 请求文件数据并回显
|
|
|
+ if (productIdList.length > 0) {
|
|
|
+ proxy.getFile(productIdList, sourceList.value.data, "materialId");
|
|
|
+ }
|
|
|
});
|
|
|
};
|
|
|
|
|
|
const handleTabChange = (val) => {
|
|
|
+ if (val == "first") {
|
|
|
+ sourceList.value.pagination.status = "0";
|
|
|
+ } else {
|
|
|
+ sourceList.value.pagination.status = "1";
|
|
|
+ }
|
|
|
getList();
|
|
|
};
|
|
|
|
|
@@ -252,9 +257,23 @@ const selectRow = (data) => {
|
|
|
selectData.value = data;
|
|
|
};
|
|
|
const printTime = ref("");
|
|
|
+const printList = ref([]);
|
|
|
const openModal = () => {
|
|
|
- dialogVisible.value = true;
|
|
|
+ let list = [];
|
|
|
+ for (let i = 0; i < selectData.value.length; i++) {
|
|
|
+ const e = selectData.value[i];
|
|
|
+ if (i == 0) {
|
|
|
+ list.push(e);
|
|
|
+ } else {
|
|
|
+ const index = list.findIndex((x) => x.materialId == e.materialId);
|
|
|
+ if (index > 0) {
|
|
|
+ list[index].quantity += e.quantity;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ printList.value = list;
|
|
|
printTime.value = moment().format("yyyy-MM-DD HH:mm:ss");
|
|
|
+ dialogVisible.value = true;
|
|
|
};
|
|
|
|
|
|
const submitForm = () => {
|
|
@@ -334,4 +353,11 @@ const printObj = ref({
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.pic {
|
|
|
+ object-fit: contain;
|
|
|
+ width: 50px;
|
|
|
+ height: 50px;
|
|
|
+ cursor: pointer;
|
|
|
+ vertical-align: middle;
|
|
|
+}
|
|
|
</style>
|