|
@@ -1,20 +1,16 @@
|
|
|
<template>
|
|
|
<el-row class="addForm">
|
|
|
- <el-col :span="24" style="text-align: right; padding: 10px 0 0 0">
|
|
|
- <el-button type="primary" :size="'mini'" @click="addForm"
|
|
|
+ <el-col
|
|
|
+ :span="24"
|
|
|
+ v-if="
|
|
|
+ (status === '1' && powers.some((item) => item == '028')) ||
|
|
|
+ (status === '2' && powers.some((item) => item == '028'))
|
|
|
+ "
|
|
|
+ style="text-align: right; padding: 10px 0 0 0"
|
|
|
+ >
|
|
|
+ <el-button type="primary" :size="'mini'" @click="openModal('add', '028')"
|
|
|
>新建
|
|
|
</el-button>
|
|
|
-
|
|
|
- <!-- <el-button
|
|
|
- type="primary"
|
|
|
- :size="'mini'"
|
|
|
- @click="submitForm"
|
|
|
- v-if="
|
|
|
- (status == '3' && powers.some((item) => item == '022')) ||
|
|
|
- (status == '4' && powers.some((item) => item == '023'))
|
|
|
- "
|
|
|
- >保 存
|
|
|
- </el-button> -->
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form
|
|
@@ -35,119 +31,92 @@
|
|
|
:prop="item.prop"
|
|
|
show-overflow-tooltip
|
|
|
:label="item.label"
|
|
|
- v-if="
|
|
|
- item.type === 'text' && item.show && item.prop !== 'error_code'
|
|
|
- "
|
|
|
:width="item.width"
|
|
|
:min-width="item.minWidth"
|
|
|
:key="item.prop + index"
|
|
|
/>
|
|
|
- <el-table-column
|
|
|
- :prop="item.prop"
|
|
|
- :label="item.label"
|
|
|
- v-else-if="
|
|
|
- item.type === 'text' && item.show && item.prop === 'error_code'
|
|
|
- "
|
|
|
- :width="item.width"
|
|
|
- :min-width="item.minWidth"
|
|
|
- :key="item.prop + index"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <span class="spscope">{{ scope.row.error_code_name }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- :prop="item.prop"
|
|
|
- :label="item.label"
|
|
|
- v-else-if="item.type !== 'text' && item.show"
|
|
|
- :width="item.width"
|
|
|
- :min-width="item.minWidth"
|
|
|
- :key="item.prop + index"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-form-item
|
|
|
- :prop="'product_go.' + scope.$index + '.' + item.prop"
|
|
|
- :rules="scope.row.edit ? tableFormThis[item.prop] : {}"
|
|
|
- :size="'mini'"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-if="scope.row.edit === true && item.type === 'input'"
|
|
|
- :size="'mini'"
|
|
|
- maxlength="250"
|
|
|
- clearable
|
|
|
- v-model="scope.row[item.prop]"
|
|
|
- />
|
|
|
- <el-select
|
|
|
- v-model="scope.row[item.prop]"
|
|
|
- v-if="scope.row.edit === true && item.type === 'select'"
|
|
|
- style="width: 100%"
|
|
|
- clearable
|
|
|
- placeholder="异常原因"
|
|
|
- @change="elSelectChange($event, scope.$index)"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.result_code"
|
|
|
- :label="item.result"
|
|
|
- :value="item.result_code"
|
|
|
- :disabled="item.status === '0'"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- <span v-if="!scope.row.edit" class="spscope">{{
|
|
|
- item.type === "select"
|
|
|
- ? scope.row.error_code_name
|
|
|
- : scope.row[item.prop]
|
|
|
- }}</span>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
</template>
|
|
|
- <!-- v-if="
|
|
|
- (status == '3' && powers.some((item) => item == '022')) ||
|
|
|
- (status == '4' && powers.some((item) => item == '023'))
|
|
|
- " -->
|
|
|
+
|
|
|
<el-table-column fixed="right" label="操作" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
<el-tooltip
|
|
|
+ v-if="powers.some((item) => item == '007')"
|
|
|
effect="dark"
|
|
|
- content="编辑"
|
|
|
- v-if="!scope.row.edit"
|
|
|
+ content="详情"
|
|
|
placement="top"
|
|
|
>
|
|
|
<i
|
|
|
- class="el-icon-edit tb-icon"
|
|
|
- @click="editRow(scope.$index)"
|
|
|
+ class="el-icon-view tb-icon"
|
|
|
+ @click="openModal(scope.row.wsm_in_code, '007')"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
-
|
|
|
<el-tooltip
|
|
|
+ v-if="
|
|
|
+ scope.row.status === '1' &&
|
|
|
+ powers.some((item) => item == '029')
|
|
|
+ "
|
|
|
effect="dark"
|
|
|
- content="保存"
|
|
|
- v-if="scope.row.edit"
|
|
|
+ content="入库验收记录"
|
|
|
placement="top"
|
|
|
>
|
|
|
<i
|
|
|
- class="el-icon-circle-check tb-icon"
|
|
|
- @click="checkRow(scope.$index)"
|
|
|
+ class="el-icon-view tb-icon"
|
|
|
+ @click="openModal(scope.row.wsm_in_code, '029')"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
|
|
|
- <el-tooltip effect="dark" content="重置" placement="top">
|
|
|
+ <el-tooltip
|
|
|
+ v-if="
|
|
|
+ scope.row.status === '2' &&
|
|
|
+ powers.some((item) => item == '030')
|
|
|
+ "
|
|
|
+ effect="dark"
|
|
|
+ content="入库验收建议"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ class="el-icon-view tb-icon"
|
|
|
+ @click="openModal(scope.row.wsm_in_code, '030')"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip
|
|
|
+ v-if="
|
|
|
+ scope.row.status === '3' &&
|
|
|
+ powers.some((item) => item == '031')
|
|
|
+ "
|
|
|
+ effect="dark"
|
|
|
+ content="入库验收建议审核"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ class="el-icon-view tb-icon"
|
|
|
+ @click="openModal(scope.row.wsm_in_code, '031')"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip
|
|
|
+ v-if="
|
|
|
+ scope.row.status === '5' &&
|
|
|
+ powers.some((item) => item == '033')
|
|
|
+ "
|
|
|
+ effect="dark"
|
|
|
+ content="退货物流填写"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
<i
|
|
|
- class="el-icon-refresh-left tb-icon"
|
|
|
- @click="resetRow(scope.$index)"
|
|
|
+ class="el-icon-view tb-icon"
|
|
|
+ @click="openModal(scope.row.wsm_in_code, '032')"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</el-form>
|
|
|
- <add-edit-table-model
|
|
|
+ <wsm-in-order-model
|
|
|
:id="modelId"
|
|
|
:show-model="showModel"
|
|
|
- :sitem="detailSitem"
|
|
|
- @refresh="searchList"
|
|
|
+ :btn_code="btn_code"
|
|
|
+ :modelSitem="modelSitem"
|
|
|
+ @refresh="(showModel = false), $emit('refresh')"
|
|
|
@cancel="showModel = false"
|
|
|
/>
|
|
|
</el-col>
|
|
@@ -156,19 +125,18 @@
|
|
|
<script>
|
|
|
import asyncRequest from "@/apis/service/stock/allot/detail";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
-import { isnumber } from "@/utils/validate";
|
|
|
import config from "./columns-table"; //表格列参数
|
|
|
-import addEditTableModel from "./addEditTableModel.vue";
|
|
|
+import wsmInOrderModel from "./wsm-in-order-model.vue";
|
|
|
export default {
|
|
|
name: "allot",
|
|
|
props: ["id", "sitem", "newTime"],
|
|
|
mixins: [resToken],
|
|
|
- components: { addEditTableModel },
|
|
|
+ components: { wsmInOrderModel },
|
|
|
computed: {
|
|
|
powers() {
|
|
|
let tran =
|
|
|
this.$store.getters.btnList.find(
|
|
|
- (item) => item.menu_route == "allotDetail"
|
|
|
+ (item) => item.menu_route == "purchaseOrderDetail"
|
|
|
) || {};
|
|
|
if (tran && tran.action && tran.action.length > 0) {
|
|
|
return tran.action;
|
|
@@ -185,6 +153,8 @@ export default {
|
|
|
options: [],
|
|
|
status: "",
|
|
|
loading: false,
|
|
|
+ modelSitem: null,
|
|
|
+ wsm_in_code: "",
|
|
|
tableForm: {
|
|
|
product_go: [], //出库商品
|
|
|
},
|
|
@@ -205,102 +175,47 @@ export default {
|
|
|
methods: {
|
|
|
async initForm() {
|
|
|
this.loading = true;
|
|
|
- // this.columns = [];
|
|
|
- await this.getresultlist();
|
|
|
+ this.modelSitem = null;
|
|
|
await this.resetForm();
|
|
|
this.loading = false;
|
|
|
},
|
|
|
- async getresultlist() {
|
|
|
- const res = await asyncRequest.resultlist({
|
|
|
- page: 1,
|
|
|
- size: 100,
|
|
|
- status: "",
|
|
|
- });
|
|
|
- if (res && res.code === 0 && res.data) {
|
|
|
- const { list } = res.data;
|
|
|
- this.options = list;
|
|
|
- } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- await this.logout();
|
|
|
- } else {
|
|
|
- this.$message.warning(res.message);
|
|
|
- }
|
|
|
- },
|
|
|
async resetForm() {
|
|
|
// 重置
|
|
|
await this.$nextTick(() => {
|
|
|
if (this.$refs.tableForm) {
|
|
|
this.$refs.tableForm.resetFields();
|
|
|
this.$refs.tableForm.clearValidate();
|
|
|
- const { status } = this.sitem;
|
|
|
+ const { status, child } = this.sitem;
|
|
|
this.status = status;
|
|
|
- // let columnsList = JSON.parse(JSON.stringify(config.columns));
|
|
|
- // columnsList.forEach((v1) => {
|
|
|
- // if (this.status == "5" || this.status == "4") {
|
|
|
- // v1.show = true;
|
|
|
- // }
|
|
|
- // if (this.status == "4" && v1.prop === "stock_num") {
|
|
|
- // v1.type = "input";
|
|
|
- // v1.width = "150px";
|
|
|
- // }
|
|
|
- // if (this.status == "3") {
|
|
|
- // if (v1.prop === "error_remark" || v1.prop === "error_num") {
|
|
|
- // v1.show = true;
|
|
|
- // v1.width = "150px";
|
|
|
- // v1.type = "input";
|
|
|
- // }
|
|
|
- // if (v1.prop === "error_code") {
|
|
|
- // v1.show = true;
|
|
|
- // v1.width = "150px";
|
|
|
- // v1.type = "select";
|
|
|
- // }
|
|
|
- // }
|
|
|
- // this.columns.push(v1);
|
|
|
- // });
|
|
|
- console.log(this.sitem.child);
|
|
|
- this.tableForm.product_go = [];
|
|
|
- // let list = JSON.parse(JSON.stringify(item));
|
|
|
- // // item || []; //出库商品
|
|
|
- // list.forEach((v) => {
|
|
|
- // v.usable_stock = v.usable_num;
|
|
|
- // v.type_code = v.good_type_code;
|
|
|
- // v.error_num = v.error_num || "0";
|
|
|
- // v.error_code = v.error_code || "";
|
|
|
- // v.error_code_name = v.error_code_name || "";
|
|
|
- // v.error_remark = v.error_remark || "";
|
|
|
- // v.stock_num = v.stock_num || "0";
|
|
|
- // v.edit = false;
|
|
|
- // this.tableForm.product_go.push(v);
|
|
|
- // });
|
|
|
+ this.tableForm.product_go = child || [];
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- addForm() {
|
|
|
- // let item = {
|
|
|
- // post_company: "",
|
|
|
- // post_code: "",
|
|
|
- // post_fee: "",
|
|
|
- // sendtime: "",
|
|
|
- // send_num: "",
|
|
|
- // status: "",
|
|
|
- // };
|
|
|
- // this.tableForm.product_go.push(item);
|
|
|
- this.detailSitem = this.sitem;
|
|
|
- this.modelId = this.id;
|
|
|
+ openModal(code, btn_code) {
|
|
|
+ this.btn_code = btn_code;
|
|
|
+ this.modelId = code;
|
|
|
+ const {
|
|
|
+ wsm_contactor,
|
|
|
+ wsm_mobile,
|
|
|
+ wsm_addr,
|
|
|
+ addr_code,
|
|
|
+ wsend_num,
|
|
|
+ cgdNo,
|
|
|
+ wsm_code,
|
|
|
+ } = this.sitem;
|
|
|
+ this.modelSitem = {
|
|
|
+ wsm_contactor,
|
|
|
+ wsm_mobile,
|
|
|
+ wsm_addr,
|
|
|
+ addr_code,
|
|
|
+ cgdNo,
|
|
|
+ wsm_code,
|
|
|
+ wsend_num,
|
|
|
+ };
|
|
|
this.showModel = true;
|
|
|
},
|
|
|
-
|
|
|
async submitForm() {
|
|
|
- let index = -1,
|
|
|
- good = [];
|
|
|
- this.tableForm.product_go.forEach((v, i) => {
|
|
|
- if (v.edit && index === -1) {
|
|
|
- index = i;
|
|
|
- }
|
|
|
- });
|
|
|
- if (index !== -1) {
|
|
|
- this.$message.warning("当前已有商品正在编辑!");
|
|
|
- return;
|
|
|
- }
|
|
|
+ let good = [];
|
|
|
this.loading = true;
|
|
|
good = this.getGoodList();
|
|
|
const model = {
|
|
@@ -351,74 +266,6 @@ export default {
|
|
|
});
|
|
|
return resList;
|
|
|
},
|
|
|
- // 重置行操作
|
|
|
- resetRow(index) {
|
|
|
- if (this.status === "3") {
|
|
|
- this.tableForm.product_go[index].error_num = "0";
|
|
|
- this.tableForm.product_go[index].error_code = "";
|
|
|
- this.tableForm.product_go[index].error_code_name = "";
|
|
|
- this.tableForm.product_go[index].error_remark = "";
|
|
|
- } else {
|
|
|
- this.tableForm.product_go[index].stock_num = "0";
|
|
|
- }
|
|
|
- },
|
|
|
- //异常原因筛选
|
|
|
- elSelectChange(e, index) {
|
|
|
- let oindex = this.options.findIndex((v) => v.result_code === e);
|
|
|
- this.tableForm.product_go[index].error_code_name =
|
|
|
- oindex !== -1 ? this.options[oindex].result : "";
|
|
|
- },
|
|
|
- //保存某一行
|
|
|
- checkRow(rowIndex) {
|
|
|
- const { allot_num, error_num, error_code, error_remark, stock_num } =
|
|
|
- this.tableForm.product_go[rowIndex];
|
|
|
- if (this.status === "3") {
|
|
|
- if (!isnumber(error_num + "") || error_num === "") {
|
|
|
- this.$message.warning("异常数量必须为整数!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (parseInt(error_num + "") > parseInt(allot_num + "")) {
|
|
|
- this.$message.warning("异常数量不大于调拨总数量!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (parseInt(error_num + "") > 0 && error_code === "") {
|
|
|
- this.$message.warning("请选择异常原因!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (parseInt(error_num + "") > 0 && error_remark === "") {
|
|
|
- this.$message.warning("请输入异常备注!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (parseInt(error_num + "") === 0 && error_code !== "") {
|
|
|
- this.$message.warning("异常数量为零,不用选择异常原因!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (parseInt(error_num + "") === 0 && error_remark !== "") {
|
|
|
- this.$message.warning("异常数量为零,不用填写异常备注!");
|
|
|
- return;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (!isnumber(stock_num + "" || stock_num === "")) {
|
|
|
- this.$message.warning("入库数量必须为整数!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (parseInt(stock_num + "") > parseInt(allot_num + "")) {
|
|
|
- this.$message.warning("入库数量不大于调拨总数量!");
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- this.tableForm.product_go[rowIndex].edit = false;
|
|
|
- },
|
|
|
- //编辑某一行
|
|
|
- editRow(rowIndex) {
|
|
|
- let index = this.tableForm.product_go.findIndex((v) => v.edit);
|
|
|
- if (index !== -1) {
|
|
|
- this.$message.warning("请完成其他行的编辑!");
|
|
|
- return;
|
|
|
- } else {
|
|
|
- this.tableForm.product_go[rowIndex].edit = true;
|
|
|
- }
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|