|
|
@@ -57,17 +57,13 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="源单单号" prop="purchaseOrderNo">
|
|
|
+ <el-form-item label="采购订单" prop="purchaseOrderNo">
|
|
|
<OrderSelect
|
|
|
ref="purchaseOrder"
|
|
|
v-model="form.purchaseOrderNo"
|
|
|
clearable
|
|
|
- :disabled="
|
|
|
- form.receiptType === '4' ||
|
|
|
- form.receiptType === '2' ||
|
|
|
- !!materialLots
|
|
|
- "
|
|
|
- placeholder="请选择源单单号"
|
|
|
+ :disabled="form.receiptType === '4' ||form.receiptType === '2'||!!materialLots"
|
|
|
+ placeholder="请选择采购订单"
|
|
|
:options="orderOptions"
|
|
|
@change="OrderNoChange"
|
|
|
/>
|
|
|
@@ -573,6 +569,10 @@ export default {
|
|
|
if (data.receiptType == 2) {
|
|
|
this.otherShow = false;
|
|
|
}
|
|
|
+ if(data.receiptType !== 1){
|
|
|
+ // 设置采购订单号为非必填项
|
|
|
+ this.$refs.form.rules.purchaseOrderNo[0].required = false;
|
|
|
+ }
|
|
|
// 补打列表
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.labelRepair.queryParams.materialLots = materialLots;
|
|
|
@@ -582,7 +582,7 @@ export default {
|
|
|
// 物料列表
|
|
|
this.list = data.materials;
|
|
|
// 附件列表
|
|
|
- this.$refs.attachmentUpload.fileList = data.filesListVos;
|
|
|
+ this.uploadFiles = data.filesListVos;
|
|
|
await this.supplierChange({ code: this.form.supplierCode });
|
|
|
await this.fetchOrderNoList(this.form.supplierCode);
|
|
|
await this.OrderNoChange({
|
|
|
@@ -709,10 +709,12 @@ export default {
|
|
|
try {
|
|
|
await this.$refs.form.validate();
|
|
|
this.sureLoading = true;
|
|
|
+
|
|
|
+ //取出上传的文件id
|
|
|
const files = this.uploadFiles.map((item) => {
|
|
|
- const { fileId } = item.url;
|
|
|
- return fileId;
|
|
|
- });
|
|
|
+ return item.id || item.name?.fileId;
|
|
|
+ }).filter(id => id && id !== '');
|
|
|
+
|
|
|
const isAll = this.list.some(
|
|
|
(item) => item.qty && item.length && item.width
|
|
|
);
|
|
|
@@ -1020,19 +1022,10 @@ export default {
|
|
|
handleUpload() {
|
|
|
this.$refs.attachmentUpload.isUploadShow = -1;
|
|
|
this.$refs.attachmentUpload.title = "上传附件";
|
|
|
- if (this.uploadFiles.length > 0) {
|
|
|
- // const { fileId } = this.uploadFiles[0].name
|
|
|
- const fileIds = this.uploadFiles.map((item) => {
|
|
|
- const { fileId } = item.name;
|
|
|
- return fileId;
|
|
|
- });
|
|
|
- const params = {
|
|
|
- files: fileIds.join(",") || null,
|
|
|
- };
|
|
|
- getFilesById(params).then((res) => {
|
|
|
- this.$refs.attachmentUpload.fileList = res.data || [];
|
|
|
- });
|
|
|
- }
|
|
|
+
|
|
|
+ // 直接使用当前组件维护的 uploadFiles,而不是重新获取
|
|
|
+ this.$refs.attachmentUpload.fileList = this.uploadFiles || [];
|
|
|
+
|
|
|
this.$refs.attachmentUpload.visible = true;
|
|
|
},
|
|
|
// 获取上传的附件
|