Merge branch 'v2' of https://e.coding.net/ctcdevteam/ehs/ehs_web into v2
This commit is contained in:
commit
27ed58bf5c
|
@ -19,7 +19,7 @@
|
|||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" :params="query" row-key="id" stripe>
|
||||
<scTable ref="table" :apiObj="apiObj" :params="params" :query="query" row-key="id" stripe>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="记录编号" prop="number"></el-table-column>
|
||||
<el-table-column label="出/入库类型">
|
||||
|
@ -34,7 +34,8 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="出/入库日期" prop="inout_date">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="执行车间" prop="belong_dept_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" prop="create_by_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="create_time">
|
||||
|
@ -90,8 +91,11 @@ export default {
|
|||
save: false,
|
||||
},
|
||||
query: {
|
||||
|
||||
},
|
||||
params: {
|
||||
type__in: 'sale_out,do_in',
|
||||
// item_mio__material__type: 10
|
||||
materials__type: 10
|
||||
},
|
||||
form: {
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" :params="query" stripe>
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" :params="params" :query="query" stripe>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="记录编号" prop="number"></el-table-column>
|
||||
<el-table-column label="出/入库类型">
|
||||
|
@ -34,7 +34,8 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="出/入库日期" prop="inout_date">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="执行车间" prop="belong_dept_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" prop="create_by_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="create_time">
|
||||
|
@ -90,8 +91,11 @@ export default {
|
|||
save: false,
|
||||
},
|
||||
query: {
|
||||
|
||||
},
|
||||
params: {
|
||||
type__in: 'do_in,do_out',
|
||||
// item_mio__material__type: 20
|
||||
materials__type: 20
|
||||
},
|
||||
form: {
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
apiObj: this.$API.inm.warehouse.batch,
|
||||
params: { count__gte: 1, material__type__in: '40' },
|
||||
params: { count__gte: 1, material__type__in: '40, 50, 60, 70' },
|
||||
selection: [],
|
||||
query: {},
|
||||
warehouseOptions: []
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" :params="query" stripe>
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" :params="params" :query="query" stripe>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="记录编号" prop="number"></el-table-column>
|
||||
<el-table-column label="出/入库类型">
|
||||
|
@ -33,7 +33,8 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="出/入库日期" prop="inout_date">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="执行车间" prop="belong_dept_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" prop="create_by_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="create_time">
|
||||
|
@ -85,8 +86,11 @@ export default {
|
|||
save: false,
|
||||
},
|
||||
query: {
|
||||
|
||||
},
|
||||
params: {
|
||||
type__in: 'pur_in',
|
||||
// item_mio__material__type: 40
|
||||
materials__type__in: '40, 50, 60, 70'
|
||||
},
|
||||
form: {
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" :params="query" stripe>
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" :params="params" :query="query" stripe>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="记录编号" prop="number"></el-table-column>
|
||||
<el-table-column label="出/入库类型">
|
||||
|
@ -34,7 +34,8 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="出/入库日期" prop="inout_date">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="执行车间" prop="belong_dept_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" prop="create_by_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="create_time">
|
||||
|
@ -90,8 +91,11 @@ export default {
|
|||
save: false,
|
||||
},
|
||||
query: {
|
||||
|
||||
},
|
||||
params: {
|
||||
type__in: 'pur_in,do_out',
|
||||
// item_mio__material__type: 30
|
||||
materials__type: 30
|
||||
},
|
||||
form: {
|
||||
|
||||
|
|
|
@ -1,121 +1,61 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:title="titleMap[form.type]"
|
||||
v-model="visible"
|
||||
:size="1000"
|
||||
destroy-on-close
|
||||
@closed="$emit('closed')"
|
||||
>
|
||||
<el-dialog :title="titleMap[form.type]" v-model="visible" :size="1000" destroy-on-close @closed="$emit('closed')">
|
||||
<el-form ref="dialogForm" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="物料">
|
||||
<el-select
|
||||
v-model="selectMaterial"
|
||||
value-key="id"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
@change="selectMaterialChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
:key="item.id"
|
||||
:label="item.full_name"
|
||||
:value="item"
|
||||
>
|
||||
<el-select v-model="selectMaterial" value-key="id" clearable filterable style="width: 100%"
|
||||
@change="selectMaterialChange">
|
||||
<el-option v-for="item in materialOptions" :key="item.id" :label="item.full_name" :value="item">
|
||||
<span style="float: left">{{ item.full_name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号">
|
||||
<!-- <el-input v-model="form.batch" placeholder="手动输入批次号" :disabled="inputBatchDisable" /> -->
|
||||
<el-select
|
||||
v-model="form.batch"
|
||||
value-key="id"
|
||||
filterable
|
||||
allow-create
|
||||
clearable
|
||||
style="width: 100%"
|
||||
:disabled="inputBatchDisable"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in wbatchOptions"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"
|
||||
>
|
||||
<el-select v-model="form.batch" filterable allow-create clearable style="width: 100%"
|
||||
:disabled="inputBatchDisable">
|
||||
<el-option v-for="item in wbatchOptions" :key="item.id" :value="item.batch">
|
||||
<span style="float: left">{{ 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-select
|
||||
v-model="selectBatch"
|
||||
value-key="id"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="selectBatchChange"
|
||||
@clear="selectBatchClear"
|
||||
:disabled="selectBatchDisable"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in batchOptions"
|
||||
:key="item.id"
|
||||
:label="item.batch"
|
||||
:value="item"
|
||||
>
|
||||
<el-select v-model="selectBatch" value-key="id" clearable style="width: 100%" @change="selectBatchChange"
|
||||
@clear="selectBatchClear" :disabled="selectBatchDisable">
|
||||
<el-option v-for="item in batchOptions" :key="item.id" :label="item.batch" :value="item">
|
||||
<span style="float: left">{{ item.batch }}</span>
|
||||
<span
|
||||
style="
|
||||
<span style="
|
||||
float: right;
|
||||
color: var(--el-text-color-secondary);
|
||||
font-size: 13px;
|
||||
"
|
||||
>{{ item.count }} -- {{ item.warehouse_name }}</span
|
||||
>
|
||||
">{{ item.count }} -- {{ item.warehouse_name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库">
|
||||
<el-select
|
||||
v-model="form.warehouse"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
:disabled="warehouseDisable"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
<el-select v-model="form.warehouse" clearable style="width: 100%" :disabled="warehouseDisable">
|
||||
<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="数量">
|
||||
<el-input-number v-model="form.count" :min="1" style="width: 100%" />
|
||||
</el-form-item>
|
||||
<div v-if="assembShow">
|
||||
<el-row
|
||||
v-for="item in components"
|
||||
v-bind:key="item"
|
||||
style="margin-bottom: 8px"
|
||||
>
|
||||
<el-row v-for="item in components" v-bind:key="item" style="margin-bottom: 8px">
|
||||
<el-col :span="12"> {{ item.number }} - {{ item.name }} </el-col>
|
||||
<el-col :span="12">
|
||||
<el-select v-model="item.batch" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="itemx in item.batchOptions"
|
||||
:key="itemx.id"
|
||||
:label="itemx.batch"
|
||||
:value="itemx.batch"
|
||||
>
|
||||
<el-option v-for="itemx in item.batchOptions" :key="itemx.id" :label="itemx.batch" :value="itemx.batch">
|
||||
<span style="float: left">{{ itemx.batch }}</span>
|
||||
<span
|
||||
style="
|
||||
<span style="
|
||||
float: right;
|
||||
color: var(--el-text-color-secondary);
|
||||
font-size: 13px;
|
||||
"
|
||||
>{{ itemx.count }}</span
|
||||
>
|
||||
">{{ itemx.count }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
@ -132,246 +72,242 @@
|
|||
</template>
|
||||
<script>
|
||||
const defaultForm = {
|
||||
"state": 10,
|
||||
"type": "do_in"
|
||||
"state": 10,
|
||||
"type": "do_in"
|
||||
}
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
props: {
|
||||
cate: { type: String, default: '' },
|
||||
mioId: { type: String, default: '' },
|
||||
belongDeptName:{type: String, default: ''},
|
||||
belongDeptId: { type: String, default: null },
|
||||
mioObj: { type: Object }
|
||||
emits: ["success", "closed"],
|
||||
props: {
|
||||
cate: { type: String, default: '' },
|
||||
mioId: { type: String, default: '' },
|
||||
belongDeptName: { type: String, default: '' },
|
||||
belongDeptId: { type: String, default: null },
|
||||
mioObj: { type: Object }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: 'do_in',
|
||||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
'do_out': '生产领料',
|
||||
'sale_out': '销售发货',
|
||||
'pur_in': '采购入库',
|
||||
'do_in': '生产入库',
|
||||
'other_in': '其他入库',
|
||||
'other_out': '其他出库',
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
material: [{ required: true, message: "请选择所需产品", trigger: "blur" }],
|
||||
},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
materialOptions: [],
|
||||
batchOptions: [],
|
||||
setFiltersVisible: false,
|
||||
warehouseOptions: [],
|
||||
warehouseDisable: false,
|
||||
selectBatchDisable: false,
|
||||
assembShow: false,
|
||||
selectMaterial: null,
|
||||
selectBatch: null,
|
||||
components: [],
|
||||
wbatchOptions: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// this.getBatchs();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.getMaterialOptions()
|
||||
this.getWarehouseOptions()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: 'do_in',
|
||||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
'do_out': '生产领料',
|
||||
'sale_out': '销售发货',
|
||||
'pur_in': '采购入库',
|
||||
'do_in': '生产入库',
|
||||
'other_in': '其他入库',
|
||||
'other_out': '其他出库',
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
material: [{ required: true, message: "请选择所需产品", trigger: "blur" }],
|
||||
},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
materialOptions: [],
|
||||
batchOptions: [],
|
||||
setFiltersVisible: false,
|
||||
warehouseOptions: [],
|
||||
warehouseDisable: false,
|
||||
selectBatchDisable: false,
|
||||
assembShow: false,
|
||||
selectMaterial: null,
|
||||
selectBatch: null,
|
||||
components: [],
|
||||
wbatchOptions:[],
|
||||
};
|
||||
getWarehouseOptions() {
|
||||
this.$API.inm.warehouse.list.req({ page: 0 }).then(res => {
|
||||
this.warehouseOptions = res
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
this.getBatchs();
|
||||
//获取车间物料批次号
|
||||
getWBatchs() { //
|
||||
if (this.belongDeptId != null && this.belongDeptId != undefined && this.belongDeptId != '') {
|
||||
this.$API.wpm.wmaterial.list.req({
|
||||
"belong_dept": this.belongDeptId,
|
||||
"material": this.form.material,
|
||||
"page": 0
|
||||
}).then(res => {
|
||||
this.wbatchOptions = res
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.getMaterialOptions()
|
||||
this.getWarehouseOptions()
|
||||
},
|
||||
getWarehouseOptions() {
|
||||
this.$API.inm.warehouse.list.req({ page: 0 }).then(res => {
|
||||
this.warehouseOptions = res
|
||||
})
|
||||
},
|
||||
//获取车间物料批次号
|
||||
getBatchs(){
|
||||
let wbatchs = []
|
||||
if(this.belongDeptName !=null && this.belongDeptName != undefined && this.belongDeptName != ''){
|
||||
this.$API.wpm.wmaterial.list.req({
|
||||
"belong_dept__name": this.belongDeptName,
|
||||
"count__gte": 1,
|
||||
"page": 0
|
||||
}).then(res=>{
|
||||
res.forEach(item => {
|
||||
if (!wbatchs.includes(item.batch)) {
|
||||
wbatchs.push(item.batch);
|
||||
}
|
||||
});
|
||||
this.wbatchOptions = wbatchs
|
||||
})
|
||||
}
|
||||
},
|
||||
getMaterialOptions() {
|
||||
var type = this.form.type;
|
||||
var cate = this.cate;
|
||||
var query = {};
|
||||
// 'do_out': '生产领料',
|
||||
// 'sale_out': '销售发货',
|
||||
// 'pur_in': '采购入库',
|
||||
// 'do_in': '生产入库',
|
||||
// 'other_in': '其他入库',
|
||||
// 'other_out': '其他出库',
|
||||
//(10, '成品'), (20, '半成品'), (30, '主要原料'),
|
||||
// (40, '辅助材料'), (50, '加工工具'), (60, '辅助工装'), (70, '办公用品')
|
||||
let type__in='';
|
||||
if(cate=='good'){
|
||||
type__in = '10'
|
||||
}else if(cate=='halfgood'){
|
||||
type__in = '20'
|
||||
}else if(cate=='mainso'){
|
||||
type__in = '30'
|
||||
}else if(cate=='helpso'){
|
||||
type__in = '40'
|
||||
}
|
||||
if (type == 'do_out') {//生产领料'10, 20, 30'
|
||||
query = { page: 0, type__in: type__in, is_hidden: false, is_assemb: false };
|
||||
this.inputBatchDisable = true
|
||||
}
|
||||
else if (type == 'do_in') {//生产入库
|
||||
query = { page: 0, type__in: type__in, is_hidden: false }
|
||||
this.inputBatchDisable = false;
|
||||
}
|
||||
else if (type == 'pur_in') {//采购入库
|
||||
query = { page: 0, type__in: type__in, is_hidden: false, pu_orderitem_material__pu_order: this.mioObj.pu_order }
|
||||
this.inputBatchDisable = false
|
||||
}
|
||||
else if (type == 'sale_out') {//销售发货
|
||||
query = { page: 0, type__in: 10, is_hidden: false, orderitem_material__order: this.mioObj.order }
|
||||
this.inputBatchDisable = true;
|
||||
}
|
||||
else {
|
||||
query = { page: 0 }
|
||||
}
|
||||
getMaterialOptions() {
|
||||
var type = this.form.type;
|
||||
var cate = this.cate;
|
||||
var query = {};
|
||||
// 'do_out': '生产领料',
|
||||
// 'sale_out': '销售发货',
|
||||
// 'pur_in': '采购入库',
|
||||
// 'do_in': '生产入库',
|
||||
// 'other_in': '其他入库',
|
||||
// 'other_out': '其他出库',
|
||||
//(10, '成品'), (20, '半成品'), (30, '主要原料'),
|
||||
// (40, '辅助材料'), (50, '加工工具'), (60, '辅助工装'), (70, '办公用品')
|
||||
let type__in = '';
|
||||
if (cate == 'good') {
|
||||
type__in = '10'
|
||||
} else if (cate == 'halfgood') {
|
||||
type__in = '20'
|
||||
} else if (cate == 'mainso') {
|
||||
type__in = '30'
|
||||
} else if (cate == 'helpso') {
|
||||
type__in = '40, 50, 60, 70'
|
||||
}
|
||||
if (type == 'do_out') {//生产领料'10, 20, 30'
|
||||
query = { page: 0, type__in: type__in, is_hidden: false, is_assemb: false };
|
||||
this.inputBatchDisable = true
|
||||
}
|
||||
else if (type == 'do_in') {//生产入库
|
||||
query = { page: 0, type__in: type__in, is_hidden: false }
|
||||
this.inputBatchDisable = false;
|
||||
}
|
||||
else if (type == 'pur_in') {//采购入库
|
||||
query = { page: 0, type__in: type__in, is_hidden: false, pu_orderitem_material__pu_order: this.mioObj.pu_order }
|
||||
this.inputBatchDisable = false
|
||||
}
|
||||
else if (type == 'sale_out') {//销售发货
|
||||
query = { page: 0, type__in: 10, is_hidden: false, orderitem_material__order: this.mioObj.order }
|
||||
this.inputBatchDisable = true;
|
||||
}
|
||||
else {
|
||||
query = { page: 0 }
|
||||
}
|
||||
|
||||
this.$API.mtm.material.list.req(query).then(res => {
|
||||
this.materialOptions = res
|
||||
})
|
||||
},
|
||||
async initAssemb(item) {
|
||||
this.selectBatchDisable = true
|
||||
this.assembShow = true
|
||||
this.components = []
|
||||
var id__in = Object.keys(item.components).join(',')
|
||||
if (id__in.length > 0) {
|
||||
var res = await this.$API.mtm.material.list.req({ page: 0, id__in: id__in })
|
||||
this.components = res
|
||||
for (var i = 0; i < this.components.length; i++) {
|
||||
var res2 = await this.$API.wpm.wmaterial.list.req({ page: 0, material: this.components[i].id, belong_dept: this.belongDeptId, count__gte: 1 })
|
||||
this.components[i].batchOptions = res2
|
||||
}
|
||||
}
|
||||
},
|
||||
getBatchOptions() {
|
||||
this.$API.inm.warehouse.batch.req({ page: 0, material: this.form.material, count__gte: 1 }).then(res => {
|
||||
this.batchOptions = res
|
||||
if (res.length == 0) {
|
||||
this.selectBatchDisable = true
|
||||
} else {
|
||||
this.selectBatchDisable = false
|
||||
}
|
||||
})
|
||||
},
|
||||
selectMaterialChange(item) {
|
||||
var that = this
|
||||
var type = this.form.type
|
||||
var material = item.id
|
||||
that.form.material = material
|
||||
|
||||
if (type == 'do_in') {
|
||||
if (item.is_assemb) {
|
||||
this.initAssemb(item)
|
||||
} else {
|
||||
this.selectBatchDisable = false
|
||||
this.components = []
|
||||
this.assembShow = false
|
||||
this.getBatchOptions()
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
this.getBatchOptions()
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
getItem(options, id) {
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
if (options[i].id == id) {
|
||||
return options[i]
|
||||
}
|
||||
}
|
||||
},
|
||||
selectBatchChange(item) {
|
||||
// var item = this.getItem(this.batchOptions, id)
|
||||
this.form.batch = item.batch
|
||||
this.form.warehouse = item.warehouse
|
||||
this.warehouseDisable = true
|
||||
this.inputBatchDisable = true
|
||||
},
|
||||
selectBatchClear() {
|
||||
this.form.batch = ''
|
||||
this.form.warehouse = ''
|
||||
this.warehouseDisable = false
|
||||
this.inputBatchDisable = false
|
||||
},
|
||||
//显示
|
||||
open(mode = "add", type = "") {
|
||||
this.mode = mode;
|
||||
this.form.type = type;
|
||||
if (mode == 'add') {
|
||||
this.init()
|
||||
}
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
//提交
|
||||
submit() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
this.form.mio = this.mioId;
|
||||
if (this.components.length > 0) {
|
||||
this.form.assemb = []
|
||||
for (var i = 0; i < this.components.length; i++) {
|
||||
this.form.assemb.push({ 'material': this.components[i].id, 'batch': this.components[i].batch })
|
||||
}
|
||||
}
|
||||
try {
|
||||
var res;
|
||||
if (this.mode == "add") {
|
||||
res = await this.$API.inm.mioitem.create.req(this.form);
|
||||
} else if (this.mode == "edit") {
|
||||
res = await this.$API.inm.mioitem.update.req(this.form.id, this.form);
|
||||
}
|
||||
this.isSaveing = false;
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功");
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
//可以处理校验错误
|
||||
this.isSaveing = false;
|
||||
return err;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
Object.assign(this.form, data);
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
this.selectionFilters = filters;
|
||||
this.setFiltersVisible = true;
|
||||
},
|
||||
this.$API.mtm.material.list.req(query).then(res => {
|
||||
this.materialOptions = res
|
||||
})
|
||||
},
|
||||
async initAssemb(item) {
|
||||
this.selectBatchDisable = true
|
||||
this.assembShow = true
|
||||
this.components = []
|
||||
var id__in = Object.keys(item.components).join(',')
|
||||
if (id__in.length > 0) {
|
||||
var res = await this.$API.mtm.material.list.req({ page: 0, id__in: id__in })
|
||||
this.components = res
|
||||
for (var i = 0; i < this.components.length; i++) {
|
||||
var res2 = await this.$API.wpm.wmaterial.list.req({ page: 0, material: this.components[i].id, belong_dept: this.belongDeptId })
|
||||
this.components[i].batchOptions = res2
|
||||
}
|
||||
}
|
||||
},
|
||||
getBatchOptions() {
|
||||
// 车间批次
|
||||
this.getWBatchs();
|
||||
this.$API.inm.warehouse.batch.req({ page: 0, material: this.form.material }).then(res => {
|
||||
this.batchOptions = res
|
||||
if (res.length == 0) {
|
||||
this.selectBatchDisable = true
|
||||
} else {
|
||||
this.selectBatchDisable = false
|
||||
}
|
||||
})
|
||||
},
|
||||
selectMaterialChange(item) {
|
||||
var that = this
|
||||
var type = this.form.type
|
||||
var material = item.id
|
||||
that.form.material = material
|
||||
|
||||
if (type == 'do_in') {
|
||||
if (item.is_assemb) {
|
||||
this.initAssemb(item)
|
||||
} else {
|
||||
this.selectBatchDisable = false
|
||||
this.components = []
|
||||
this.assembShow = false
|
||||
this.getBatchOptions()
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
this.getBatchOptions()
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
getItem(options, id) {
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
if (options[i].id == id) {
|
||||
return options[i]
|
||||
}
|
||||
}
|
||||
},
|
||||
selectBatchChange(item) {
|
||||
// var item = this.getItem(this.batchOptions, id)
|
||||
this.form.batch = item.batch
|
||||
this.form.warehouse = item.warehouse
|
||||
this.warehouseDisable = true
|
||||
this.inputBatchDisable = true
|
||||
},
|
||||
selectBatchClear() {
|
||||
this.form.batch = ''
|
||||
this.form.warehouse = ''
|
||||
this.warehouseDisable = false
|
||||
this.inputBatchDisable = false
|
||||
},
|
||||
//显示
|
||||
open(mode = "add", type = "") {
|
||||
this.mode = mode;
|
||||
this.form.type = type;
|
||||
if (mode == 'add') {
|
||||
this.init()
|
||||
}
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
//提交
|
||||
submit() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
this.form.mio = this.mioId;
|
||||
if (this.components.length > 0) {
|
||||
this.form.assemb = []
|
||||
for (var i = 0; i < this.components.length; i++) {
|
||||
this.form.assemb.push({ 'material': this.components[i].id, 'batch': this.components[i].batch })
|
||||
}
|
||||
}
|
||||
try {
|
||||
var res;
|
||||
if (this.mode == "add") {
|
||||
res = await this.$API.inm.mioitem.create.req(this.form);
|
||||
} else if (this.mode == "edit") {
|
||||
res = await this.$API.inm.mioitem.update.req(this.form.id, this.form);
|
||||
}
|
||||
this.isSaveing = false;
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功");
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
//可以处理校验错误
|
||||
this.isSaveing = false;
|
||||
return err;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
Object.assign(this.form, data);
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
this.selectionFilters = filters;
|
||||
this.setFiltersVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style></style>
|
||||
|
|
|
@ -25,12 +25,13 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="型号" prop="model">
|
||||
</el-table-column>
|
||||
<el-table-column label="物料类别" prop="type" width="200">
|
||||
<el-table-column label="物料特征" prop="type" width="230">
|
||||
<template #default="scope">
|
||||
<span><el-tag>{{ typeOptions[scope.row.type] }}</el-tag>
|
||||
<el-tag type="warning" v-if="scope.row.is_assemb">组</el-tag>
|
||||
<el-tag type="warning" v-if="scope.row.process_name">{{ scope.row.process_name }}</el-tag>
|
||||
<el-tag type="warning" v-if="scope.row.is_hidden">隐</el-tag></span>
|
||||
<el-tag type="warning" v-if="scope.row.is_assemb" effect="plain">组</el-tag>
|
||||
<el-tag type="warning" v-if="scope.row.process_name" effect="plain">{{ scope.row.process_name
|
||||
}}</el-tag>
|
||||
<el-tag type="warning" v-if="scope.row.is_hidden" effect="plain">隐</el-tag></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
@ -47,15 +48,17 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="安全库存" prop="count_safe" width="80">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="100">
|
||||
<el-table-column label="操作" fixed="right" align="center" width="140">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'material.update'">
|
||||
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'material.update'">
|
||||
编辑
|
||||
</el-link>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-link type="danger" @click="table_del(scope.row)" v-auth="'material.delete'">
|
||||
</el-button>
|
||||
<el-button link type="warning" @click="table_copy(scope.row)" v-auth="'material.create'">
|
||||
复制
|
||||
</el-button>
|
||||
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'material.delete'">
|
||||
删除
|
||||
</el-link>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
|
@ -94,8 +97,8 @@ export default {
|
|||
{ label: "半成品", name: 20 },
|
||||
{ label: "主要原料", name: 30 },
|
||||
{ label: "辅助材料", name: 40 },
|
||||
{ label: "加工工具", name: 50 },
|
||||
{ label: "辅助工装", name: 60 },
|
||||
// { label: "加工工具", name: 50 },
|
||||
// { label: "辅助工装", name: 60 },
|
||||
{ label: "办公用品", name: 70 },
|
||||
// { label: "电/水/气", name: 0 },
|
||||
],
|
||||
|
@ -105,8 +108,8 @@ export default {
|
|||
20: '半成品',
|
||||
30: '主要原料',
|
||||
40: '辅助材料',
|
||||
50: '加工工具',
|
||||
60: '辅助工装',
|
||||
// 50: '加工工具',
|
||||
// 60: '辅助工装',
|
||||
70: '办公用品',
|
||||
},
|
||||
showHidden: false,
|
||||
|
@ -129,6 +132,12 @@ export default {
|
|||
this.$refs.saveDialog.open("add");
|
||||
});
|
||||
},
|
||||
table_copy(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("add").setData(row);
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
table_edit(row) {
|
||||
this.dialog.save = true;
|
||||
|
|
|
@ -5,16 +5,8 @@
|
|||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'ptest.create'">新增</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-date-picker
|
||||
v-model="query.test_date"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
>查询</el-button>
|
||||
<el-date-picker v-model="query.test_date" type="date" value-format="YYYY-MM-DD" />
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
|
@ -36,51 +28,44 @@
|
|||
</el-tabs>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
stripe
|
||||
:params="query"
|
||||
>
|
||||
<el-table-column type="index" width="50"/>
|
||||
<scTable ref="table" :data="tableData" :apiObj="apiObj" row-key="id" stripe :params="query">
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="实验日期" prop="test_date" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="样品编号" prop="sample_number">
|
||||
</el-table-column>
|
||||
<el-table-column label="样品厚度/mm" prop="val_hd" v-if="activeName=='透过率'">
|
||||
<el-table-column label="样品厚度/mm" prop="val_hd" v-if="activeName == '透过率'">
|
||||
</el-table-column>
|
||||
<el-table-column label="型号规格" prop="specification" v-if="activeName=='中温粘度'||activeName=='膨胀'">
|
||||
<el-table-column label="型号规格" prop="specification" v-if="activeName == '中温粘度' || activeName == '膨胀'">
|
||||
</el-table-column>
|
||||
<el-table-column label="样品数量" prop="sample_count" v-if="activeName=='析晶'">
|
||||
<el-table-column label="样品数量" prop="sample_count" v-if="activeName == '析晶'">
|
||||
</el-table-column>
|
||||
<el-table-column label="样品密度" prop="sample_density" v-if="activeName=='高温粘度'">
|
||||
<el-table-column label="样品密度" prop="sample_density" v-if="activeName == '高温粘度'">
|
||||
</el-table-column>
|
||||
<el-table-column label="检验员" prop="test_user" show-overflow-tooltip>
|
||||
<el-table-column label="检验员" prop="test_user_name" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="实验温度及保温时间" prop="sample_number" v-if="activeName=='析晶'">
|
||||
<el-table-column label="实验温度及保温时间" prop="sample_number" v-if="activeName == '析晶'">
|
||||
</el-table-column>
|
||||
<el-table-column label="升至最高温度/℃" prop="val_zgwd" v-if="activeName=='高温粘度'">
|
||||
<el-table-column label="升至最高温度/℃" prop="val_zgwd" v-if="activeName == '高温粘度'">
|
||||
</el-table-column>
|
||||
<el-table-column label="仪器状态" prop="factory" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tag>{{ state_[scope.row.equip_state] }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="折射率(589nm)" prop="val_zsl" v-if="activeName=='折射率'">
|
||||
<el-table-column label="折射率(589nm)" prop="val_zsl" v-if="activeName == '折射率'">
|
||||
</el-table-column>
|
||||
<el-table-column label="透过率(550nm)" prop="val_tgl" v-if="activeName=='透过率'">
|
||||
<el-table-column label="透过率(550nm)" prop="val_tgl" v-if="activeName == '透过率'">
|
||||
</el-table-column>
|
||||
<el-table-column label="Ts/℃" prop="val_ts" v-if="activeName=='中温粘度'">
|
||||
<el-table-column label="Ts/℃" prop="val_ts" v-if="activeName == '中温粘度'">
|
||||
</el-table-column>
|
||||
<el-table-column label="30-300℃膨胀系数" prop="val_pzxs" v-if="activeName=='膨胀'">
|
||||
<el-table-column label="30-300℃膨胀系数" prop="val_pzxs" v-if="activeName == '膨胀'">
|
||||
</el-table-column>
|
||||
<el-table-column label="Tg/℃" prop="val_tg" v-if="activeName=='膨胀'">
|
||||
<el-table-column label="Tg/℃" prop="val_tg" v-if="activeName == '膨胀'">
|
||||
</el-table-column>
|
||||
<el-table-column label="Tf/℃" prop="val_tf" v-if="activeName=='膨胀'">
|
||||
<el-table-column label="Tf/℃" prop="val_tf" v-if="activeName == '膨胀'">
|
||||
</el-table-column>
|
||||
<el-table-column label="析晶" prop="val_xj" v-if="activeName=='析晶'">
|
||||
<el-table-column label="析晶" prop="val_xj" v-if="activeName == '析晶'">
|
||||
<template #default="scope">
|
||||
<el-tag>{{ state_xj[scope.row.val_xj] }}</el-tag>
|
||||
</template>
|
||||
|
@ -95,10 +80,10 @@
|
|||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
||||
|
||||
</el-main>
|
||||
<save-dialog v-if="visible" ref="saveDialog" :activeName="activeName" :activeId="activeId"
|
||||
@success="handleSuccess" @closed="visible = false">
|
||||
<save-dialog v-if="visible" ref="saveDialog" :activeName="activeName" :activeId="activeId" @success="handleSuccess"
|
||||
@closed="visible = false">
|
||||
</save-dialog>
|
||||
<!-- <el-dialog
|
||||
title="上传"
|
||||
|
@ -135,92 +120,92 @@
|
|||
</template>
|
||||
<script>
|
||||
import saveDialog from './behavior_form.vue';
|
||||
export default {
|
||||
name: "rparty",
|
||||
components:{ saveDialog },
|
||||
data() {
|
||||
return {
|
||||
apiObj: null,
|
||||
query: {
|
||||
testitem:'',
|
||||
test_date:''
|
||||
},
|
||||
state_:{
|
||||
'R':'正常',
|
||||
'T':'异常'
|
||||
},
|
||||
state_xj:{
|
||||
'S':'析晶',
|
||||
'K':'不析晶',
|
||||
'θ':'未化'
|
||||
},
|
||||
form:{
|
||||
file:'',
|
||||
fileName:'',
|
||||
},
|
||||
rules: {
|
||||
file:[{required:true, message:'请上传上传文件', trigger: "blur"}]
|
||||
},
|
||||
activeId:'3442815297965547520',
|
||||
activeName:'折射率',
|
||||
visible:false,
|
||||
isSaveing:false,
|
||||
selection: [],
|
||||
behaviors:[],
|
||||
tableData:[],
|
||||
};
|
||||
export default {
|
||||
name: "rparty",
|
||||
components: { saveDialog },
|
||||
data() {
|
||||
return {
|
||||
apiObj: null,
|
||||
query: {
|
||||
testitem: '',
|
||||
test_date: ''
|
||||
},
|
||||
state_: {
|
||||
'R': '正常',
|
||||
'T': '异常'
|
||||
},
|
||||
state_xj: {
|
||||
'S': '析晶',
|
||||
'K': '不析晶',
|
||||
'θ': '未化'
|
||||
},
|
||||
form: {
|
||||
file: '',
|
||||
fileName: '',
|
||||
},
|
||||
rules: {
|
||||
file: [{ required: true, message: '请上传上传文件', trigger: "blur" }]
|
||||
},
|
||||
activeId: '3442815297965547520',
|
||||
activeName: '折射率',
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
selection: [],
|
||||
behaviors: [],
|
||||
tableData: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getTextItem();
|
||||
},
|
||||
methods: {
|
||||
//获取检验项目
|
||||
getTextItem() {
|
||||
let that = this;
|
||||
that.$API.qm.getTestItem.get({ tag: 'performance', page: 0 }).then(res => {
|
||||
that.behaviors = res;
|
||||
that.query.testitem = res[0].id;
|
||||
that.apiObj = that.$API.qm.ptest.list;
|
||||
})
|
||||
},
|
||||
mounted(){
|
||||
this.getTextItem();
|
||||
handleClick(val) {
|
||||
this.activeId = val.props.name;
|
||||
this.activeName = val.props.label;
|
||||
this.query.testitem = val.props.name;
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
methods: {
|
||||
//获取检验项目
|
||||
getTextItem(){
|
||||
let that = this;
|
||||
that.$API.qm.getTestItem.get({tag:'performance',page:0}).then(res=>{
|
||||
that.behaviors = res;
|
||||
that.query.testitem = res[0].id;
|
||||
that.apiObj = that.$API.qm.ptest.list;
|
||||
})
|
||||
},
|
||||
handleClick(val){
|
||||
this.activeId = val.props.name;
|
||||
this.activeName = val.props.label;
|
||||
this.query.testitem = val.props.name;
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
add(){
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("add");
|
||||
});
|
||||
},
|
||||
importInspect(){
|
||||
this.visible = true;
|
||||
},
|
||||
submitFile(){
|
||||
add() {
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("add");
|
||||
});
|
||||
},
|
||||
importInspect() {
|
||||
this.visible = true;
|
||||
},
|
||||
submitFile() {
|
||||
|
||||
},
|
||||
closeVisible(){
|
||||
this.visible = false;
|
||||
},
|
||||
handleSuccess(){
|
||||
this.visible = false;
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
//查看
|
||||
table_show(row) {
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("show").setData(row);
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query)
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
},
|
||||
};
|
||||
closeVisible() {
|
||||
this.visible = false;
|
||||
},
|
||||
handleSuccess() {
|
||||
this.visible = false;
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
//查看
|
||||
table_show(row) {
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("show").setData(row);
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query)
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
|
@ -458,20 +458,7 @@ export default {
|
|||
});
|
||||
},
|
||||
table_edit(row) {
|
||||
let arr = [];
|
||||
let mlogb = row.mlogb;
|
||||
this.brothersListorigin.forEach(item => {
|
||||
let obj = {};
|
||||
obj.count_ok = null;
|
||||
obj.material_out = item;
|
||||
for (let i = 0; i < mlogb.length; i++) {
|
||||
if (mlogb[i].material_out == item) {
|
||||
obj.count_ok = mlogb[i].count_ok;
|
||||
}
|
||||
}
|
||||
arr.push(obj)
|
||||
})
|
||||
this.brothersList = arr;
|
||||
this.brothersList = row.mlogb;
|
||||
this.dialogSave = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("edit").setData(row);
|
||||
|
|
|
@ -218,7 +218,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="formTitle">检测统计:</div>
|
||||
<!-- <div class="formTitle">检测统计:</div>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="检测数">
|
||||
|
@ -246,7 +246,7 @@
|
|||
<el-input v-model="form.note" tyle="width:100%" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
</el-form>
|
||||
<!-- 七车间 -->
|
||||
<el-form v-if="activeType == '7车间'" ref="dialogForm" :model="form" :rules="rules" label-width="120px">
|
||||
|
@ -661,16 +661,7 @@ export default {
|
|||
this.getShiftOptions();
|
||||
this.getRouteOptions();
|
||||
this.getWorkShopMaterial();
|
||||
if (this.activeType == "10车间") {
|
||||
let mlogb = [];
|
||||
this.brothersList.forEach((item) => {
|
||||
let obj = {};
|
||||
obj.material_out = item.material_out;
|
||||
obj.count_ok = item.count_ok;
|
||||
mlogb.push(obj);
|
||||
});
|
||||
this.mlogb = mlogb;
|
||||
}
|
||||
this.mlogb = this.brothersList;
|
||||
if (this.activeType == "10车间") {
|
||||
this.getMaterial(0);
|
||||
} else {
|
||||
|
@ -906,6 +897,7 @@ export default {
|
|||
});
|
||||
this.form.mlogb = newArr;
|
||||
}
|
||||
console.log(this.form.mlogb)
|
||||
let sun = this.form.count_ok + this.form.count_notok;
|
||||
if ((this.activeType == "7车间" || this.activeType == "10车间") && sun != this.form.count_real) {
|
||||
this.isSaveing = false;
|
||||
|
|
Loading…
Reference in New Issue