|
@@ -9,40 +9,60 @@
|
|
|
width="80%"
|
|
width="80%"
|
|
|
>
|
|
>
|
|
|
<div v-for="(item, idx) in workList" :key="idx">
|
|
<div v-for="(item, idx) in workList" :key="idx">
|
|
|
- <div class="table_box">
|
|
|
|
|
- <div class="row">
|
|
|
|
|
- <div class="col">
|
|
|
|
|
- <div class="name">生产工单号</div>
|
|
|
|
|
- <div class="content">{{ item.code }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="col">
|
|
|
|
|
- <div class="name">产品编码</div>
|
|
|
|
|
- <div class="content">{{ item.productCode }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="col">
|
|
|
|
|
- <div class="name">产品名称</div>
|
|
|
|
|
- <div class="content">{{ item.productName }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="col">
|
|
|
|
|
- <div class="name">批号</div>
|
|
|
|
|
- <div class="content">{{ item.batchNo }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="col pd6">
|
|
|
|
|
- <el-button
|
|
|
|
|
- type="primary"
|
|
|
|
|
- size="mini"
|
|
|
|
|
- @click="openPicking(item.id, item)"
|
|
|
|
|
- >新增</el-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-form
|
|
|
|
|
+ :ref="`formRef${idx}`"
|
|
|
|
|
+ :model="{ pickList: item }"
|
|
|
|
|
+ :rules="tableRules"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ label-position="left"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-row :gutter="24">
|
|
|
|
|
+ <el-col :span="6">
|
|
|
|
|
+ <el-form-item label="领料单编号" prop="pickCode" label-width="90px">
|
|
|
|
|
+ <el-input v-model="item.pickCode" disabled=""></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+
|
|
|
|
|
+ <el-col :span="6">
|
|
|
|
|
+ <el-form-item label="领料单" prop="pickName" label-width="90px">
|
|
|
|
|
+ <el-input v-model="item.pickName"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="table_box">
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <div class="name">生产工单号</div>
|
|
|
|
|
+ <div class="content">{{ item.code }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <div class="name">产品编码</div>
|
|
|
|
|
+ <div class="content">{{ item.productCode }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <div class="name">产品名称</div>
|
|
|
|
|
+ <div class="content">{{ item.productName }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <div class="name">批号</div>
|
|
|
|
|
+ <div class="content">{{ item.batchNo }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col pd6">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="openPicking(item.id, item)"
|
|
|
|
|
+ >新增</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
|
|
|
- <div>
|
|
|
|
|
- <el-form :ref="`tableRef${item.code}`" :model="{ pickList : item}" :rules="tableRules">
|
|
|
|
|
|
|
+ <div>
|
|
|
<el-table
|
|
<el-table
|
|
|
- ref="table"
|
|
|
|
|
- :ref="`tableRef${item.code}`"
|
|
|
|
|
|
|
+ :ref="`tableRef${idx}`"
|
|
|
|
|
+ class="table_content"
|
|
|
:max-height="300"
|
|
:max-height="300"
|
|
|
:data="item.pickList"
|
|
:data="item.pickList"
|
|
|
tooltip-effect="dark"
|
|
tooltip-effect="dark"
|
|
@@ -66,9 +86,7 @@
|
|
|
|
|
|
|
|
<el-table-column label="数量" prop="demandQuantity">
|
|
<el-table-column label="数量" prop="demandQuantity">
|
|
|
<template slot-scope="{ row, $index }">
|
|
<template slot-scope="{ row, $index }">
|
|
|
- <el-form-item :prop="`pickList[${$index}].demandQuantity`" :rules="{
|
|
|
|
|
- required: true, message: '请选择押金支付方式', trigger: 'blur'
|
|
|
|
|
- }">
|
|
|
|
|
|
|
+ <el-form-item>
|
|
|
<el-input v-model="row.demandQuantity" size="mini">
|
|
<el-input v-model="row.demandQuantity" size="mini">
|
|
|
<template slot="append">{{ row.unit }}</template>
|
|
<template slot="append">{{ row.unit }}</template>
|
|
|
</el-input>
|
|
</el-input>
|
|
@@ -76,7 +94,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
|
|
- <!-- <el-table-column label="领料仓库" prop="warehouseId">
|
|
|
|
|
|
|
+ <el-table-column label="领料仓库" prop="warehouseId">
|
|
|
<template slot-scope="{ row, $index }">
|
|
<template slot-scope="{ row, $index }">
|
|
|
<div v-if="row.warehouseList">
|
|
<div v-if="row.warehouseList">
|
|
|
<el-select></el-select>
|
|
<el-select></el-select>
|
|
@@ -86,10 +104,18 @@
|
|
|
{{ row.pathName }}
|
|
{{ row.pathName }}
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
- </el-table-column> -->
|
|
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column label="操作" fixed="right" width="100px">
|
|
|
|
|
+ <template slot-scope="{ $index, row }">
|
|
|
|
|
+ <el-link type="danger" @click="removeItem(idx, $index)"
|
|
|
|
|
+ >删除</el-link
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
- </el-form>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-form>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<template slot="footer">
|
|
<template slot="footer">
|
|
@@ -107,7 +133,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import pickingList from './pickingList.vue';
|
|
import pickingList from './pickingList.vue';
|
|
|
- import { workorderList } from '@/api/produce/workOrder';
|
|
|
|
|
|
|
+ import { workorderList, getCode } from '@/api/produce/workOrder';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
@@ -145,10 +171,22 @@
|
|
|
};
|
|
};
|
|
|
workorderList(param).then((res) => {
|
|
workorderList(param).then((res) => {
|
|
|
this.workList = res;
|
|
this.workList = res;
|
|
|
-
|
|
|
|
|
|
|
+ this.getOrderCode();
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ getOrderCode() {
|
|
|
|
|
+ this.workList.forEach(async (e) => {
|
|
|
|
|
+ const data = await getCode('pick_order_code');
|
|
|
|
|
+ this.$set(e, 'pickCode', data);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ removeItem(idx, index) {
|
|
|
|
|
+ this.workList[idx].pickList.splice(index, 1);
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
handleClose() {
|
|
handleClose() {
|
|
|
this.$emit('close', false);
|
|
this.$emit('close', false);
|
|
|
},
|
|
},
|
|
@@ -167,16 +205,45 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
save() {
|
|
save() {
|
|
|
- let promises = this.workList.map((item) => {
|
|
|
|
|
-
|
|
|
|
|
- return this.$refs[`tableRef${item.code}`][0].validate();
|
|
|
|
|
- });
|
|
|
|
|
- Promise.all(promises).then((results) => {
|
|
|
|
|
- if (results.every((valid) => valid)) {
|
|
|
|
|
- alert('submit1');
|
|
|
|
|
- // 执行提交操作
|
|
|
|
|
|
|
+ if (this.workList.length > 0) {
|
|
|
|
|
+ let bol;
|
|
|
|
|
+ let _i;
|
|
|
|
|
+ bol = this.workList.every((e, i) => {
|
|
|
|
|
+ _i = i;
|
|
|
|
|
+ return (
|
|
|
|
|
+ Object.prototype.hasOwnProperty.call(e, 'pickList') &&
|
|
|
|
|
+ e.pickList.length > 0
|
|
|
|
|
+ );
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (!bol) {
|
|
|
|
|
+ this.$message.warning(
|
|
|
|
|
+ `生成工单${this.workList[_i].code}领料不能为空`
|
|
|
|
|
+ );
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (this.workList.length > 0) {
|
|
|
|
|
+ let name;
|
|
|
|
|
+ let bol2;
|
|
|
|
|
+ let _i;
|
|
|
|
|
+
|
|
|
|
|
+ this.workList.forEach((e, i) => {
|
|
|
|
|
+ _i = i;
|
|
|
|
|
+ bol2 = e.pickList.every((y) => {
|
|
|
|
|
+ name = y.name;
|
|
|
|
|
+ return Number(y.demandQuantity) > 0;
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (!bol2) {
|
|
|
|
|
+ this.$message.warning(
|
|
|
|
|
+ `${this.workList[_i].code}的${name}数量不能为空`
|
|
|
|
|
+ );
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -188,7 +255,7 @@
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.table_box {
|
|
.table_box {
|
|
|
- border: 1px solid #acd4b5;
|
|
|
|
|
|
|
+ border: 1px solid #69c0ff;
|
|
|
margin: 6px 0;
|
|
margin: 6px 0;
|
|
|
|
|
|
|
|
&:last-child {
|
|
&:last-child {
|
|
@@ -206,8 +273,8 @@
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
min-width: 200px;
|
|
min-width: 200px;
|
|
|
min-height: 32px;
|
|
min-height: 32px;
|
|
|
- border-bottom: 1px solid #acd4b5;
|
|
|
|
|
- border-right: 1px solid #acd4b5;
|
|
|
|
|
|
|
+ border-bottom: 1px solid #69c0ff;
|
|
|
|
|
+ border-right: 1px solid #69c0ff;
|
|
|
|
|
|
|
|
&:last-child {
|
|
&:last-child {
|
|
|
border-right: none;
|
|
border-right: none;
|
|
@@ -219,8 +286,8 @@
|
|
|
padding: 4px;
|
|
padding: 4px;
|
|
|
width: 80px;
|
|
width: 80px;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
- background-color: #fafafa;
|
|
|
|
|
- color: #909399;
|
|
|
|
|
|
|
+ background-color: #bae7ff;
|
|
|
|
|
+ color: #000;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.content {
|
|
.content {
|
|
@@ -233,6 +300,10 @@
|
|
|
padding: 0 6px;
|
|
padding: 0 6px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .table_content {
|
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|
|
|
|
|
|
|
|
<style>
|
|
<style>
|