|
|
@@ -15,11 +15,9 @@
|
|
|
@click="notice"
|
|
|
>微信发货通知
|
|
|
</el-button>
|
|
|
- <el-button class="el-button--small-yh" type="primary" size="small" v-if="editButton" @click="confirmEditing">编辑 </el-button>
|
|
|
- <el-button class="el-button--small-yh" type="primary" size="small" :disabled="isSave" @click="editCustomer">保存数据 </el-button>
|
|
|
- <el-button class="el-button--small-yh" type="warning" size="small" v-if="form.statusName == '已出库'" @click="revoke" :disabled="isSave"
|
|
|
- >撤销出库
|
|
|
- </el-button>
|
|
|
+ <el-button v-if="editButton" class="el-button--small-yh" type="primary" size="small" @click="confirmEditing">编辑 </el-button>
|
|
|
+ <el-button v-else class="el-button--small-yh" type="primary" size="small" :disabled="editDisabled" @click="editCustomer">保存数据 </el-button>
|
|
|
+ <el-button class="el-button--small-yh" type="warning" size="small" v-if="form.statusName == '已出库'" @click="revoke">撤销出库 </el-button>
|
|
|
<el-button
|
|
|
class="el-button--small-yh"
|
|
|
type="success"
|
|
|
@@ -44,7 +42,6 @@
|
|
|
v-model="formContacts"
|
|
|
ref="formContacts"
|
|
|
:data="form.shipItemsList"
|
|
|
- :key="key"
|
|
|
@row-save="rowSave"
|
|
|
@row-update="rowUpdate"
|
|
|
@resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 270.1)"
|
|
|
@@ -54,9 +51,6 @@
|
|
|
<el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印</el-button>
|
|
|
</template>
|
|
|
<template slot-scope="{ type, size, row, index, disabled }" slot="menu">
|
|
|
- <!--<el-button :size="size" :disabled="disabled || isAddDisabled" :type="type"-->
|
|
|
- <!-- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="rowEdit(row, index)">编辑-->
|
|
|
- <!--</el-button>-->
|
|
|
<el-popover placement="left" width="500" trigger="hover">
|
|
|
<el-table
|
|
|
:row-style="{ height: '20px', padding: '0px', fontSize: '12px' }"
|
|
|
@@ -93,7 +87,7 @@
|
|
|
<el-button
|
|
|
v-if="reservoirArea == 1 && row.historyList.length"
|
|
|
:size="size"
|
|
|
- :disabled="!row.id || disabled || isDisabled"
|
|
|
+ :disabled="!row.id || editDisabled"
|
|
|
type="text"
|
|
|
@click="rowDelArea(row, index)"
|
|
|
>
|
|
|
@@ -111,7 +105,7 @@
|
|
|
<el-button
|
|
|
v-if="reservoirArea == 1 && row.historyList.length == 0"
|
|
|
:size="size"
|
|
|
- :disabled="!row.id || disabled || isDisabled"
|
|
|
+ :disabled="!row.id || editDisabled"
|
|
|
type="text"
|
|
|
@click="rowArea(row, index)"
|
|
|
>
|
|
|
@@ -120,16 +114,14 @@
|
|
|
<el-button
|
|
|
v-if="reservoirArea != 1"
|
|
|
:size="size"
|
|
|
- :disabled="disabled || isDisabled"
|
|
|
+ :disabled="editDisabled"
|
|
|
:type="type"
|
|
|
:icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
|
|
|
@click="rowEdit(row, index)"
|
|
|
>
|
|
|
{{ row.$cellEdit ? "保存" : "编辑" }}
|
|
|
</el-button>
|
|
|
- <el-button icon="el-icon-delete" :size="size" :disabled="disabled || isDisabled" :type="type" @click="rowDelBox(row, index)"
|
|
|
- >删除
|
|
|
- </el-button>
|
|
|
+ <el-button icon="el-icon-delete" :size="size" :disabled="editDisabled" :type="type" @click="rowDelBox(row, index)">删除 </el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</el-tab-pane>
|
|
|
@@ -168,7 +160,7 @@
|
|
|
<c-upload
|
|
|
v-loading="loadingBtn"
|
|
|
typeUpload="LT"
|
|
|
- :disabled="isAddDisabled"
|
|
|
+ :disabled="editDisabled"
|
|
|
deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId"
|
|
|
:data="filesList"
|
|
|
display
|
|
|
@@ -206,11 +198,8 @@ export default {
|
|
|
itemAreaList: [],
|
|
|
switchDialog: false,
|
|
|
activeName: "sale_detail",
|
|
|
- editButton: true,
|
|
|
- isSave: true,
|
|
|
- disabled: false,
|
|
|
- isDisabled: false,
|
|
|
- isAddDisabled: false,
|
|
|
+ editButton: false,
|
|
|
+ editDisabled: false,
|
|
|
form: {
|
|
|
shipItemsList: [],
|
|
|
shipVOList: [],
|
|
|
@@ -224,7 +213,7 @@ export default {
|
|
|
column: [
|
|
|
{
|
|
|
label: "业务对象",
|
|
|
- disabled: false,
|
|
|
+ disabled: true,
|
|
|
prop: "customerId",
|
|
|
type: "select",
|
|
|
props: {
|
|
|
@@ -280,7 +269,7 @@ export default {
|
|
|
label: "业务日期",
|
|
|
prop: "businesDate",
|
|
|
searchProp: "businesDateList",
|
|
|
- disabled: false,
|
|
|
+ disabled: true,
|
|
|
type: "datetime",
|
|
|
value: dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss"),
|
|
|
format: "yyyy-MM-dd HH:mm",
|
|
|
@@ -295,7 +284,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "出库单号",
|
|
|
- disabled: false,
|
|
|
+ disabled: true,
|
|
|
prop: "billno",
|
|
|
rules: [
|
|
|
{
|
|
|
@@ -623,15 +612,16 @@ export default {
|
|
|
this.optionPaymentDetails = await this.getColumnData(this.getColumnName(270.2), this.optionPaymentDetailsBack);
|
|
|
this.optionOutboundRecords = await this.getColumnData(this.getColumnName(270.3), this.optionOutboundRecordsBack);
|
|
|
this.key++;
|
|
|
- if (this.onLoad.id && this.detailData.id) {
|
|
|
- console.log(1);
|
|
|
- this.refresh(this.onLoad.id, true);
|
|
|
- this.$set(this.optionForm, "disabled", true);
|
|
|
- } else if (this.onLoad.id) {
|
|
|
- console.log(2);
|
|
|
+ if (this.onLoad.id) {
|
|
|
+ this.editButton = true;
|
|
|
+ this.editDisabled = true;
|
|
|
+ this.optionForm.disabled = true;
|
|
|
this.refresh(this.onLoad.id, true);
|
|
|
}
|
|
|
if (this.detailData.id) {
|
|
|
+ this.editButton = true;
|
|
|
+ this.editDisabled = true;
|
|
|
+ this.optionForm.disabled = true;
|
|
|
this.refresh();
|
|
|
}
|
|
|
if (this.$route.query.srcId) {
|
|
|
@@ -741,23 +731,14 @@ export default {
|
|
|
})
|
|
|
.then(res => {
|
|
|
if (res.data.code === 601) {
|
|
|
- if (this.onLoad.id && this.detailData.id) {
|
|
|
- console.log(1);
|
|
|
- this.refresh(this.onLoad.id, true);
|
|
|
- this.$set(this.optionForm, "disabled", true);
|
|
|
- } else if (this.onLoad.id) {
|
|
|
- console.log(2);
|
|
|
- this.refresh(this.onLoad.id, true);
|
|
|
- }
|
|
|
this.$message({
|
|
|
type: "error",
|
|
|
message: res.data.msg
|
|
|
});
|
|
|
- return true;
|
|
|
+ } else {
|
|
|
+ this.$message.success("撤销成功");
|
|
|
+ this.refresh(this.form.id);
|
|
|
}
|
|
|
- this.$message.success("撤销成功");
|
|
|
- this.refresh(res.data.data.id);
|
|
|
- loading.close();
|
|
|
})
|
|
|
.finally(() => {
|
|
|
loading.close();
|
|
|
@@ -821,32 +802,23 @@ export default {
|
|
|
})
|
|
|
.then(res => {
|
|
|
if (res.data.code === 601) {
|
|
|
- if (this.onLoad.id && this.detailData.id) {
|
|
|
- console.log(1);
|
|
|
- this.refresh(this.onLoad.id, true);
|
|
|
- this.$set(this.optionForm, "disabled", true);
|
|
|
- } else if (this.onLoad.id) {
|
|
|
- console.log(2);
|
|
|
- this.refresh(this.onLoad.id, true);
|
|
|
- }
|
|
|
this.$message({
|
|
|
type: "error",
|
|
|
message: res.data.msg
|
|
|
});
|
|
|
- return true;
|
|
|
- }
|
|
|
- warehousingComplete({
|
|
|
- ...this.form,
|
|
|
- bizTypeName: "FHGD"
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
- this.$message.success("出库完成");
|
|
|
- this.refresh(res.data.data.id);
|
|
|
- loading.close();
|
|
|
+ } else {
|
|
|
+ warehousingComplete({
|
|
|
+ ...this.form,
|
|
|
+ bizTypeName: "FHGD"
|
|
|
})
|
|
|
- .finally(() => {
|
|
|
- loading.close();
|
|
|
- });
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success("出库完成");
|
|
|
+ this.refresh(res.data.data.id);
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ }
|
|
|
})
|
|
|
.catch(() => {
|
|
|
loading.close();
|
|
|
@@ -883,22 +855,6 @@ export default {
|
|
|
spinner: "el-icon-loading",
|
|
|
background: "rgba(255,255,255,0.7)"
|
|
|
});
|
|
|
- console.log(this.form);
|
|
|
- // 判断处理
|
|
|
- // if (this.form.statusName != '已出库') {
|
|
|
- // for (let index in this.form.shipItemsList) {
|
|
|
- // this.form.shipItemsList[index].goodsName = this.form.shipItemsList[index].$goodsId
|
|
|
- // if (Number(this.form.shipItemsList[index].sendNum) > Number(this.form.shipItemsList[index].inventory)) {
|
|
|
- // this.$message.warning(`序号${index + 1}的实际数量不能大于库存`);
|
|
|
- // loading.close();
|
|
|
- // return
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // this.form.shipItemsList.forEach(item => {
|
|
|
- // item.goodsName = item.$goodsId
|
|
|
- // })
|
|
|
- // this.goodsName;
|
|
|
submit({
|
|
|
...this.form,
|
|
|
bizTypeName: "FHGD",
|
|
|
@@ -906,24 +862,14 @@ export default {
|
|
|
})
|
|
|
.then(res => {
|
|
|
if (res.data.code === 601) {
|
|
|
- console.info("11111111111----", res);
|
|
|
- if (this.onLoad.id && this.detailData.id) {
|
|
|
- console.log(1);
|
|
|
- this.refresh(this.onLoad.id, true);
|
|
|
- this.$set(this.optionForm, "disabled", true);
|
|
|
- } else if (this.onLoad.id) {
|
|
|
- console.log(2);
|
|
|
- this.refresh(this.onLoad.id, true);
|
|
|
- }
|
|
|
this.$message({
|
|
|
type: "error",
|
|
|
message: res.data.msg
|
|
|
});
|
|
|
- return true;
|
|
|
+ } else {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ this.refresh(res.data.data.id);
|
|
|
}
|
|
|
- this.$message.success("保存成功");
|
|
|
- this.refresh(res.data.data.id);
|
|
|
- loading.close();
|
|
|
})
|
|
|
.finally(() => {
|
|
|
loading.close();
|
|
|
@@ -933,71 +879,26 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- refresh(id, type) {
|
|
|
- this.$set(this.optionContactsBack, "addBtn", false);
|
|
|
- this.$set(this.optionContacts, "addBtn", false);
|
|
|
- this.isDisabled = true;
|
|
|
+ refresh(id) {
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
text: "加载中",
|
|
|
spinner: "el-icon-loading",
|
|
|
background: "rgba(255,255,255,0.7)"
|
|
|
});
|
|
|
- if (!this.detailData.id) {
|
|
|
- getDetails({ id: id })
|
|
|
- .then(res => {
|
|
|
- if (res.data.data.statusName == "已出库") {
|
|
|
- this.$set(this.optionForm, "disabled", true);
|
|
|
- this.isAddDisabled = true;
|
|
|
- this.optionContacts.column.forEach(item => {
|
|
|
- if (item.prop == "sendNum") {
|
|
|
- item.disabled = true;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- this.isAddDisabled = true;
|
|
|
- if (res.data.data.statusName == "待出库") {
|
|
|
- this.isAddDisabled = true;
|
|
|
- this.isDisabled = true;
|
|
|
- }
|
|
|
- this.form = res.data.data;
|
|
|
- this.filesList = res.data.data.filesList;
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.formContacts.refreshTable();
|
|
|
- });
|
|
|
- loading.close();
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- loading.close();
|
|
|
- });
|
|
|
- } else {
|
|
|
- getDetails({ id: this.detailData.id })
|
|
|
- .then(res => {
|
|
|
- if (res.data.data.statusName == "已出库") {
|
|
|
- this.$set(this.optionForm, "disabled", true);
|
|
|
- this.isAddDisabled = true;
|
|
|
- this.optionContacts.column.forEach(item => {
|
|
|
- if (item.prop == "sendNum") {
|
|
|
- item.disabled = true;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- this.isAddDisabled = true;
|
|
|
- if (res.data.data.statusName == "待出库") {
|
|
|
- this.isAddDisabled = true;
|
|
|
- this.isDisabled = true;
|
|
|
- }
|
|
|
- this.form = res.data.data;
|
|
|
- this.filesList = res.data.data.filesList;
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.formContacts.refreshTable();
|
|
|
- });
|
|
|
- loading.close();
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- loading.close();
|
|
|
- });
|
|
|
- }
|
|
|
+ getDetails({ id: this.detailData.id })
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.data.statusName == "已出库") {
|
|
|
+ this.editButton = true;
|
|
|
+ this.editDisabled = true;
|
|
|
+ this.optionForm.disabled = true;
|
|
|
+ }
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.filesList = res.data.data.filesList;
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
},
|
|
|
rowDelBox(row, index) {
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
|
@@ -1031,46 +932,14 @@ export default {
|
|
|
},
|
|
|
//编辑
|
|
|
confirmEditing() {
|
|
|
- if (this.form.statusName == "待出库" || this.form.statusName == "待入库" || this.form.statusName == "撤销出库") {
|
|
|
- this.isDisabled = false;
|
|
|
- this.isSave = false;
|
|
|
- this.$set(this.optionForm, "disabled", false);
|
|
|
- this.optionForm.column.forEach(item => {
|
|
|
- if (
|
|
|
- item.prop == "storageId" ||
|
|
|
- item.prop == "remarks" ||
|
|
|
- item.prop == "createTime" ||
|
|
|
- item.prop == "stockClerkId" ||
|
|
|
- item.prop == "shipType" ||
|
|
|
- item.prop == "logisticsCorpName" ||
|
|
|
- item.prop == "expressNo"
|
|
|
- ) {
|
|
|
- item.disabled = false;
|
|
|
- } else {
|
|
|
- item.disabled = true;
|
|
|
- }
|
|
|
- });
|
|
|
- this.isAddDisabled = false;
|
|
|
- this.optionContactsBack.column.forEach(its => {
|
|
|
- if (its.prop == "dot") {
|
|
|
- this.$set(its, "disabled", false);
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$set(this.optionForm, "disabled", false);
|
|
|
- this.isAddDisabled = true;
|
|
|
- this.isSave = false;
|
|
|
- // this.optionForm.column.forEach(item => {
|
|
|
- // if (item.prop == 'remarks') {
|
|
|
- // item.disabled = false
|
|
|
- // } else {
|
|
|
- // item.disabled = true
|
|
|
- // }
|
|
|
- // })
|
|
|
- this.optionForm.column.forEach(item => {
|
|
|
- item.disabled = true;
|
|
|
- });
|
|
|
- // this.isAddDisabled = false
|
|
|
+ this.editButton = false;
|
|
|
+ if (this.form.statusName == "待出库" || this.form.statusName == "撤销出库") {
|
|
|
+ this.editDisabled = false;
|
|
|
+ this.optionForm.disabled = false;
|
|
|
+ }
|
|
|
+ if (this.form.statusName == "已出库") {
|
|
|
+ this.editDisabled = true;
|
|
|
+ this.optionForm.disabled = true;
|
|
|
}
|
|
|
},
|
|
|
//自定义列保存
|