This commit is contained in:
zty 2025-01-07 14:19:22 +08:00
commit 84c05428be
10 changed files with 221 additions and 28 deletions

View File

@ -405,6 +405,26 @@ export default {
}, },
}, },
}, },
routemat: {
list: {
name: "列表",
req: async function (data) {
return await http.get(`${config.API_URL}/mtm/routemat/`, data);
},
},
create: {
name: "创建",
req: async function (data) {
return await http.post(`${config.API_URL}/mtm/routemat/`, data);
},
},
delete: {
name: "删除",
req: async function (id) {
return await http.delete(`${config.API_URL}/mtm/routemat/${id}/`);
},
},
},
routepack: { routepack: {
list: { list: {
name: "列表", name: "列表",

View File

@ -317,7 +317,7 @@ export default {
return await http.put(`${config.API_URL}/wpm/mlogbw/${id}/`,data); return await http.put(`${config.API_URL}/wpm/mlogbw/${id}/`,data);
}, },
}, },
del: { delete: {
name: "删除", name: "删除",
req: async function (id) { req: async function (id) {
return await http.delete(`${config.API_URL}/wpm/mlogbw/${id}/`); return await http.delete(`${config.API_URL}/wpm/mlogbw/${id}/`);

View File

@ -192,10 +192,10 @@ export default {
}, },
form: {}, form: {},
rules: { rules: {
material: [ number: [
{ {
required: true, required: true,
message: "请选择所需产品", message: "请填写编号",
trigger: "blur", trigger: "blur",
}, },
], ],

View File

@ -12,7 +12,7 @@
:rules="rules" :rules="rules"
label-width="120px" label-width="120px"
> >
<el-form-item label="物料"> <el-form-item label="物料" prop="material">
<el-select <el-select
v-model="selectMaterial" v-model="selectMaterial"
value-key="id" value-key="id"
@ -40,7 +40,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="批次号"> <el-form-item label="批次号" prop="batch">
<!-- <el-input v-model="form.batch" placeholder="手动输入批次号" :disabled="inputBatchDisable" /> --> <!-- <el-input v-model="form.batch" placeholder="手动输入批次号" :disabled="inputBatchDisable" /> -->
<el-select <el-select
v-model="form.batch" v-model="form.batch"
@ -95,7 +95,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="仓库"> <el-form-item label="仓库" prop="warehouse">
<el-select <el-select
v-model="form.warehouse" v-model="form.warehouse"
clearable clearable
@ -206,6 +206,13 @@ export default {
}, },
form: {}, form: {},
rules: { rules: {
batch:[
{
required: true,
message: "请填写批次号",
trigger: "blur",
},
],
material: [ material: [
{ {
required: true, required: true,
@ -213,6 +220,13 @@ export default {
trigger: "blur", trigger: "blur",
}, },
], ],
warehouse: [
{
required: true,
message: "请选择仓库",
trigger: "blur",
},
],
}, },
visible: false, visible: false,
isSaveing: false, isSaveing: false,
@ -387,11 +401,13 @@ export default {
selectBatchChange(item) { selectBatchChange(item) {
// var item = this.getItem(this.batchOptions, id) // var item = this.getItem(this.batchOptions, id)
this.form.batch = item.batch; this.form.batch = item.batch;
this.form.mb = item.id;
this.form.warehouse = item.warehouse; this.form.warehouse = item.warehouse;
this.warehouseDisable = true; this.warehouseDisable = true;
this.inputBatchDisable = true; this.inputBatchDisable = true;
}, },
selectBatchClear() { selectBatchClear() {
this.form.mb = "";
this.form.batch = ""; this.form.batch = "";
this.form.warehouse = ""; this.form.warehouse = "";
this.warehouseDisable = false; this.warehouseDisable = false;

View File

@ -162,12 +162,60 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="project_code=='bxerp'&&mode=='edit'">
<sc-form-table
hideDelete
ref="routematTable"
:tableHeight="300"
v-model="routemats"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<el-table-column prop="number" label="辅料编号">
<template #default="scope">
<el-select
v-model="scope.row.material"
placeholder="辅料编号"
clearable
style="width: 100%"
>
<el-option
v-for="item in materialOptions"
:key="item.id"
:label="item.full_name"
:value="item.id"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="open" label="操作" width="125" align="center">
<template #default="scope">
<el-button
text
v-if="scope.row.id==''"
type="primary"
size="small"
@click="formTableSave(scope.row)"
>保存</el-button
>
<el-button
text
v-else
type="danger"
size="small"
@click="formTableDel(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</sc-form-table>
</el-row>
</el-form> </el-form>
</el-main> </el-main>
<el-footer> <el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit" <el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button>
>提交</el-button
>
<el-button @click="visible = false">取消</el-button> <el-button @click="visible = false">取消</el-button>
</el-footer> </el-footer>
</el-container> </el-container>
@ -182,9 +230,9 @@ const defaultForm = {
material_in:'', material_in:'',
material_out:'', material_out:'',
hour_work:0, hour_work:0,
div_number:1,
batch_bind: true, batch_bind: true,
is_autotask: true, is_autotask: true,
// is_count_utask: false,
}; };
export default { export default {
props: { props: {
@ -209,9 +257,18 @@ export default {
materialsOut: [], materialsOut: [],
mgroups: [], mgroups: [],
options: [], options: [],
routemats:[],
materialOptions:[],
titleMap: { add: "新增", edit: "编辑" }, titleMap: { add: "新增", edit: "编辑" },
setFiltersVisible: false, setFiltersVisible: false,
routeId: "",
project_code: "", project_code: "",
addTemplate:{
id:'',
material:'',
route:'',
}
}; };
}, },
mounted() { mounted() {
@ -219,6 +276,7 @@ export default {
this.getProcess(); this.getProcess();
this.getMaterialIn(); this.getMaterialIn();
this.getMaterialOut(); this.getMaterialOut();
this.getMaterialOptions();
this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code; this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
this.form.routepack = this.routepack; this.form.routepack = this.routepack;
}, },
@ -228,24 +286,30 @@ export default {
}, },
getMgroup() { getMgroup() {
let that = this; let that = this;
this.$API.mtm.mgroup.list.req({ page: 0 }).then((res) => { that.$API.mtm.mgroup.list.req({ page: 0 }).then((res) => {
this.mgroups = res; that.mgroups = res;
});
},
getMaterialOptions() {
let that = this;
that.$API.mtm.material.list.req({ page: 0, type__in: "20,30"}).then((res) => {
that.materialOptions = res;
}); });
}, },
getMaterialIn() { getMaterialIn() {
let that = this; let that = this;
this.$API.mtm.material.list that.$API.mtm.material.list
.req({ page: 0, type__in: "10,20,30" }) .req({ page: 0, type__in: "10,20,30" })
.then((res) => { .then((res) => {
this.materialsIn = res; that.materialsIn = res;
}); });
}, },
getMaterialOut() { getMaterialOut() {
let that = this; let that = this;
this.$API.mtm.material.list that.$API.mtm.material.list
.req({ page: 0, type__in: "10,20" }) .req({ page: 0, type__in: "10,20" })
.then((res) => { .then((res) => {
this.materialsOut = res; that.materialsOut = res;
}); });
}, },
getProcess() { getProcess() {
@ -254,6 +318,32 @@ export default {
that.options = res; that.options = res;
}); });
}, },
getroutemats(){
let that = this;
that.$API.mtm.routemat.list.req({ route: that.routeId,page: 0}).then((res) => {
that.routemats = res;
});
},
formTableSave(row){
let that = this;
that.$API.mtm.routemat.create.req(row).then((res) => {
that.getroutemats();
});
},
formTableDel(row){
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.mtm.routemat.delete.req(row.id).then((res) => {
let index = this.routemats.findIndex((item) => item.id === row.id);
this.routemats.splice(index, 1);
this.$message.success("删除成功");
that.getroutemats();
}).catch((err) => {
return err;
});
}).catch(() => {});
},
// //
open(mode = "add") { open(mode = "add") {
this.mode = mode; this.mode = mode;
@ -263,6 +353,9 @@ export default {
// //
setData(data) { setData(data) {
Object.assign(this.form, data); Object.assign(this.form, data);
this.routeId = data.id;
this.addTemplate.route = data.id;
this.getroutemats();
}, },
// //
submit() { submit() {

View File

@ -97,7 +97,7 @@
prop="material_name" prop="material_name"
min-width="140" min-width="140"
></el-table-column> ></el-table-column>
<el-table-column label="批次" prop="batch" min-width="140"> <el-table-column label="批次" prop="batch" width="100">
<template #default="scope"> <template #default="scope">
<el-text v-if="scope.row.handoverb.length>0" type="primary">{{scope.row.handoverb.length}}</el-text> <el-text v-if="scope.row.handoverb.length>0" type="primary">{{scope.row.handoverb.length}}</el-text>
</template> </template>

View File

@ -241,6 +241,7 @@ export default {
}, },
selectBatchChange(item) { selectBatchChange(item) {
this.form.batch = item.batch; this.form.batch = item.batch;
this.form.mb = item.id;
this.form.warehouse = item.warehouse; this.form.warehouse = item.warehouse;
}, },
// //
@ -254,6 +255,7 @@ export default {
}, },
selectBatchClear() { selectBatchClear() {
this.form.batch = ""; this.form.batch = "";
this.form.mb = "";
this.form.warehouse = ""; this.form.warehouse = "";
}, },
// //

View File

@ -82,7 +82,7 @@
row-key="id" row-key="id"
stripe stripe
:params="paramsIn" :params="paramsIn"
hidePagination hidePagination
> >
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column <el-table-column
@ -113,13 +113,18 @@
link link
type="primary" type="primary"
@click="table_in_edit(scope.row)" @click="table_in_edit(scope.row)"
:disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1)" v-if="mlogItem.submit_time== null&&mlogItem.material_in_&&mlogItem.material_in_.tracking==10"
> >
编辑 编辑
</el-button> </el-button>
<el-button
link type="primary"
v-if="mlogItem.submit_time == null&&mlogItem.material_in_&&mlogItem.material_in_.tracking==20"
@click="table_out_check_single(scope.row,'ins')"
>详情</el-button>
<el-button <el-button
link link
:disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1)" :disabled="mlogItem.submit_time !== null"
type="danger" type="danger"
@click="table_in_del(scope.row)" @click="table_in_del(scope.row)"
> >
@ -228,7 +233,7 @@
<el-button <el-button
link type="primary" link type="primary"
v-if="mlogItem.submit_time == null&&mlogItem.material_out_&&mlogItem.material_out_.tracking==20" v-if="mlogItem.submit_time == null&&mlogItem.material_out_&&mlogItem.material_out_.tracking==20"
@click="table_out_check_single(scope.row)" @click="table_out_check_single(scope.row,'outs')"
>详情</el-button> >详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -263,6 +268,7 @@
ref="saveDialog" ref="saveDialog"
:mlog="mlogId" :mlog="mlogId"
:mgroup="mgroup" :mgroup="mgroup"
:tracking="tracking"
:materialIn="materialIn" :materialIn="materialIn"
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
@ -280,6 +286,7 @@
v-if="dialog.check_single" v-if="dialog.check_single"
ref="checkDialogSingle" ref="checkDialogSingle"
:mlogb="mlogb" :mlogb="mlogb"
:wm = "wm"
@success="handlesCheckSuccess" @success="handlesCheckSuccess"
@closed="dialog.check_single = false" @closed="dialog.check_single = false"
> >
@ -349,6 +356,7 @@ export default {
mlog: "", mlog: "",
material_out__isnull: 0, material_out__isnull: 0,
}, },
tracking:'10',
mlogb:"", mlogb:"",
mgroup: "", mgroup: "",
mlogItem: {}, mlogItem: {},
@ -378,6 +386,7 @@ export default {
}, },
], ],
}, },
wm:'',
materialOut:'', materialOut:'',
batchContains:'', batchContains:'',
apiObjPrint:this.$API.cm.labelmat.fromWm, apiObjPrint:this.$API.cm.labelmat.fromWm,
@ -402,6 +411,8 @@ export default {
let that = this; let that = this;
that.$API.wpm.mlog.item.req(that.mlogId).then((res) => { that.$API.wpm.mlog.item.req(that.mlogId).then((res) => {
that.mlogItem = res; that.mlogItem = res;
console.log('that.mlogItem',that.mlogItem);
this.tracking = this.mlogItem.material_in_.tracking;
if(res.test_file!==null){ if(res.test_file!==null){
that.fileList = [{name:res.test_file,url:res.test_file}]; that.fileList = [{name:res.test_file,url:res.test_file}];
that.form.test_file = res.test_file; that.form.test_file = res.test_file;
@ -495,14 +506,15 @@ export default {
this.$refs.checkDialog.open(obj); this.$refs.checkDialog.open(obj);
}); });
}, },
table_out_check_single(row){ table_out_check_single(row,type){
this.dialog.check_single = true; this.dialog.check_single = true;
this.mlogb = row.id; this.mlogb = row.id;
this.wm = row.wm_in;
let obj = {}; let obj = {};
Object.assign(obj, row); Object.assign(obj, row);
obj.mgroup_name = this.mlogItem.mgroup_name; obj.mgroup_name = this.mlogItem.mgroup_name;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.checkDialogSingle.open(obj); this.$refs.checkDialogSingle.open(type);
}); });
}, },
// //

View File

@ -40,7 +40,7 @@
<el-input-number ref="codeInput" v-model="form.count_use" clearable></el-input-number> <el-input-number ref="codeInput" v-model="form.count_use" clearable></el-input-number>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-footer v-if="mgroup_code == 'paiyicibang'||mgroup_code == 'paiercibang'"> <el-footer v-if="tracking == 10">
<el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button> <el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button>
<el-button @click="visibleDrawer = false">取消</el-button> <el-button @click="visibleDrawer = false">取消</el-button>
</el-footer> </el-footer>
@ -68,6 +68,10 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
tracking:{
type: Number,
default: 10,
},
materialIn: { materialIn: {
type: String, type: String,
default: "", default: "",
@ -142,7 +146,8 @@ export default {
}); });
if (arr.length > 0) { if (arr.length > 0) {
that.form.wm_in = arr[0].id; that.form.wm_in = arr[0].id;
if(that.mgroup_code == 'paiyicibang'||that.mgroup_code == 'paiercibang'){}else{ that.form.count_use = arr[0].count;
if(that.tracking==10){}else{
that.submit();// that.submit();//
} }
}else{ }else{

View File

@ -1,6 +1,6 @@
<template> <template>
<el-drawer <el-drawer
title="输出物料详情" :title="headTitle[mode]"
v-model="visible" v-model="visible"
:size="'80%'" :size="'80%'"
destroy-on-close destroy-on-close
@ -16,7 +16,23 @@
<el-table-column prop="number" label="物料编号"> <el-table-column prop="number" label="物料编号">
<template #default="scope"> <template #default="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.number }}</span> <span v-if="!scope.row.isEdit">{{ scope.row.number }}</span>
<el-input v-else v-model="scope.row.number" placeholder="物料编号"></el-input> <el-input v-if="scope.row.isEdit&&mode == 'outs'" v-model="scope.row.number" placeholder="物料编号"></el-input>
<el-select
v-if="scope.row.isEdit&&mode == 'ins'"
v-model="scope.row.wpr"
placeholder="动态成品"
clearable
style="width: 100%"
@change="optionChange(scope.row)"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.number"
:value="item.id"
>
</el-option>
</el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="note" label="备注"> <el-table-column prop="note" label="备注">
@ -65,16 +81,26 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
wm: {
type: String,
default: "",
},
}, },
emits: ["success", "closed"], emits: ["success", "closed"],
data() { data() {
return { return {
loading: false, loading: false,
headTitle:{
ins:'输入物料详情',
outs:'输出物料详情',
},
mode:'ins',
// //
form: {}, form: {},
mgroup: "", mgroup: "",
params: {mlogb:'',page:0}, params: {mlogb:'',page:0},
visible: false, visible: false,
options:[],
mlogbwlist:[], mlogbwlist:[],
addTemplate:{ addTemplate:{
mlogb: "", mlogb: "",
@ -90,11 +116,30 @@ export default {
let that = this; let that = this;
that.params.mlogb = that.addTemplate.mlogb = that.mlogb; that.params.mlogb = that.addTemplate.mlogb = that.mlogb;
that.getList(); that.getList();
that.getOptions();
}, },
methods: { methods: {
open() { open(mode = "ins") {
this.mode = mode;
console.log(this.mode);
this.visible = true; this.visible = true;
}, },
getOptions(){
let that = this;
that.$API.wpm.wpr.req({wm:that.wm,page:0}).then((res) => {
that.options = res;
})
},
optionChange(row){
let that = this;
that.options.forEach((item) => {
if(item.id == row.wpr){
console.log('item',item);
let index = that.mlogbwlist.indexOf(row);
that.mlogbwlist[index].number = item.number;
}
})
},
getList(){ getList(){
let that = this; let that = this;
that.mlogbwlist = []; that.mlogbwlist = [];