Compare commits

...

2 Commits

  1. 156
      src/views/productionManagement/shortageApplication/components/declareAdd.vue
  2. 3
      src/views/productionManagement/shortageApplication/index.vue
  3. 11
      src/views/zhgd-work/dacangDispatch/index.vue
  4. 6
      vite.config.mjs

@ -148,9 +148,60 @@ export default {
], ],
// //
reworkCode: [{ required: true, message: '请输入', trigger: ['blur', 'submit'] }], reworkCode: [
quantity: [{ required: true, message: '请输入', trigger: ['blur', 'submit'] }], {
validator: (rule, value, callback) => {
//
// rule.field "tableData[0].reworkCode"
const match = rule.field.match(/tableData\[(\d+)\]/);
if (match) {
const index = parseInt(match[1]);
const row = this.form.tableData[index];
// (_select true)
if (row && row._select) {
if (!value) {
callback(new Error('请输入返工单号'));
} else {
callback();
}
} else {
//
callback();
}
} else {
callback();
}
},
trigger: ['blur', 'change'],
},
],
quantity: [
{
validator: (rule, value, callback) => {
const match = rule.field.match(/tableData\[(\d+)\]/);
if (match) {
const index = parseInt(match[1]);
const row = this.form.tableData[index];
if (row && row._select) {
if (!value) {
callback(new Error('请输入数量'));
} else {
callback();
}
} else {
callback();
}
} else {
callback();
}
},
trigger: ['blur', 'change'],
},
],
}, },
selectTableData: [], //
}; };
}, },
mounted() { mounted() {
@ -164,10 +215,7 @@ export default {
this.batchLoading = true; this.batchLoading = true;
queryBatch({ partCode: this.form.partCode }) queryBatch({ partCode: this.form.partCode })
.then(res => { .then(res => {
if (res.data.data) { this.form.tableData = res.data.data || [];
this.form.tableData.push(res.data.data);
}
// this.form.tableData = res.data.data || [];
this.batchLoading = false; this.batchLoading = false;
}) })
.catch(err => { .catch(err => {
@ -181,19 +229,18 @@ export default {
}, },
selectChange(list, row) { selectChange(list, row) {
if (list.length > 0) {
list.forEach(item => {
item.quantity = null;
item.woCode = null;
item.reworkCode = null;
item.remark = null;
});
}
this.selectTableData = list;
row._select = !row._select; row._select = !row._select;
}, },
// push tableData
addTable() {
this.form.tableData.push({
_select: false, //
wcId: '', // ID
batchNo: '', // /
preserveContent: '', //
});
},
// //
delTable() { delTable() {
this.form.tableData = this.form.tableData.filter(row => !row._select); this.form.tableData = this.form.tableData.filter(row => !row._select);
@ -212,48 +259,57 @@ export default {
submitForm() { submitForm() {
this.formError = ''; this.formError = '';
// Form // 1.
this.$refs.tableForm.validate((isValid, invalidFields) => { const selectedRows = this.form.tableData.filter(row => row._select);
if (!isValid) {
// // 2.
this.formError = '存在未完善的字段,请检查表格中的红色提示'; if (selectedRows.length === 0) {
this.$message.warning('请至少选择一行数据进行申报');
return;
}
// 3.
// validator row._select
//
this.$refs.tableForm.validate(valid => {
if (valid) {
this.saveLoading = true;
let query = []
selectedRows.forEach(row => {
query.push({
useCode: row.useCode,//
woCode: row.woCode,//
reworkCode: row.reworkCode,//
partCode: row.prtno,//
batchNo: row.splcode,//
quaLevel: row.prtlotno,//
quantity: row.quantity,//
remark: row.remark,//
keeper: row.warctlr,//
planMan: row.schemer,//
locationNo:row.warlocno,//
})
})
saveDeclare({orderDeclares:query})
.then(res => {
this.$message.success('操作成功');
this.saveLoading = false;
this.closeDialog();
})
.catch(err => {
this.saveLoading = false;
});
} else {
this.formError = '选中数据存在未完善的字段,请检查表格中的红色提示';
this.$nextTick(() => { this.$nextTick(() => {
//
const firstError = document.querySelector('.el-form-item.is-error'); const firstError = document.querySelector('.el-form-item.is-error');
if (firstError) { if (firstError) {
firstError.scrollIntoView({ behavior: 'smooth', block: 'center' }); firstError.scrollIntoView({ behavior: 'smooth', block: 'center' });
} }
}); });
return; return false;
} }
this.saveLoading = true;
//
saveDeclare(this.form.tableData)
.then(res => {
this.$message.success('操作成功');
this.saveLoading = false;
this.closeDialog();
})
.catch(err => {
this.saveLoading = false;
});
// try {
// const res = saveDeclare(this.form.tableData);
// if (res.code === 200) {
// this.$message.success('');
// this.closeDialog();
// this.$emit('submitSuccess', submitData);
// } else {
// this.$message.error(res.msg || '');
// }
// } catch (err) {
// this.$message.error(err);
// console.error('', err);
// }
}); });
}, },
}, },

@ -29,7 +29,7 @@
</avue-crud> </avue-crud>
<!-- 申报 --> <!-- 申报 -->
<declareAdd v-if="declareAddShow" :showDialog="declareAddShow"></declareAdd> <declareAdd v-if="declareAddShow" :showDialog="declareAddShow" @closeDialog="closeDialog"></declareAdd>
</basic-container> </basic-container>
</template> </template>
<script> <script>
@ -235,6 +235,7 @@ export default {
// //
closeDialog(isRefresh) { closeDialog(isRefresh) {
this.isShowImport = false; this.isShowImport = false;
this.declareAddShow = false
this.onLoad(this.page, this.query); this.onLoad(this.page, this.query);
}, },
handleAdd() { handleAdd() {

@ -19,7 +19,7 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div style="width: 80%; margin: 0 auto 0"> <div style="width: 60%; margin: 0 auto 0">
<el-descriptions <el-descriptions
:column="10" :column="10"
title="派活信息" title="派活信息"
@ -28,9 +28,9 @@
border border
></el-descriptions> ></el-descriptions>
<el-table :data="tableData"> <el-table :data="tableData">
<el-table-column prop="date" label="工序号" align="center" /> <el-table-column prop="processNo" label="工序号" align="center" />
<el-table-column prop="name" label="工序名称" align="center" /> <el-table-column prop="processName" label="工序名称" align="center" />
<el-table-column prop="address" label="加工单位(作业中心/供应商)" align="center" /> <el-table-column prop="workCenterName" label="加工单位(作业中心/供应商)" align="center" />
</el-table> </el-table>
</div> </div>
</basic-container> </basic-container>
@ -62,9 +62,8 @@ export default {
mark: this.mark ? 1 : 0, mark: this.mark ? 1 : 0,
}; };
yieldOrderConfirm(query).then(res => { yieldOrderConfirm(query).then(res => {
console.log(9898989, res);
let data = res.data.data; let data = res.data.data;
this.tableData = res.data.data
}); });
// this.$ajax // this.$ajax
// .get('pdaLoad/loadBigWmsSend/' + this.cardNo + '/' + this.mark) // .get('pdaLoad/loadBigWmsSend/' + this.cardNo + '/' + this.mark)

@ -65,10 +65,10 @@ export default ({ mode, command }) => {
// target: 'http://192.168.0.127:80',//外协本地 // target: 'http://192.168.0.127:80',//外协本地
// target: 'http://192.168.0.126:80',//举手本地 // target: 'http://192.168.0.126:80',//举手本地
// target: 'http://192.168.0.115:80',//工作台消息本地 // target: 'http://192.168.0.115:80',//工作台消息本地
target: 'http://192.168.1.5:82', // target: 'http://192.168.1.5:82',
// target: "http://192.168.1.4:82", target: "http://192.168.0.4",
// target: 'http://49.232.74.228:82', // target: 'http://49.232.74.228:82',
// target: "http://192.168.0.2", // target: "http://192.168.1.4:82",
// target: 'https://saber3.bladex.cn/api', // target: 'https://saber3.bladex.cn/api',
// target: 'http://49.232.74.228:82', // target: 'http://49.232.74.228:82',
// target: "http:192.168.0.220:80", // target: "http:192.168.0.220:80",

Loading…
Cancel
Save