|
@@ -7,11 +7,11 @@
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="add-customer-btn">
|
|
|
- <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
|
|
|
- v-if="!editButton" @click="confirmEditing">编 辑
|
|
|
+ <el-button class="el-button--small-yh" :disabled="isEditButton" style="margin-left: 6px;"
|
|
|
+ type="primary" size="small" v-if="editButton" @click="confirmEditing">编 辑
|
|
|
</el-button>
|
|
|
<el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
|
|
|
- @click="editCustomer">保 存
|
|
|
+ :disabled="isSaveBtn" @click="editCustomer">保 存
|
|
|
</el-button>
|
|
|
<el-button class="el-button--small-yh" style="margin-left: 6px;" :type="buttonColor" size="small"
|
|
|
:disabled="isDisabledTask" @click="generateOutbound">
|
|
@@ -87,7 +87,7 @@
|
|
|
</span>
|
|
|
</template> -->
|
|
|
<template slot-scope="{type,size,row,index,disabled}" slot="menu">
|
|
|
- <el-button :size="size" :disabled="disabled" :type="type"
|
|
|
+ <el-button :size="size" :disabled="disabled || isAdd" :type="type"
|
|
|
:icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="editBtn(row, index)">编辑
|
|
|
</el-button>
|
|
|
<el-button icon="el-icon-delete" :size="size" :disabled="disabled || isDisabled"
|
|
@@ -166,6 +166,11 @@ export default {
|
|
|
dataList: [],
|
|
|
dicUrlWithCustomId: '',
|
|
|
isAddBtn: true,
|
|
|
+ isSaveBtn: false,
|
|
|
+ viewDisabled: false,
|
|
|
+ isAdd: false,
|
|
|
+ editButton: true,
|
|
|
+ isEditButton: false,
|
|
|
isDisabled: false,
|
|
|
isDisabledTask: false,
|
|
|
contactsOption: [],
|
|
@@ -206,7 +211,6 @@ export default {
|
|
|
},
|
|
|
cascader: ['recAddress'],
|
|
|
change: (data) => {
|
|
|
-
|
|
|
if (!this.onLoad.id) {
|
|
|
// this.$set(this.optionContactsBack, "addBtn", true)
|
|
|
// this['optionContacts'] = this['optionContactsBack'];
|
|
@@ -221,7 +225,8 @@ export default {
|
|
|
this.form.contacts = res.data.data.corpsAttnList[0].cname
|
|
|
this.form.phone = res.data.data.corpsAttnList[0].tel
|
|
|
this.contactsOption = res.data.data.corpsAddrList
|
|
|
- this.form.recAddress = res.data.data.corpsAddrList[0].id
|
|
|
+ this.form.recAddress = res.data.data.corpsAddrList[0].belongtoarea + res.data.data.corpsAddrList[0].detailedAddress
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -248,16 +253,17 @@ export default {
|
|
|
prop: "storageId",
|
|
|
type: 'select',
|
|
|
disabled: false,
|
|
|
+ placeholder: '仓库为空即为异地销售',
|
|
|
props: {
|
|
|
label: 'cname',
|
|
|
value: 'id'
|
|
|
},
|
|
|
dicUrl: '/api/blade-sales-part/storageDesc/listAll',
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
+ // rules: [{
|
|
|
+ // required: true,
|
|
|
+ // message: " ",
|
|
|
+ // trigger: "blur"
|
|
|
+ // }]
|
|
|
}, {
|
|
|
label: '单据编号',
|
|
|
prop: "ordNo",
|
|
@@ -300,10 +306,10 @@ export default {
|
|
|
label: '收货地址',
|
|
|
prop: "recAddress",
|
|
|
type: 'select',
|
|
|
- disabled: true,
|
|
|
+ disabled: false,
|
|
|
props: {
|
|
|
label: 'address',
|
|
|
- value: 'id'
|
|
|
+ value: 'address'
|
|
|
},
|
|
|
dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
|
|
|
}, {
|
|
@@ -451,7 +457,7 @@ export default {
|
|
|
required: true,
|
|
|
message: " ",
|
|
|
trigger: "blur"
|
|
|
- },{
|
|
|
+ }, {
|
|
|
validator: (rule, value, callback) => {
|
|
|
if (value < 0) {
|
|
|
callback(new Error("数量不能小于0"));
|
|
@@ -460,7 +466,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
trigger: "blur"
|
|
|
- }]
|
|
|
+ }]
|
|
|
},
|
|
|
{
|
|
|
label: '价格',
|
|
@@ -472,7 +478,7 @@ export default {
|
|
|
required: true,
|
|
|
message: " ",
|
|
|
trigger: "blur"
|
|
|
- },{
|
|
|
+ }, {
|
|
|
validator: (rule, value, callback) => {
|
|
|
if (value < 0) {
|
|
|
callback(new Error("价格不能小于0"));
|
|
@@ -481,15 +487,15 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
+ }]
|
|
|
+ },
|
|
|
{
|
|
|
label: '库存',
|
|
|
prop: 'inventory',
|
|
|
overHidden: true,
|
|
|
hide: true,
|
|
|
width: 100
|
|
|
- },{
|
|
|
+ }, {
|
|
|
label: '批次号',
|
|
|
prop: 'dot',
|
|
|
type: "select",
|
|
@@ -621,7 +627,7 @@ export default {
|
|
|
align: 'center',
|
|
|
index: true,
|
|
|
addBtnText: "录入明细",
|
|
|
- menu:false,
|
|
|
+ menu: false,
|
|
|
refreshBtn: false,
|
|
|
dialogDrag: true,
|
|
|
addBtn: false,
|
|
@@ -651,7 +657,7 @@ export default {
|
|
|
optionOutboundRecordsBack: {
|
|
|
align: 'center',
|
|
|
index: true,
|
|
|
- menu:false,
|
|
|
+ menu: false,
|
|
|
addBtnText: "录入明细",
|
|
|
refreshBtn: false,
|
|
|
dialogDrag: true,
|
|
@@ -696,7 +702,7 @@ export default {
|
|
|
// }
|
|
|
this.findObject(this.optionContactsBack.column, "goodsId").change = ({ value, column }) => {
|
|
|
if (this.formContacts.goodsId !== value) {
|
|
|
- goodsDetail({ id: value, customId: this.dicUrlWithCustomId }).then(res => {
|
|
|
+ goodsDetail({ id: value, customId: this.dicUrlWithCustomId, stock: this.form.storageId ? this.form.storageId : '' }).then(res => {
|
|
|
this.formContacts.goodsNo = res.data.data.code
|
|
|
this.formContacts.brandId = res.data.data.brandId
|
|
|
this.formContacts.inventory = res.data.data.inventory
|
|
@@ -729,7 +735,7 @@ export default {
|
|
|
this.findObject(this.optionContacts.column, "goodsId").change = ({ value, column }) => {
|
|
|
|
|
|
if (this.formContacts.goodsId !== value) {
|
|
|
- goodsDetail({ id: value }).then(res => {
|
|
|
+ goodsDetail({ id: value, customId: this.dicUrlWithCustomId, stock: this.form.storageId ? this.form.storageId : '' }).then(res => {
|
|
|
this.formContacts.goodsNo = res.data.data.code
|
|
|
this.formContacts.brandId = res.data.data.brandId
|
|
|
this.formContacts.inventory = res.data.data.inventory
|
|
@@ -764,6 +770,8 @@ export default {
|
|
|
this.$set(this.optionContactsBack, 'disabled', true)
|
|
|
this.isContacts = true
|
|
|
this.isDisabled = true
|
|
|
+ //添加删除按钮禁用
|
|
|
+ this.isAdd = true
|
|
|
this.refresh(this.onLoad.id, true)
|
|
|
} else if (this.onLoad.id) {
|
|
|
console.log(2);
|
|
@@ -783,7 +791,10 @@ export default {
|
|
|
this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
|
|
|
}
|
|
|
if (!this.detailData.id) {
|
|
|
+ this.editButton = false
|
|
|
this.isAddBtn = false
|
|
|
+ this.isDisabledTask = false;
|
|
|
+ this.viewDisabled = false;
|
|
|
this.form.businessSource = '内部销售'
|
|
|
}
|
|
|
if (this.detailData.check) {
|
|
@@ -794,18 +805,25 @@ export default {
|
|
|
|
|
|
watch: {
|
|
|
dicUrlWithCustomId() {
|
|
|
+ console.log(this.form);
|
|
|
// this.findObject(this.optionContactsBack.column, "goodsId").dicUrl = `/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=${this.dicUrlWithCustomId}&enableOrNot=0`
|
|
|
- goodsListXs(this.dicUrlWithCustomId).then(res => {
|
|
|
+ goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
|
|
|
this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
|
|
|
})
|
|
|
|
|
|
},
|
|
|
+ 'form.storageId'(newStorageId, oldStorageId) {
|
|
|
+ goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
|
|
|
+ this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
|
|
|
+ })
|
|
|
+ },
|
|
|
$route(to, from) {
|
|
|
if (this.onLoad.id && this.detailData.id) {
|
|
|
this.$set(this.optionForm, 'disabled', true)
|
|
|
this.$set(this.optionContactsBack, 'disabled', true)
|
|
|
this.isContacts = true
|
|
|
this.isDisabled = true
|
|
|
+ this.isAdd = true
|
|
|
this.refresh(this.onLoad.id, true)
|
|
|
} else if (this.onLoad.id) {
|
|
|
console.log(2);
|
|
@@ -843,13 +861,25 @@ export default {
|
|
|
}).then(res => {
|
|
|
this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
|
|
|
})
|
|
|
- goodsListXs(this.dicUrlWithCustomId).then(res => {
|
|
|
+ goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
|
|
|
this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
|
|
|
})
|
|
|
},
|
|
|
//表头编辑
|
|
|
confirmEditing() {
|
|
|
+ goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
|
|
|
+ this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
|
|
|
+ })
|
|
|
this.isAddBtn = false
|
|
|
+ if (this.form.status == '已取消' || this.form.status == '已退款' || this.form.status == '已发货') {
|
|
|
+ return
|
|
|
+ // this.$message.error('当前状态不允许编辑')
|
|
|
+ // this.optionForm.column.forEach(item=>{
|
|
|
+ // if(item.prop= 'contacts'){
|
|
|
+ // item.disabled = true
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ }
|
|
|
if (this.form.status == '已取消' || this.form.status == '退款请核') {
|
|
|
this.isAddBtn = true
|
|
|
// this.$message.error('当前状态不允许编辑')
|
|
@@ -869,7 +899,13 @@ export default {
|
|
|
this.$set(this.optionForm, 'disabled', false)
|
|
|
this.$set(this.optionContactsBack, 'disabled', false)
|
|
|
this.isDisabled = false
|
|
|
+ this.isAdd = false
|
|
|
if (this.form.businessSource == "外部销售") {
|
|
|
+ if(this.form.status == '待发货'){
|
|
|
+ this.isSaveBtn = false;
|
|
|
+ this.isDisabledTask = false;
|
|
|
+ this.viewDisabled = false;
|
|
|
+ }
|
|
|
if (this.form.status == '待确认') {
|
|
|
const loadings = this.$loading({
|
|
|
lock: true,
|
|
@@ -878,6 +914,9 @@ export default {
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
});
|
|
|
console.log('外部销售');
|
|
|
+ this.isSaveBtn = false;
|
|
|
+ this.isDisabledTask = false;
|
|
|
+ this.viewDisabled = false;
|
|
|
this.optionForm.column.forEach(its => {
|
|
|
if (its.prop == 'customerId') {
|
|
|
this.$set(its, 'disabled', true)
|
|
@@ -885,6 +924,7 @@ export default {
|
|
|
})
|
|
|
//不能录入不能删除
|
|
|
this.isDisabled = true
|
|
|
+ this.isAdd = false
|
|
|
this.$set(this.form, 'shipType', '物流')
|
|
|
this.$set(this.form, 'receivableType', '网络支付')
|
|
|
this.optionContactsBack.column.forEach(item => {
|
|
@@ -903,6 +943,9 @@ export default {
|
|
|
});
|
|
|
this.isAddBtn = true
|
|
|
this.isDisabled = true
|
|
|
+ this.isSaveBtn = false;
|
|
|
+ this.isDisabledTask = false;
|
|
|
+ this.viewDisabled = false;
|
|
|
this.optionForm.column.forEach(its => {
|
|
|
if (its.prop != 'remarks') {
|
|
|
its.disabled = true
|
|
@@ -950,7 +993,9 @@ export default {
|
|
|
})
|
|
|
loading.close()
|
|
|
} else if (this.form.status == '录入') {
|
|
|
-
|
|
|
+ this.isSaveBtn = false;
|
|
|
+ this.isDisabledTask = false;
|
|
|
+ this.viewDisabled = false;
|
|
|
// this.$set(this.optionForm, 'disabled', false)
|
|
|
// this.$set(this.optionContactsBack, 'disabled', false)
|
|
|
this.$set(this.optionForm, 'disabled', false)
|
|
@@ -964,7 +1009,10 @@ export default {
|
|
|
loading.close()
|
|
|
|
|
|
} else if (this.form.status == '待确认') {
|
|
|
- this.isDisabled = true
|
|
|
+ this.isSaveBtn = false;
|
|
|
+ this.isDisabledTask = false;
|
|
|
+ this.viewDisabled = false;
|
|
|
+ // this.isDisabled = true
|
|
|
console.log('待确认');
|
|
|
this.optionForm.column.forEach(item => {
|
|
|
if (item.label === '仓库' || item.label === '备注' || item.label === '配送方式' || item.label === '物流公司') {
|
|
@@ -983,6 +1031,11 @@ export default {
|
|
|
})
|
|
|
loading.close()
|
|
|
}
|
|
|
+ if(this.form.status == '待发货'){
|
|
|
+ this.isSaveBtn = false;
|
|
|
+ this.isDisabledTask = false;
|
|
|
+ this.viewDisabled = false;
|
|
|
+ }
|
|
|
// this.$set(this.form, 'shipType', '物流')
|
|
|
// this.$set(this.form, 'receivableType', '现金')
|
|
|
// this.optionContactsBack.column.forEach(item => {
|
|
@@ -1030,7 +1083,9 @@ export default {
|
|
|
// items.goodsName = goodsName
|
|
|
|
|
|
// })
|
|
|
+ this.save()
|
|
|
generateShipTask(this.form).then(res => {
|
|
|
+ console.log(2);
|
|
|
console.log(res.data);
|
|
|
this.refresh(res.data.data.id, true)
|
|
|
this.isContacts = true
|
|
@@ -1039,6 +1094,7 @@ export default {
|
|
|
// 将按钮颜色更改为对应的颜色
|
|
|
this.buttonColor = 'warning'; // 比如改为warning
|
|
|
this.$message.success("生成出库任务成功");
|
|
|
+ this.isApplySettlement = false
|
|
|
loading.close();
|
|
|
}).finally(() => {
|
|
|
loading.close();
|
|
@@ -1076,7 +1132,17 @@ export default {
|
|
|
this.buttonColor = 'success';
|
|
|
this.$message.success("撤销出库成功");
|
|
|
this.refresh(res.data.data.id)
|
|
|
+ this.isApplySettlement = false
|
|
|
loading.close();
|
|
|
+ }).catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ if (err instanceof TooManyResultsException) {
|
|
|
+ // 不显示错误消息
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 显示其他错误消息
|
|
|
+ this.$message.error('发生错误,请稍后重试');
|
|
|
+
|
|
|
}).finally(() => {
|
|
|
loading.close();
|
|
|
});
|
|
@@ -1126,6 +1192,34 @@ export default {
|
|
|
this.$message.success("保存成功");
|
|
|
this.refresh(res.data.data.id)
|
|
|
this.isDisabledTask = false
|
|
|
+ this.editButton = true
|
|
|
+ loading.close();
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //保存
|
|
|
+ save() {
|
|
|
+ this.$refs["form"].validate((valid, done) => {
|
|
|
+ done();
|
|
|
+ if (valid) {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ submit({
|
|
|
+ bsType: "XS",
|
|
|
+ ...this.form
|
|
|
+ }).then(res => {
|
|
|
+ console.log(1);
|
|
|
+ this.refresh(res.data.data.id)
|
|
|
+ this.isDisabledTask = false
|
|
|
loading.close();
|
|
|
}).finally(() => {
|
|
|
loading.close();
|
|
@@ -1149,11 +1243,27 @@ export default {
|
|
|
getList(1, 50, ordForm).then((res) => {
|
|
|
this.dataList = res.data.data.records ? res.data.data.records : [];
|
|
|
})
|
|
|
- if (this.form.status !== '录入' && this.form.status !== '退款中' && this.form.status !== '已取消' && this.form.status !== '退款请核' && this.form.status !== '已退款') {
|
|
|
+ if (this.form.status !== '录入' && this.form.status !== '退款中' && this.form.status !== '已取消' && this.form.status !== '退款请核' && this.form.status !== '已退款' && this.form.status !== '待确认' && this.form.status !== '待发货') {
|
|
|
console.log(1);
|
|
|
this.isApplySettlement = false;
|
|
|
}
|
|
|
-
|
|
|
+ if (
|
|
|
+ this.form.status === '已退款' ||
|
|
|
+ this.form.status === '已收货' ||
|
|
|
+ this.form.status === '已发货' ||
|
|
|
+ this.form.status === '已取消'
|
|
|
+ ) {
|
|
|
+ // 禁用编辑按钮
|
|
|
+ console.log('按钮全部禁用');
|
|
|
+ this.isEditButton = true;
|
|
|
+ this.isSaveBtn = true;
|
|
|
+ this.isDisabledTask = true;
|
|
|
+ this.viewDisabled = true;
|
|
|
+ }else{
|
|
|
+ this.isSaveBtn = true;
|
|
|
+ this.isDisabledTask = true;
|
|
|
+ this.viewDisabled = true;
|
|
|
+ }
|
|
|
if (this.form.status == '退款中') {
|
|
|
this.isConfirmRefundBtn = false;
|
|
|
}
|
|
@@ -1161,23 +1271,15 @@ export default {
|
|
|
this.isConfirmRefundBtn = true;
|
|
|
}
|
|
|
|
|
|
- // if (this.form.status == '退款请核') {
|
|
|
-
|
|
|
- // this.isExamineBtn = false;
|
|
|
- // }
|
|
|
if (this.form.generateTask == '已生成') {
|
|
|
this.buttonText = '撤销任务';
|
|
|
- this.isDisabledTask = false;
|
|
|
+ // this.isDisabledTask = false;
|
|
|
this.buttonColor = 'warning'
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
if (this.form.status == '退款请核' || this.form.status == '退款中') {
|
|
|
this.isRevocationRequest = false;
|
|
|
}
|
|
|
- if (this.form.status == '已收货' || this.form.status == '已发货') {
|
|
|
- this.isDisabledTask = true;
|
|
|
- }
|
|
|
+
|
|
|
//成本、毛利对销售角色隐藏
|
|
|
this.optionForm.column.forEach(its => {
|
|
|
if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('销售')) {
|
|
@@ -1390,7 +1492,7 @@ export default {
|
|
|
},
|
|
|
// 新增轮胎
|
|
|
rowAdd(row) {
|
|
|
- if(!this.form.customerId){
|
|
|
+ if (!this.form.customerId) {
|
|
|
this.$message.error('请选择客户')
|
|
|
return
|
|
|
}
|