fix:禅道165、166

This commit is contained in:
shijing 2025-11-13 10:00:17 +08:00
parent 401bb614c5
commit 6035ffb19d
2 changed files with 65 additions and 52 deletions

View File

@ -80,7 +80,7 @@
<el-main style="padding: 8px 0 0 0">
<el-container>
<el-header> <h2>管数据</h2> </el-header>
<el-main id="guanTable" style="background: #ffffff">
<el-main id="guanTable" style="background: #ffffff;padding-left:23px;">
<el-table
:data="tableData22"
style="width: 1200px"

View File

@ -27,13 +27,17 @@
style="width: 100%"
filterable
:disabled="mode == 'edit'"
@change="batchChange"
>
<el-option
v-for="item in wmaterialOptions"
:key="item"
:label="item"
:value="item"
/>
:key="item.id"
:label="item.batch"
:value="item.batch"
>
<span style="float:left">{{item.batch}}</span>
<span style="float:right">{{item.count_cando}}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
@ -84,9 +88,11 @@
controls-position="right"
:min="0"
:step="1"
:max="countCanDo"
:step-strictly="true"
style="width: 100%"
placeholder="请输入领用数量"
@change="countUseChange"
>
</el-input-number>
</el-form-item>
@ -98,9 +104,11 @@
controls-position="right"
:min="0"
:step="1"
:max="countCanDo"
:step-strictly="true"
style="width: 100%"
placeholder="请输入加工数量"
@change="countRealChange"
>
</el-input-number>
</el-form-item>
@ -112,6 +120,7 @@
controls-position="right"
:min="0"
:step="1"
:max="countCanDo"
:step-strictly="true"
style="width: 100%"
placeholder="请输入合格数"
@ -137,18 +146,6 @@
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :md="12" :sm="24">
<el-form-item label="操作日期" prop="handle_date">
<el-date-picker
v-model="form.handle_date"
type="date"
placeholder="操作日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
style="width: 100%"
/>
</el-form-item>
</el-col> -->
</el-row>
<div class="formTitle">不合格原因及数量:</div>
<el-row>
@ -597,6 +594,7 @@ export default {
handle_name: "",
leader_name: "",
count_n_all: null,
countCanDo:0,
rules: {},
};
},
@ -609,10 +607,6 @@ export default {
this.form.material_out = this.material_out;
this.form.handle_date = this.handle_date;
this.form.mgroup = this.mgroup;
// if(this.mode == "add"){
// let date = new Date();
// this.form.work_start_time = this.$TOOL.dateFormat1(date);
// }
},
methods: {
getRouteOptions() {
@ -648,15 +642,18 @@ export default {
page: 0,
})
.then((res) => {
if (res.length > 0) {
let arr = [];
res.forEach((item) => {
arr.push(item.batch);
});
that.wmaterialOptions = arr;
}
that.wmaterialOptions = res;
});
},
batchChange(){
let that = this;
that.wmaterialOptions.forEach((item)=>{
if(item.batch == that.form.batch){
that.form.count_use = that.form.count_real = that.form.count_ok = item.count_cando;
that.countCanDo = item.count_cando;
}
})
},
//
getBatchs() {
let that = this;
@ -689,31 +686,47 @@ export default {
this.visible = true;
return this;
},
countUseChange(){
let that = this;
that.form.count_real = that.form.count_use;
that.form.count_ok = that.form.count_real - that.form.count_notok;
},
countRealChange(){
let that = this;
that.form.count_ok = that.form.count_real - that.form.count_notok;
},
countNotOkSun() {
this.form.count_notok =
Number(this.form.count_n_hs) +
Number(this.form.count_n_cs) +
Number(this.form.count_n_zz) +
Number(this.form.count_n_tw) +
Number(this.form.count_n_zdd) +
Number(this.form.count_n_d) +
Number(this.form.count_n_dl) +
Number(this.form.count_n_qp) +
Number(this.form.count_n_bl) +
Number(this.form.count_n_hw) +
Number(this.form.count_n_yp) +
Number(this.form.count_n_bp) +
Number(this.form.count_n_sc) +
Number(this.form.count_n_zjd) +
Number(this.form.count_n_zjx) +
Number(this.form.count_n_qx) +
Number(this.form.count_n_js) +
Number(this.form.count_n_tydd) +
Number(this.form.count_n_sw) +
Number(this.form.count_n_bhpcd) +
Number(this.form.count_n_wq) +
Number(this.form.count_n_qt) +
Number(this.form.count_n_zw);
let that = this;
that.form.count_notok =
Number(that.form.count_n_hs) +
Number(that.form.count_n_cs) +
Number(that.form.count_n_zz) +
Number(that.form.count_n_tw) +
Number(that.form.count_n_zdd) +
Number(that.form.count_n_d) +
Number(that.form.count_n_dl) +
Number(that.form.count_n_qp) +
Number(that.form.count_n_bl) +
Number(that.form.count_n_hw) +
Number(that.form.count_n_yp) +
Number(that.form.count_n_bp) +
Number(that.form.count_n_sc) +
Number(that.form.count_n_zjd) +
Number(that.form.count_n_zjx) +
Number(that.form.count_n_qx) +
Number(that.form.count_n_js) +
Number(that.form.count_n_tydd) +
Number(that.form.count_n_sw) +
Number(that.form.count_n_bhpcd) +
Number(that.form.count_n_wq) +
Number(that.form.count_n_qt) +
Number(that.form.count_n_zw);
if(that.form.count_notok < that.form.count_real){
that.form.count_ok = that.form.count_real - that.form.count_notok;
}else{
that.form.count_ok = that.form.count_real - that.form.count_notok;
that.$message.error("不合格数量不能大于加工数量,请检查不合格数量");
}
},
//
submit() {