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: {
list: {
name: "列表",

View File

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

View File

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

View File

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

View File

@ -162,12 +162,60 @@
</el-form-item>
</el-col>
</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-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit"
>提交</el-button
>
<el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-container>
@ -182,9 +230,9 @@ const defaultForm = {
material_in:'',
material_out:'',
hour_work:0,
div_number:1,
batch_bind: true,
is_autotask: true,
// is_count_utask: false,
};
export default {
props: {
@ -209,9 +257,18 @@ export default {
materialsOut: [],
mgroups: [],
options: [],
routemats:[],
materialOptions:[],
titleMap: { add: "新增", edit: "编辑" },
setFiltersVisible: false,
routeId: "",
project_code: "",
addTemplate:{
id:'',
material:'',
route:'',
}
};
},
mounted() {
@ -219,6 +276,7 @@ export default {
this.getProcess();
this.getMaterialIn();
this.getMaterialOut();
this.getMaterialOptions();
this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
this.form.routepack = this.routepack;
},
@ -228,24 +286,30 @@ export default {
},
getMgroup() {
let that = this;
this.$API.mtm.mgroup.list.req({ page: 0 }).then((res) => {
this.mgroups = res;
that.$API.mtm.mgroup.list.req({ page: 0 }).then((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() {
let that = this;
this.$API.mtm.material.list
that.$API.mtm.material.list
.req({ page: 0, type__in: "10,20,30" })
.then((res) => {
this.materialsIn = res;
that.materialsIn = res;
});
},
getMaterialOut() {
let that = this;
this.$API.mtm.material.list
that.$API.mtm.material.list
.req({ page: 0, type__in: "10,20" })
.then((res) => {
this.materialsOut = res;
that.materialsOut = res;
});
},
getProcess() {
@ -254,6 +318,32 @@ export default {
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") {
this.mode = mode;
@ -263,6 +353,9 @@ export default {
//
setData(data) {
Object.assign(this.form, data);
this.routeId = data.id;
this.addTemplate.route = data.id;
this.getroutemats();
},
//
submit() {

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
<template>
<el-drawer
title="输出物料详情"
:title="headTitle[mode]"
v-model="visible"
:size="'80%'"
destroy-on-close
@ -16,7 +16,23 @@
<el-table-column prop="number" label="物料编号">
<template #default="scope">
<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>
</el-table-column>
<el-table-column prop="note" label="备注">
@ -65,16 +81,26 @@ export default {
type: String,
default: "",
},
wm: {
type: String,
default: "",
},
},
emits: ["success", "closed"],
data() {
return {
loading: false,
headTitle:{
ins:'输入物料详情',
outs:'输出物料详情',
},
mode:'ins',
//
form: {},
mgroup: "",
params: {mlogb:'',page:0},
visible: false,
options:[],
mlogbwlist:[],
addTemplate:{
mlogb: "",
@ -90,11 +116,30 @@ export default {
let that = this;
that.params.mlogb = that.addTemplate.mlogb = that.mlogb;
that.getList();
that.getOptions();
},
methods: {
open() {
open(mode = "ins") {
this.mode = mode;
console.log(this.mode);
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(){
let that = this;
that.mlogbwlist = [];