fix:出入库记录添加退还入库
This commit is contained in:
parent
8216495736
commit
df5410dc42
|
@ -135,8 +135,9 @@
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="table_add"
|
@click="table_add"
|
||||||
></el-button>
|
></el-button>
|
||||||
<scScanner @scanResult="codeTextChange"></scScanner>
|
<scScanner v-if="cate=='do_in'|| cate=='do_out'" @scanResult="codeTextChange"></scScanner>
|
||||||
<el-input
|
<el-input
|
||||||
|
v-if="cate=='do_in'|| cate=='do_out'"
|
||||||
ref="codeInput"
|
ref="codeInput"
|
||||||
v-model="codeText"
|
v-model="codeText"
|
||||||
clearable
|
clearable
|
||||||
|
@ -260,7 +261,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="不合格数量" prop="count_notok">
|
<el-table-column label="备注" prop="note">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="创建时间"
|
label="创建时间"
|
||||||
|
@ -268,7 +269,7 @@
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column width="90">
|
<el-table-column width="90" v-if="cate=='do_in'|| cate=='do_out'">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button @click="printMaterial(scope.row)" type="text">物料标签</el-button>
|
<el-button @click="printMaterial(scope.row)" type="text">物料标签</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
@ -337,7 +338,12 @@ export default {
|
||||||
mio_user: "",
|
mio_user: "",
|
||||||
},
|
},
|
||||||
stateDict: {10: "创建中",20: "已提交",},
|
stateDict: {10: "创建中",20: "已提交",},
|
||||||
typeDict:{'do_in':'生产入库','do_out':'生产领料'},
|
typeDict:{
|
||||||
|
'do_in':'生产入库',
|
||||||
|
'do_out':'生产领料',
|
||||||
|
'borrow_out': "领用出库",
|
||||||
|
'return_in': "退还入库"
|
||||||
|
},
|
||||||
apiworkerObj: null,
|
apiworkerObj: null,
|
||||||
materials: [],
|
materials: [],
|
||||||
apiObj: null,
|
apiObj: null,
|
||||||
|
@ -362,6 +368,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.active = 0;
|
||||||
this.isSaveing = false;
|
this.isSaveing = false;
|
||||||
this.form.mgroup = this.mgroupId;
|
this.form.mgroup = this.mgroupId;
|
||||||
this.form.type = this.cate;
|
this.form.type = this.cate;
|
||||||
|
@ -413,6 +420,7 @@ export default {
|
||||||
//车间人员
|
//车间人员
|
||||||
getDeptUsers() {
|
getDeptUsers() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
that.userList = [];
|
||||||
let userInfo = that.$TOOL.data.get("USER_INFO");
|
let userInfo = that.$TOOL.data.get("USER_INFO");
|
||||||
that.$API.system.user.list.req({ depts: that.deptId, page: 0 }).then((res) => {
|
that.$API.system.user.list.req({ depts: that.deptId, page: 0 }).then((res) => {
|
||||||
that.userOptions = res;
|
that.userOptions = res;
|
||||||
|
|
|
@ -12,182 +12,273 @@
|
||||||
:rules="rules"
|
:rules="rules"
|
||||||
label-width="120px"
|
label-width="120px"
|
||||||
>
|
>
|
||||||
<el-form-item label="物料" v-if="cate == 'do_out'">
|
<template v-if="cate == 'do_in'||cate == 'do_out'">
|
||||||
<el-select
|
<el-form-item label="物料" v-if="cate == 'do_out'">
|
||||||
v-model="form.material"
|
<el-select
|
||||||
value-key="id"
|
v-model="form.material"
|
||||||
clearable
|
value-key="id"
|
||||||
filterable
|
clearable
|
||||||
style="width: 100%"
|
filterable
|
||||||
@change="selectMaterialChange"
|
style="width: 100%"
|
||||||
>
|
@change="selectMaterialChange"
|
||||||
<el-option
|
|
||||||
v-for="item in materialOptions"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.full_name"
|
|
||||||
:value="item.id"
|
|
||||||
>
|
>
|
||||||
<span style="float: left">{{ item.full_name }}</span>
|
<el-option
|
||||||
<span
|
v-for="item in materialOptions"
|
||||||
style="
|
:key="item.id"
|
||||||
float: right;
|
:label="item.full_name"
|
||||||
color: '#E6A23C';
|
:value="item.id"
|
||||||
font-size: 13px;
|
|
||||||
"
|
|
||||||
v-if="item.is_hidden"
|
|
||||||
>隐</span
|
|
||||||
>
|
>
|
||||||
</el-option>
|
<span style="float: left">{{ item.full_name }}</span>
|
||||||
</el-select>
|
<span
|
||||||
</el-form-item>
|
style="
|
||||||
<el-form-item label="批次选择" v-else>
|
float: right;
|
||||||
<el-select
|
color: '#E6A23C';
|
||||||
v-model="selectBatch"
|
font-size: 13px;
|
||||||
filterable
|
"
|
||||||
value-key="id"
|
v-if="item.is_hidden"
|
||||||
style="width: 100%;"
|
>隐</span
|
||||||
multiple
|
|
||||||
@change="selectwmChange"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in wbatchOptions"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.batch"
|
|
||||||
:value="item.id"
|
|
||||||
>
|
|
||||||
<span style="display:inline-block;float: left;">{{item.material_.name}}|{{ item.batch }}</span>
|
|
||||||
<span v-if="item.defect_name!==null" style="display:inline-block;float: left;color: orangered;">{{ item.defect_name }}</span>
|
|
||||||
<span
|
|
||||||
style="
|
|
||||||
float: right;
|
|
||||||
color: var(--el-text-color-secondary);
|
|
||||||
font-size: 13px;
|
|
||||||
"
|
|
||||||
>{{ item.count }}</span
|
|
||||||
>
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="批次扫描" v-if="cate == 'do_in'">
|
|
||||||
<scScanner @scanResult="codeTextChange"></scScanner>
|
|
||||||
<el-input
|
|
||||||
ref="codeInput"
|
|
||||||
v-model="codeText"
|
|
||||||
clearable
|
|
||||||
placeholder="物料扫码"
|
|
||||||
style="width:150px;margin-left: 4px;"
|
|
||||||
@keyup.enter="codeTextChange(codeText)"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="批次" v-if="cate == 'do_out'">
|
|
||||||
<el-select
|
|
||||||
v-model="selectBatch"
|
|
||||||
value-key="id"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
multiple
|
|
||||||
@change="selectBatchChange"
|
|
||||||
@clear="selectBatchClear"
|
|
||||||
style="width: 60%;"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in batchOptions"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.batch"
|
|
||||||
:value="item.id"
|
|
||||||
>
|
|
||||||
<span style="float: left">{{ item.batch }}</span>
|
|
||||||
<span
|
|
||||||
style="
|
|
||||||
float: right;
|
|
||||||
color: var(--el-text-color-secondary);
|
|
||||||
font-size: 13px;
|
|
||||||
"
|
|
||||||
>{{ item.count }} -- {{ item.warehouse_name }}</span
|
|
||||||
>
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
<scScanner @scanResult="codeTextChange"></scScanner>
|
|
||||||
<el-input
|
|
||||||
ref="codeInput"
|
|
||||||
v-model="codeText"
|
|
||||||
clearable
|
|
||||||
placeholder="物料扫码"
|
|
||||||
style="width:150px;margin-left: 4px;"
|
|
||||||
@keyup.enter="codeTextChange(codeText)"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<template v-if="cate == 'do_out'&&mode == 'add'">
|
|
||||||
<el-row v-for="item in selectList" :key="item.mb">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="批次号">
|
|
||||||
<el-input v-model="item.batch" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label="仓库" label-width="60px">
|
|
||||||
<el-select
|
|
||||||
v-model="item.warehouse"
|
|
||||||
disabled
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
>
|
||||||
<el-option
|
</el-option>
|
||||||
v-for="item in warehouseOptions"
|
</el-select>
|
||||||
:key="item.id"
|
</el-form-item>
|
||||||
:label="item.name"
|
<el-form-item label="批次选择" v-else>
|
||||||
:value="item.id"
|
<el-select
|
||||||
></el-option>
|
v-model="selectBatch"
|
||||||
</el-select>
|
filterable
|
||||||
</el-form-item>
|
value-key="id"
|
||||||
</el-col>
|
style="width: 100%;"
|
||||||
<el-col :span="6">
|
multiple
|
||||||
<el-form-item label="数量" label-width="60px">
|
@change="selectwmChange"
|
||||||
<el-input v-model="item.count" disabled />
|
>
|
||||||
</el-form-item>
|
<el-option
|
||||||
</el-col>
|
v-for="item in wbatchOptions"
|
||||||
</el-row>
|
:key="item.id"
|
||||||
|
:label="item.batch"
|
||||||
|
:value="item.id"
|
||||||
|
>
|
||||||
|
<span style="display:inline-block;float: left;">{{item.material_.name}}|{{ item.batch }}</span>
|
||||||
|
<span v-if="item.defect_name!==null" style="display:inline-block;float: left;color: orangered;">{{ item.defect_name }}</span>
|
||||||
|
<span
|
||||||
|
style="
|
||||||
|
float: right;
|
||||||
|
color: var(--el-text-color-secondary);
|
||||||
|
font-size: 13px;
|
||||||
|
"
|
||||||
|
>{{ item.count }}</span
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="批次扫描" v-if="cate == 'do_in'">
|
||||||
|
<scScanner @scanResult="codeTextChange"></scScanner>
|
||||||
|
<el-input
|
||||||
|
ref="codeInput"
|
||||||
|
v-model="codeText"
|
||||||
|
clearable
|
||||||
|
placeholder="物料扫码"
|
||||||
|
style="width:150px;margin-left: 4px;"
|
||||||
|
@keyup.enter="codeTextChange(codeText)"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="批次" v-if="cate == 'do_out'">
|
||||||
|
<el-select
|
||||||
|
v-model="selectBatch"
|
||||||
|
value-key="id"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
multiple
|
||||||
|
@change="selectBatchChange"
|
||||||
|
@clear="selectBatchClear"
|
||||||
|
style="width: 60%;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in batchOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.batch"
|
||||||
|
:value="item.id"
|
||||||
|
>
|
||||||
|
<span style="float: left">{{ item.batch }}</span>
|
||||||
|
<span
|
||||||
|
style="
|
||||||
|
float: right;
|
||||||
|
color: var(--el-text-color-secondary);
|
||||||
|
font-size: 13px;
|
||||||
|
"
|
||||||
|
>{{ item.count }} -- {{ item.warehouse_name }}</span
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<scScanner @scanResult="codeTextChange"></scScanner>
|
||||||
|
<el-input
|
||||||
|
ref="codeInput"
|
||||||
|
v-model="codeText"
|
||||||
|
clearable
|
||||||
|
placeholder="物料扫码"
|
||||||
|
style="width:150px;margin-left: 4px;"
|
||||||
|
@keyup.enter="codeTextChange(codeText)"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<template v-if="cate == 'do_out'&&mode == 'add'">
|
||||||
|
<el-row v-for="item in selectList" :key="item.mb">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="批次号">
|
||||||
|
<el-input v-model="item.batch" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="仓库" label-width="60px">
|
||||||
|
<el-select
|
||||||
|
v-model="item.warehouse"
|
||||||
|
disabled
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in warehouseOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="数量" label-width="60px">
|
||||||
|
<el-input v-model="item.count" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
<template v-if="cate == 'do_in'&&mode == 'add'">
|
||||||
|
<el-row v-for="item in selectList" :key="item.mb">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="批次号">
|
||||||
|
<el-input v-model="item.batch" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="数量" label-width="60px">
|
||||||
|
<el-input v-model="item.count" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
<el-form-item label="仓库" prop="warehouse" v-if="(cate == 'do_in'&&mode == 'add')||mode == 'edit'" >
|
||||||
|
<el-select
|
||||||
|
v-model="form.warehouse"
|
||||||
|
clearable
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in warehouseOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="数量" v-if="mode == 'edit'">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.count"
|
||||||
|
:min="0"
|
||||||
|
:precision="0"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="cate == 'do_in'&&mode == 'add'">
|
<template v-if="cate=='borrow_out'">
|
||||||
<el-row v-for="item in selectList" :key="item.mb">
|
<el-form-item label="物料" prop="material">
|
||||||
<el-col :span="12">
|
<xtSelect
|
||||||
<el-form-item label="批次号">
|
:apiObj="apiObj"
|
||||||
<el-input v-model="item.batch" disabled />
|
v-model="form.material"
|
||||||
</el-form-item>
|
v-model:obj="selectObj"
|
||||||
</el-col>
|
:labelField="'full_name'"
|
||||||
<el-col :span="12">
|
style="width:100%"
|
||||||
<el-form-item label="数量" label-width="60px">
|
:params="query"
|
||||||
<el-input v-model="item.count" disabled />
|
@change="selectMaterialChange2"
|
||||||
</el-form-item>
|
>
|
||||||
</el-col>
|
<el-table-column label="物料" prop="full_name"></el-table-column>
|
||||||
</el-row>
|
</xtSelect>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="仓库已有批次">
|
||||||
|
<el-select
|
||||||
|
v-model="selectBatch"
|
||||||
|
value-key="id"
|
||||||
|
clearable
|
||||||
|
style="width: 100%"
|
||||||
|
@change="selectBatchChange2"
|
||||||
|
@clear="selectBatchClear"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in batchOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.batch"
|
||||||
|
:value="item"
|
||||||
|
>
|
||||||
|
<span style="float: left">{{ item.batch }}</span>
|
||||||
|
<span
|
||||||
|
style="
|
||||||
|
float: right;
|
||||||
|
color: var(--el-text-color-secondary);
|
||||||
|
font-size: 13px;
|
||||||
|
"
|
||||||
|
>{{ item.count }} -- {{ item.warehouse_name }}</span
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="数量">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.count"
|
||||||
|
:min="1"
|
||||||
|
:max="batchcount"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-if="cate=='return_in'">
|
||||||
|
<el-form-item label="批次号" >
|
||||||
|
<el-select
|
||||||
|
v-model="form.batch"
|
||||||
|
filterable
|
||||||
|
allow-create
|
||||||
|
clearable
|
||||||
|
style="width: 100%"
|
||||||
|
@clear="selectBatchClear"
|
||||||
|
@change="selectChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in wbatchOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:value="item.batch"
|
||||||
|
>
|
||||||
|
<span style="float: left">{{item.material_name}} {{ item.batch }}</span>
|
||||||
|
<span
|
||||||
|
style="
|
||||||
|
float: right;
|
||||||
|
color: var(--el-text-color-secondary);
|
||||||
|
font-size: 13px;
|
||||||
|
"
|
||||||
|
>{{ item.count }}</span
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="数量">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.count"
|
||||||
|
:min="0"
|
||||||
|
:max="batchcount"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="form.note"></el-input>
|
||||||
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<el-form-item label="仓库" prop="warehouse" v-if="(cate == 'do_in'&&mode == 'add')||mode == 'edit'" >
|
|
||||||
<el-select
|
|
||||||
v-model="form.warehouse"
|
|
||||||
clearable
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in warehouseOptions"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="数量" v-if="mode == 'edit'">
|
|
||||||
<el-input-number
|
|
||||||
v-model="form.count"
|
|
||||||
:min="0"
|
|
||||||
:precision="0"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button type="primary" :loading="isSaveing" @click="submit">
|
<el-button v-if="cate == 'do_in'||cate == 'do_out'" type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||||
保存
|
<el-button v-else type="primary" :loading="isSaveing" @click="submit2">保存</el-button>
|
||||||
</el-button>
|
|
||||||
<el-button @click="visible = false">取消</el-button>
|
<el-button @click="visible = false">取消</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -213,6 +304,8 @@ export default {
|
||||||
titleMap: {
|
titleMap: {
|
||||||
do_out: "生产领料",
|
do_out: "生产领料",
|
||||||
do_in: "生产入库",
|
do_in: "生产入库",
|
||||||
|
borrow_out: "领用出库",
|
||||||
|
return_in: "退还入库",
|
||||||
},
|
},
|
||||||
form: {},
|
form: {},
|
||||||
rules: {
|
rules: {
|
||||||
|
@ -232,6 +325,9 @@ export default {
|
||||||
selectMaterial: null,
|
selectMaterial: null,
|
||||||
selectBatch: null,
|
selectBatch: null,
|
||||||
wbatchOptions: [],//工段物料批次
|
wbatchOptions: [],//工段物料批次
|
||||||
|
selectObj: {},
|
||||||
|
query: {},
|
||||||
|
apiObj:this.$API.mtm.material.list,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -241,7 +337,7 @@ export default {
|
||||||
this.inputBatchDisable = true;
|
this.inputBatchDisable = true;
|
||||||
this.getMaterialOptions();
|
this.getMaterialOptions();
|
||||||
this.getBatchOptions();
|
this.getBatchOptions();
|
||||||
}else{//入库----工段
|
}else if(this.cate == 'do_in'||this.cate == 'return_in'){//入库----工段
|
||||||
this.getMgroupWmaterial();
|
this.getMgroupWmaterial();
|
||||||
}
|
}
|
||||||
this.getWarehouseOptions();
|
this.getWarehouseOptions();
|
||||||
|
@ -249,8 +345,17 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
//获取仓库
|
//获取仓库
|
||||||
getWarehouseOptions() {
|
getWarehouseOptions() {
|
||||||
|
let that = this;
|
||||||
this.$API.inm.warehouse.list.req({ page: 0 }).then((res) => {
|
this.$API.inm.warehouse.list.req({ page: 0 }).then((res) => {
|
||||||
this.warehouseOptions = res;
|
this.warehouseOptions = res;
|
||||||
|
if(that.cate=='return_in'||that.cate=='borrow_out'){
|
||||||
|
res.forEach(item => {
|
||||||
|
if (item.name =="辅料库") {
|
||||||
|
that.form.warehouse = item.id;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取物料列表
|
//获取物料列表
|
||||||
|
@ -275,10 +380,14 @@ export default {
|
||||||
getMgroupWmaterial() {
|
getMgroupWmaterial() {
|
||||||
let that = this;
|
let that = this;
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj.state = 10;
|
if(that.cate== 'do_in'){
|
||||||
|
obj.state = 10;
|
||||||
|
obj.material__process= that.process;
|
||||||
|
}else if(that.cate== 'return_in'){
|
||||||
|
obj.material__type = 40;
|
||||||
|
}
|
||||||
obj.page= 0;
|
obj.page= 0;
|
||||||
obj.mgroupx= that.mgroupId;
|
obj.mgroupx= that.mgroupId;
|
||||||
obj.material__process= that.process;
|
|
||||||
if (that.mgroupId != null &&that.mgroupId != undefined &&that.mgroupId != "") {
|
if (that.mgroupId != null &&that.mgroupId != undefined &&that.mgroupId != "") {
|
||||||
that.$API.wpm.wmaterial.list.req(obj).then((res) => {
|
that.$API.wpm.wmaterial.list.req(obj).then((res) => {
|
||||||
that.wbatchOptions = res;
|
that.wbatchOptions = res;
|
||||||
|
@ -358,6 +467,14 @@ export default {
|
||||||
selectMaterialChange() {
|
selectMaterialChange() {
|
||||||
this.getBatchOptions();
|
this.getBatchOptions();
|
||||||
},
|
},
|
||||||
|
selectMaterialChange2(){
|
||||||
|
var that = this;
|
||||||
|
console.log('that.selectObj',that.selectObj.id);
|
||||||
|
that.form.material = that.selectObj.id;
|
||||||
|
if(that.selectObj.id!==undefined){
|
||||||
|
this.getBatchOptions();
|
||||||
|
}
|
||||||
|
},
|
||||||
getItem(options, id) {
|
getItem(options, id) {
|
||||||
for (var i = 0; i < options.length; i++) {
|
for (var i = 0; i < options.length; i++) {
|
||||||
if (options[i].id == id) {
|
if (options[i].id == id) {
|
||||||
|
@ -367,10 +484,8 @@ export default {
|
||||||
},
|
},
|
||||||
selectBatchChange() {
|
selectBatchChange() {
|
||||||
let that = this;
|
let that = this;
|
||||||
console.log('selectBatch',that.selectBatch);
|
|
||||||
that.selectList = [];
|
that.selectList = [];
|
||||||
that.batchOptions.forEach((item) => {
|
that.batchOptions.forEach((item) => {
|
||||||
console.log('indexOfselectBatch',that.selectBatch.indexOf(item.id));
|
|
||||||
if(that.mode == "add"){//领料
|
if(that.mode == "add"){//领料
|
||||||
if(that.selectBatch.indexOf(item.id)>-1){
|
if(that.selectBatch.indexOf(item.id)>-1){
|
||||||
let obj = {};
|
let obj = {};
|
||||||
|
@ -391,6 +506,33 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//选择借用的物料批次后调用的方法
|
||||||
|
selectBatchChange2(item) {
|
||||||
|
let that = this;
|
||||||
|
if(item){
|
||||||
|
that.$API.wpm.wpr.list.req({ page: 0, mb: item.id }).then((res) => {
|
||||||
|
that.wprList = res;
|
||||||
|
})
|
||||||
|
that.form.batch = item.batch;
|
||||||
|
that.form.mb = item.id;
|
||||||
|
that.batchcount = Number(item.count);
|
||||||
|
that.form.count = Number(item.count);
|
||||||
|
that.form.warehouse = item.warehouse;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//归还时选择车间辅料后的处理
|
||||||
|
selectChange(){
|
||||||
|
let that = this;
|
||||||
|
that.wbatchOptions.forEach((item) => {
|
||||||
|
if(that.form.batch == item.batch){
|
||||||
|
that.form.wm = item.id;
|
||||||
|
that.form.batch = item.batch;
|
||||||
|
that.form.count = Number(item.count);
|
||||||
|
that.batchcount = Number(item.count);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
//选择车间库存物料后的处理
|
//选择车间库存物料后的处理
|
||||||
selectwmChange(id){
|
selectwmChange(id){
|
||||||
let that = this;
|
let that = this;
|
||||||
|
@ -416,6 +558,7 @@ export default {
|
||||||
},
|
},
|
||||||
selectBatchClear() {
|
selectBatchClear() {
|
||||||
this.form.batch = "";
|
this.form.batch = "";
|
||||||
|
this.form.count =0;
|
||||||
this.form.warehouse = "";
|
this.form.warehouse = "";
|
||||||
},
|
},
|
||||||
//显示
|
//显示
|
||||||
|
@ -464,6 +607,32 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
submit2() {
|
||||||
|
let that = this;
|
||||||
|
that.$refs.dialogForm.validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
that.isSaveing = true;
|
||||||
|
that.form.mio = that.mioId;
|
||||||
|
try {
|
||||||
|
let res;
|
||||||
|
if (that.mode == "add") {
|
||||||
|
res = await that.$API.inm.mioitem.create.req(that.form);
|
||||||
|
} else if (that.mode == "edit") {
|
||||||
|
res = await that.$API.inm.mioitem.update.req(that.form.id,that.form);
|
||||||
|
}
|
||||||
|
that.isSaveing = false;
|
||||||
|
that.$emit("success");
|
||||||
|
that.visible = false;
|
||||||
|
that.$message.success("操作成功");
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
//可以处理校验错误
|
||||||
|
that.isSaveing = false;
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
//表单注入数据
|
//表单注入数据
|
||||||
setData(data) {
|
setData(data) {
|
||||||
Object.assign(this.form, data);
|
Object.assign(this.form, data);
|
||||||
|
|
Loading…
Reference in New Issue