refactor(入库计划): 同步小型刀具库 更改为按钮触发

This commit is contained in:
Kelvin 2024-12-05 11:39:54 +08:00
parent 4d5c3ea548
commit e273d0636a
2 changed files with 30 additions and 8 deletions

View File

@ -51,3 +51,11 @@ export function isDuplicatePlanCode(planCode) {
method: 'get'
})
}
// 同步小型刀具库 入库数据
export function syncInBound() {
return request({
url: '/wm/PLAN/sync',
method: 'get'
})
}

View File

@ -58,6 +58,16 @@
>拆刀回库
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-refresh"
size="mini"
@click="handleSync"
>同步小型刀具库
</el-button>
</el-col>
<el-col :span="1.5">
</el-col>
@ -137,9 +147,9 @@
<el-dialog :title="dialogTitle" :visible.sync="open" width="50%" append-to-body :close-on-click-modal="false">
<!--状态为 1 已执行 则禁用表单-->
<el-form ref="form" :model="form" :rules="rules" label-width="80px" inline :disabled="form.state === '1'">
<el-form-item label="计划编码" prop="planCode">
<el-input v-model="form.planCode" placeholder="请输入计划编码"></el-input>
</el-form-item>
<!-- <el-form-item label="计划编码" prop="planCode">-->
<!-- <el-input v-model="form.planCode" placeholder="请输入计划编码"></el-input>-->
<!-- </el-form-item>-->
<el-form-item label="源头单据" prop="relBillCode">
<el-input v-model="form.relBillCode" placeholder="请输入源头单据"></el-input>
</el-form-item>
@ -235,7 +245,7 @@
</template>
<script>
import {listPLAN, getPLAN, delPLAN, addPLAN, updatePLAN, isDuplicatePlanCode,} from "@/api/wm/PLAN";
import {listPLAN, getPLAN, delPLAN, addPLAN, updatePLAN, isDuplicatePlanCode, syncInBound,} from "@/api/wm/PLAN";
import {listTYPE} from "@/api/md/TYPE";
import {listMdItem} from "@/api/mes/md/mdItem"
import {listArea} from "@/api/mes/wm/area"
@ -354,8 +364,6 @@ export default {
this.PLANList = response.rows;
this.total = response.total;
this.getPlanTypeList();
this.getMdItemList();
this.getAreaList();
this.loading = false;
});
},
@ -379,7 +387,6 @@ export default {
* @param itemName
*/
getMdItemList(itemName = "") {
this.loading = true;
const params = {
pageNum: 1,
pageSize: 100,
@ -395,7 +402,6 @@ export default {
* @param areaName
*/
getAreaList(areaName = "") {
this.loading = true;
const params = {
pageNum: 1,
pageSize: 100,
@ -500,6 +506,12 @@ export default {
this.single = selection.length !== 1
this.multiple = !selection.length
},
handleSync() {
syncInBound().then(res => {
this.getList();
this.$message.success("数据同步成功");
})
},
/** 新增按钮操作 */
handleAdd(planTypeCode) {
this.reset();
@ -519,6 +531,8 @@ export default {
} else {
this.knifeBackVisible = true;
}
this.getMdItemList();
this.getAreaList();
this.dialogTitle = "新增" + filter[0].name;
},
/** 执行按钮操作 */