|
|
@@ -67,6 +67,18 @@
|
|
|
</template> -->
|
|
|
<template slot-scope="{ type, size, row, index, disabled }" slot="menu">
|
|
|
<el-button
|
|
|
+ v-if="reservoirArea == 1 && row.historyList.length"
|
|
|
+ :size="size"
|
|
|
+ :disabled="!row.id || form.statusName == '已入库' || isEdit || isEdits"
|
|
|
+ type="text"
|
|
|
+ @click="rowDelArea(row, index)"
|
|
|
+ >
|
|
|
+ 清空库区
|
|
|
+ </el-button>
|
|
|
+ <el-button v-if="reservoirArea == 1" :size="size" :disabled="!row.id" type="text" @click="rowArea(row, index)">
|
|
|
+ {{ row.historyList.length ? "查看库区" : "选择库区" }}
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
:size="size"
|
|
|
:disabled="disabled || isEdit"
|
|
|
:type="type"
|
|
|
@@ -109,6 +121,9 @@
|
|
|
<el-button v-if="reservoirArea == 1" type="success" size="small" @click="allClick('导入库区')" :disabled="disabled || isEdit"
|
|
|
>导入库区</el-button
|
|
|
>
|
|
|
+ <el-button v-if="reservoirArea == 1" type="success" size="small" @click="allClick('一键清空库区')" :disabled="disabled || isEdit"
|
|
|
+ >一键清空库区</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
<template slot-scope="{ row }" slot="reservoirAreaName">
|
|
|
<dic-select
|
|
|
@@ -167,6 +182,7 @@
|
|
|
:enumerationValue="35.1"
|
|
|
></c-upload>
|
|
|
</div>
|
|
|
+ <view-area ref="viewArea" @areaData="areaData" :disabled="disabled || form.statusName == '已入库' || isEdit || isEdits"></view-area>
|
|
|
<el-dialog title="导入明细" append-to-body :visible.sync="excelBox" v-if="excelBox" width="555px" :close-on-click-modal="false" v-dialog-drag>
|
|
|
<avue-form :option="excelOption" v-model="excelForm" table-loading="excelLoading" :upload-before="uploadBefore" :upload-after="uploadAfter">
|
|
|
<template slot="excelTemplate">
|
|
|
@@ -234,12 +250,15 @@ import {
|
|
|
dotListAll,
|
|
|
removeItem
|
|
|
} from "@/api/tirePartsMall/salesService/outboundWorkOrder";
|
|
|
+import { submitList } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
|
|
|
+import { itemRemove } from "@/api/tirePartsMall/salesManagement/outboundWorkOrder";
|
|
|
import { dateFormat } from "@/util/date";
|
|
|
import { getToken } from "@/util/auth";
|
|
|
import { getMenu } from "@/api/system/menu";
|
|
|
import reportDialog from "@/components/report-dialog/main";
|
|
|
import { corpsDescListAll } from "@/api/tirePartsMall/salesService/saleOrder";
|
|
|
import { isProcurement } from "@/api/basicData/configuration";
|
|
|
+import viewArea from "./components/viewArea.vue";
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
|
data() {
|
|
|
@@ -612,13 +631,13 @@ export default {
|
|
|
// dicUrl: '/api/blade-sales-part/brandDesc/listAll?type=PP'
|
|
|
// }, {
|
|
|
},
|
|
|
- {
|
|
|
- label: "库区",
|
|
|
- prop: "reservoirAreaName",
|
|
|
- width: 140,
|
|
|
- hide: true,
|
|
|
- overHidden: true
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // label: "库区",
|
|
|
+ // prop: "reservoirAreaName",
|
|
|
+ // width: 140,
|
|
|
+ // hide: true,
|
|
|
+ // overHidden: true
|
|
|
+ // },
|
|
|
{
|
|
|
label: "品牌",
|
|
|
prop: "brandName",
|
|
|
@@ -811,9 +830,6 @@ export default {
|
|
|
};
|
|
|
this.optionContacts = await this.getColumnData(this.getColumnName(348), this.optionContactsBack);
|
|
|
isProcurement({ param: "reservoir.area" }).then(res => {
|
|
|
- if (res.data.data == 1) {
|
|
|
- this.findObject(this.optionContacts.column, "reservoirAreaName").hide = false;
|
|
|
- }
|
|
|
this.reservoirArea = res.data.data;
|
|
|
});
|
|
|
this.findObject(this.optionContacts.column, "goodsId").change = ({ value, column }) => {
|
|
|
@@ -886,49 +902,131 @@ export default {
|
|
|
},
|
|
|
components: {
|
|
|
reportDialog,
|
|
|
- dicSelect
|
|
|
+ dicSelect,
|
|
|
+ viewArea
|
|
|
},
|
|
|
activated() {
|
|
|
this.$store.commit("DOMIO_IN_DETAIL");
|
|
|
},
|
|
|
methods: {
|
|
|
+ rowDelArea(row, index) {
|
|
|
+ if (row.historyList.filter(item => item.id).length) {
|
|
|
+ this.$confirm("是否撤销库区?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ let ids = [];
|
|
|
+ for (let item of row.historyList) {
|
|
|
+ ids.push(item.id);
|
|
|
+ }
|
|
|
+ itemRemove({ ids: ids.join(",") }).then(res => {
|
|
|
+ row.historyList = [];
|
|
|
+ row.dot = null;
|
|
|
+ row.sendNum = 0;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ row.historyList = [];
|
|
|
+ row.dot = null;
|
|
|
+ row.sendNum = 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rowArea(row, index) {
|
|
|
+ this.$refs.viewArea.openDialog(this.form, row, index);
|
|
|
+ },
|
|
|
+ areaData(row, index) {
|
|
|
+ this.form.shipItemsList[index].reservoirAreaId = row.reservoirAreaId;
|
|
|
+ this.form.shipItemsList[index].reservoirAreaName = row.reservoirAreaName;
|
|
|
+ this.form.shipItemsList[index].dot = row.dot;
|
|
|
+ this.form.shipItemsList[index].sendNum = row.sendNum;
|
|
|
+ this.form.shipItemsList[index].historyList = row.historyList;
|
|
|
+ if (row.historyList.filter(item => !item.id).length) {
|
|
|
+ submitList(this.form.shipItemsList).then(res => {
|
|
|
+ this.form.shipItemsList = res.data.data;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
allClick(name) {
|
|
|
if (name == "修改库区") {
|
|
|
+ for (let item of this.selectionMultilist) {
|
|
|
+ if (item.historyList.length > 0) {
|
|
|
+ return this.$message.error("请选择没有选择库区的数据");
|
|
|
+ }
|
|
|
+ }
|
|
|
this.fixForm = {
|
|
|
reservoirAreaId: null,
|
|
|
- reservoirAreaName: null
|
|
|
+ reservoirAreaName: null,
|
|
|
+ balanceQuantity: 0
|
|
|
};
|
|
|
this.diaVisible = true;
|
|
|
}
|
|
|
if (name == "修改") {
|
|
|
- this.$confirm("是否确认修改库区?", "提示", {
|
|
|
+ for (let item of this.selectionMultilist) {
|
|
|
+ this.form.shipItemsList.forEach(row => {
|
|
|
+ if (item.id == row.id) {
|
|
|
+ row.historyList.push({
|
|
|
+ reservoirAreaId: this.fixForm.reservoirAreaId,
|
|
|
+ reservoirAreaName: this.fixForm.reservoirAreaName,
|
|
|
+ balanceQuantity: this.fixForm.balanceQuantity,
|
|
|
+ quantity: row.goodsNum
|
|
|
+ });
|
|
|
+ row.sendNum = row.goodsNum;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ submitList(this.form.shipItemsList).then(res => {
|
|
|
+ this.form.shipItemsList = res.data.data;
|
|
|
+ });
|
|
|
+ this.diaVisible = false;
|
|
|
+ }
|
|
|
+ if (name == "导入库区") {
|
|
|
+ for (let item of this.form.shipItemsList) {
|
|
|
+ if (item.historyList.length) {
|
|
|
+ return this.$message.error("请清空库区");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.findObject(this.excelOption2.column, "excelFile").action = "/api/blade-sales-part/ship/importReservoirArea?id=" + this.form.id;
|
|
|
+ this.excelBox2 = true;
|
|
|
+ }
|
|
|
+ if (name == "一键清空库区") {
|
|
|
+ this.$confirm("是否一键清空库区?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
- for (let item of this.selectionMultilist) {
|
|
|
- this.form.shipItemsList.forEach(row => {
|
|
|
- if (item.id == row.id) {
|
|
|
- row.reservoirAreaId = this.fixForm.reservoirAreaId;
|
|
|
- row.reservoirAreaName = this.fixForm.reservoirAreaName;
|
|
|
+ for (let row of this.form.shipItemsList) {
|
|
|
+ let ids = [];
|
|
|
+ if (row.historyList.filter(item => item.id).length) {
|
|
|
+ for (let item of row.historyList) {
|
|
|
+ ids.push(item.id);
|
|
|
}
|
|
|
- });
|
|
|
+ } else {
|
|
|
+ row.historyList = [];
|
|
|
+ row.dot = null;
|
|
|
+ row.sendNum = 0;
|
|
|
+ }
|
|
|
+ if (ids.length) {
|
|
|
+ itemRemove({ ids: ids.join(",") }).then(res => {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ row.historyList = [];
|
|
|
+ row.dot = null;
|
|
|
+ row.sendNum = 0;
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- this.diaVisible = false;
|
|
|
});
|
|
|
}
|
|
|
- if (name == "导入库区") {
|
|
|
- this.findObject(this.excelOption2.column, "excelFile").action = "/api/blade-sales-part/ship/importReservoirArea?id=" + this.form.id;
|
|
|
- this.excelBox2 = true;
|
|
|
- }
|
|
|
},
|
|
|
dicChange(name, row) {
|
|
|
if (name == "reservoirAreaName") {
|
|
|
if (row) {
|
|
|
this.fixForm.reservoirAreaId = row.id;
|
|
|
+ this.fixForm.balanceQuantity = row.balanceQuantity;
|
|
|
} else {
|
|
|
this.fixForm.reservoirAreaId = null;
|
|
|
this.fixForm.reservoirAreaName = null;
|
|
|
+ this.fixForm.balanceQuantity = row.balanceQuantity;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -1322,12 +1420,6 @@ export default {
|
|
|
* 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
*/
|
|
|
const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
|
|
|
- isProcurement({ param: "reservoir.area" }).then(res => {
|
|
|
- if (res.data.data == 1) {
|
|
|
- this.findObject(this.optionContacts.column, "reservoirAreaName").hide = false;
|
|
|
- }
|
|
|
- this.reservoirArea = res.data.data;
|
|
|
- });
|
|
|
if (inSave) {
|
|
|
this.$message.success("保存成功");
|
|
|
//关闭窗口b
|
|
|
@@ -1338,12 +1430,6 @@ export default {
|
|
|
async resetColumnTwo(ref, option, optionBack, code) {
|
|
|
this[option] = this[optionBack];
|
|
|
const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
|
|
|
- isProcurement({ param: "reservoir.area" }).then(res => {
|
|
|
- if (res.data.data == 1) {
|
|
|
- this.findObject(this.optionContacts.column, "reservoirAreaName").hide = false;
|
|
|
- }
|
|
|
- this.reservoirArea = res.data.data;
|
|
|
- });
|
|
|
if (inSave) {
|
|
|
this.$message.success("重置成功");
|
|
|
this.$refs[ref].$refs.dialogColumn.columnBox = false;
|