|
@@ -14,7 +14,7 @@
|
|
|
@click="editCustomer">保 存
|
|
|
</el-button>
|
|
|
<el-button class="el-button--small-yh" style="margin-left: 6px;" :type="buttonColor" size="small"
|
|
|
- :disabled="isDisabledTask" @click="generateOutbound">
|
|
|
+ :disabled="isDisabledTask" @click="generateOutbound">
|
|
|
{{ buttonText }}
|
|
|
</el-button>
|
|
|
|
|
@@ -50,11 +50,12 @@
|
|
|
<avue-form :option="optionForm" v-model="form" ref="form">
|
|
|
<template slot-scope="{row,index}" slot="contacts">
|
|
|
<el-select v-model="form.contacts" placeholder="请选择" size="small" style="width:60%" filterable
|
|
|
- @change="contactsChange($event)" :disabled = isContacts>
|
|
|
+ @change="contactsChange($event)" :disabled=isContacts>
|
|
|
<el-option v-for="item in contactsOption" :key="item.id" :label="item.contacts"
|
|
|
:value="item.contacts" />
|
|
|
</el-select>
|
|
|
- </template></avue-form>
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
</trade-card>
|
|
|
<trade-card title="明细信息">
|
|
|
<el-tabs v-model="activeName" type="card">
|
|
@@ -63,7 +64,9 @@
|
|
|
:data="form.orderItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
|
|
|
@resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)"
|
|
|
@saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)">
|
|
|
- <template slot-scope="scope" slot="menuLeft">
|
|
|
+ <template slot-scope="{scope,row}" slot="menuLeft">
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="small" :disabled="isAddBtn"
|
|
|
+ @click="rowAdd(row)">添加轮胎</el-button>
|
|
|
<el-button type="primary" icon="el-icon-printer" size="small"
|
|
|
@click="handlePrint">打印</el-button>
|
|
|
</template>
|
|
@@ -140,7 +143,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { getDetails as getCustom } from "@/api/tirePartsMall/basicData/customerInformation"
|
|
|
-import { getDetails, submit, generateShipTask, tradingBox, delOrderItem, checkOrder, confirmRefund, revokeCheckOrder, revokeGenerateShipTask,goodsListXs } from "@/api/tirePartsMall/salesManagement/saleOrder";
|
|
|
+import { getDetails, submit, generateShipTask, tradingBox, delOrderItem, checkOrder, confirmRefund, revokeCheckOrder, revokeGenerateShipTask, goodsListXs } from "@/api/tirePartsMall/salesManagement/saleOrder";
|
|
|
import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
|
|
|
import reportDialog from "@/components/report-dialog/main";
|
|
|
import checkSchedule from "@/components/check/checkSchedule";
|
|
@@ -150,15 +153,17 @@ import TicketDistribution from "../../../oceanShipping/maritimeExport/components
|
|
|
import M from "minimatch";
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
|
+
|
|
|
data() {
|
|
|
return {
|
|
|
- goodsIdoptions:[],
|
|
|
+ goodsIdoptions: [],
|
|
|
dataList: [],
|
|
|
dicUrlWithCustomId: '',
|
|
|
+ isAddBtn: true,
|
|
|
isDisabled: false,
|
|
|
isDisabledTask: false,
|
|
|
contactsOption: [],
|
|
|
- isContacts:false,
|
|
|
+ isContacts: false,
|
|
|
checkData: {},
|
|
|
buttonText: '生成任务',
|
|
|
buttonColor: 'success', // 初始颜色为success
|
|
@@ -187,6 +192,7 @@ export default {
|
|
|
label: '客户',
|
|
|
prop: "customerId",
|
|
|
disabled: false,
|
|
|
+ remote: true,
|
|
|
type: 'select',
|
|
|
props: {
|
|
|
label: 'cname',
|
|
@@ -194,20 +200,18 @@ export default {
|
|
|
},
|
|
|
cascader: ['recAddress'],
|
|
|
change: (data) => {
|
|
|
- console.log(this.$refs.form.DIC.customerId);
|
|
|
- console.log('this.onLoad.id', this.onLoad.id);
|
|
|
|
|
|
- if (!this.form.id) {
|
|
|
- this.$set(this.optionContactsBack, "addBtn", true)
|
|
|
+ if (!this.onLoad.id) {
|
|
|
+ // this.$set(this.optionContactsBack, "addBtn", true)
|
|
|
// this['optionContacts'] = this['optionContactsBack'];
|
|
|
// this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
|
|
|
}
|
|
|
if (this.$refs.form.DIC.customerId || !this.onLoad.id) {
|
|
|
getCustom({ id: data.value }).then(res => {
|
|
|
- console.log(res.data.data);
|
|
|
- this.dicUrlWithCustomId = res.data.data.id
|
|
|
- this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
|
|
|
- this.form.storageId = res.data.data.deliveryWarehouseId
|
|
|
+ this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
|
|
|
+ // this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
|
|
|
+ // this.form.storageId = res.data.data.deliveryWarehouseId
|
|
|
+ this.form.storageId = this.form.storageId ?this.form.storageId :res.data.data.deliveryWarehouseId
|
|
|
this.form.contacts = res.data.data.corpsAttnList[0].cname
|
|
|
this.form.phone = res.data.data.corpsAttnList[0].tel
|
|
|
this.contactsOption = res.data.data.corpsAddrList
|
|
@@ -227,7 +231,7 @@ export default {
|
|
|
// }
|
|
|
// }
|
|
|
},
|
|
|
- dicUrl: '/api/blade-sales-part/corpsDesc/listAll?corpType=KH',
|
|
|
+ dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH&enableOrNot=0',
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: " ",
|
|
@@ -237,6 +241,7 @@ export default {
|
|
|
label: '仓库',
|
|
|
prop: "storageId",
|
|
|
type: 'select',
|
|
|
+ disabled: false,
|
|
|
props: {
|
|
|
label: 'cname',
|
|
|
value: 'id'
|
|
@@ -263,6 +268,7 @@ export default {
|
|
|
label: '应收类别',
|
|
|
prop: "receivableType",
|
|
|
type: "select",
|
|
|
+ disabled: false,
|
|
|
dicUrl: "/api/blade-system/dict-biz/dictionary?code=receivableType",
|
|
|
props: {
|
|
|
label: "dictValue",
|
|
@@ -273,7 +279,7 @@ export default {
|
|
|
label: '联系人',
|
|
|
type: "select",
|
|
|
prop: "contacts",
|
|
|
- disabled:false,
|
|
|
+ disabled: false,
|
|
|
props: {
|
|
|
label: 'address',
|
|
|
value: 'id'
|
|
@@ -281,6 +287,8 @@ export default {
|
|
|
dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
|
|
|
}, {
|
|
|
label: '电话',
|
|
|
+ disabled: false,
|
|
|
+
|
|
|
prop: "phone",
|
|
|
}, {
|
|
|
label: '收货地址',
|
|
@@ -296,6 +304,7 @@ export default {
|
|
|
label: '配送方式',
|
|
|
type: 'select',
|
|
|
prop: "shipType",
|
|
|
+ disabled: false,
|
|
|
dicUrl: "/api/blade-system/dict-biz/dictionary?code=deliveryMethod",
|
|
|
props: {
|
|
|
label: "dictValue",
|
|
@@ -304,10 +313,13 @@ export default {
|
|
|
value: '物流'
|
|
|
}, {
|
|
|
label: '物流公司',
|
|
|
+ disabled: false,
|
|
|
+
|
|
|
prop: "logisticsCorpName"
|
|
|
}, {
|
|
|
label: '成本',
|
|
|
prop: "cost",
|
|
|
+ display: true,
|
|
|
disabled: true
|
|
|
}, {
|
|
|
label: '毛利',
|
|
@@ -329,6 +341,7 @@ export default {
|
|
|
label: '备注',
|
|
|
prop: "remarks",
|
|
|
type: 'textarea',
|
|
|
+ disabled: false,
|
|
|
span: 16,
|
|
|
minRows: 1
|
|
|
}]
|
|
@@ -363,10 +376,10 @@ export default {
|
|
|
type: 'sum',
|
|
|
}
|
|
|
],
|
|
|
- addBtnText: "录入明细",
|
|
|
+ addBtnText: "添加轮胎",
|
|
|
refreshBtn: false,
|
|
|
dialogDrag: true,
|
|
|
- addBtn: true,
|
|
|
+ addBtn: false,
|
|
|
span: 8,
|
|
|
height: 500,
|
|
|
addRowBtn: false,
|
|
@@ -414,20 +427,58 @@ export default {
|
|
|
remote: true,
|
|
|
overHidden: true,
|
|
|
type: 'select',
|
|
|
+ dicData: [],
|
|
|
props: {
|
|
|
label: 'cname',
|
|
|
value: 'id'
|
|
|
},
|
|
|
// dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}'
|
|
|
- dicUrl: []
|
|
|
+ dicUrl: "/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=1658279303722418177&enableOrNot=0"
|
|
|
// dicUrl: "/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}"
|
|
|
}, {
|
|
|
+ label: '数量',
|
|
|
+ prop: 'goodsNum',
|
|
|
+ overHidden: true,
|
|
|
+ disabled: false,
|
|
|
+ width: 100,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ }, {
|
|
|
+ label: '价格',
|
|
|
+ prop: 'price',
|
|
|
+ overHidden: true,
|
|
|
+ width: 100,
|
|
|
+ disabled: false,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ }, {
|
|
|
+ label: '批次号',
|
|
|
+ prop: 'dot',
|
|
|
+ type: "select",
|
|
|
+ disabled: true,
|
|
|
+ allowCreate: true,
|
|
|
+ filterable: true,
|
|
|
+ dicData: [],
|
|
|
+ props: {
|
|
|
+ label: "dot",
|
|
|
+ value: "dot"
|
|
|
+ },
|
|
|
+ dicUrl: "/api/blade-sales-part/stockDesc/dotList",
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
label: '轮胎编码',
|
|
|
prop: 'goodsNo',
|
|
|
overHidden: true,
|
|
|
disabled: false,
|
|
|
width: 100
|
|
|
- }, {
|
|
|
+ },
|
|
|
+ {
|
|
|
label: '品牌',
|
|
|
prop: 'brandId',
|
|
|
disabled: false,
|
|
@@ -439,7 +490,8 @@ export default {
|
|
|
value: 'id'
|
|
|
},
|
|
|
dicUrl: '/api/blade-sales-part/brandDesc/listAll'
|
|
|
- }, {
|
|
|
+ },
|
|
|
+ {
|
|
|
label: '规格型号',
|
|
|
prop: 'propertyName',
|
|
|
overHidden: true,
|
|
@@ -470,45 +522,6 @@ export default {
|
|
|
dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
|
|
|
overHidden: true,
|
|
|
width: 100
|
|
|
- }, {
|
|
|
- label: '批次号',
|
|
|
- prop: 'dot',
|
|
|
- type: "select",
|
|
|
- disabled: true,
|
|
|
- allowCreate: true,
|
|
|
- filterable: true,
|
|
|
- dicData: [],
|
|
|
- props: {
|
|
|
- label: "dot",
|
|
|
- value: "dot"
|
|
|
- },
|
|
|
- dicUrl: "/api/blade-sales-part/stockDesc/dotList",
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '数量',
|
|
|
- prop: 'goodsNum',
|
|
|
- overHidden: true,
|
|
|
- disabled: false,
|
|
|
- width: 100,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- label: '价格',
|
|
|
- prop: 'price',
|
|
|
- overHidden: true,
|
|
|
- width: 100,
|
|
|
- disabled: false,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
},
|
|
|
|
|
|
{
|
|
@@ -642,11 +655,20 @@ export default {
|
|
|
detailData: Object
|
|
|
},
|
|
|
async created() {
|
|
|
+ // console.log(this.$route);
|
|
|
+ // if(this.$route.query.check.actId){
|
|
|
+
|
|
|
+ // this.isExamineBtn = false
|
|
|
+ // }
|
|
|
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 }).then(res => {
|
|
|
this.formContacts.goodsNo = res.data.data.code
|
|
|
this.formContacts.brandId = res.data.data.brandId
|
|
|
+
|
|
|
+ // this.formContacts.brandId = res.data.data.brandName
|
|
|
+ // this.formContacts.brandName = res.data.data.brandId
|
|
|
+
|
|
|
this.formContacts.propertyName = res.data.data.specificationAndModel
|
|
|
this.formContacts.pattern = res.data.data.brandItem
|
|
|
this.formContacts.goodsDescription = res.data.data.goodsDescription
|
|
@@ -663,17 +685,23 @@ export default {
|
|
|
this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
|
|
|
})
|
|
|
}
|
|
|
+ // this.formContacts.goodsId = res.data.data.cname
|
|
|
+ // this.formContacts.goodsName = res.data.data.id
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
this.optionContacts = await this.getColumnData(this.getColumnName(269.1), this.optionContactsBack);
|
|
|
- console.log('this.optionContacts.column', this.optionContacts.column);
|
|
|
+
|
|
|
this.findObject(this.optionContacts.column, "goodsId").change = ({ value, column }) => {
|
|
|
- console.log('走i在');
|
|
|
+
|
|
|
if (this.formContacts.goodsId !== value) {
|
|
|
goodsDetail({ id: value }).then(res => {
|
|
|
this.formContacts.goodsNo = res.data.data.code
|
|
|
this.formContacts.brandId = res.data.data.brandId
|
|
|
+
|
|
|
+ // this.formContacts.brandId = res.data.data.brandName
|
|
|
+ // this.formContacts.brandName = res.data.data.brandId
|
|
|
+
|
|
|
this.formContacts.propertyName = res.data.data.specificationAndModel
|
|
|
this.formContacts.pattern = res.data.data.brandItem
|
|
|
this.formContacts.goodsDescription = res.data.data.goodsDescription
|
|
@@ -689,6 +717,8 @@ export default {
|
|
|
this.findObject(this.optionContacts.column, "dot").dicData = res.data.data
|
|
|
})
|
|
|
}
|
|
|
+ // this.formContacts.goodsId = res.data.data.cname
|
|
|
+ // this.formContacts.goodsName = res.data.data.id
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -707,64 +737,67 @@ export default {
|
|
|
}
|
|
|
if (!this.form.id) {
|
|
|
console.log(3);
|
|
|
- this.$set(this.optionContactsBack, "addBtn", false)
|
|
|
+ this.optionContactsBack.column.forEach(its => {
|
|
|
+ if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
|
|
|
+ its.disabled = false
|
|
|
+ } else {
|
|
|
+ its.disabled = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // this.$set(this.optionContactsBack, "addBtn", false)
|
|
|
this['optionContacts'] = this['optionContactsBack'];
|
|
|
this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
|
|
|
}
|
|
|
if (!this.detailData.id) {
|
|
|
+ this.isAddBtn = false
|
|
|
this.form.businessSource = '内部销售'
|
|
|
}
|
|
|
- console.log('this.detailData.status', this.detailData.status);
|
|
|
- // if (this.detailData.status == 1) {
|
|
|
- // this.isExamineBtn = false;
|
|
|
- // }
|
|
|
- // goodsListXs(this.dicUrlWithCustomId).then(res=>{
|
|
|
- // console.log(res);
|
|
|
- // this.goodsIdoptions = res.data
|
|
|
- // })
|
|
|
+ if (this.detailData.check) {
|
|
|
+ this.isExamineBtn = false
|
|
|
+ // this.batchNo = this.detailData.check.batchNo
|
|
|
+ }
|
|
|
},
|
|
|
- watch:{
|
|
|
- dicUrlWithCustomId(){
|
|
|
- // console.log(23432);
|
|
|
- // goodsListXs(this.dicUrlWithCustomId).then(res=>{
|
|
|
- // console.log(res);
|
|
|
- // this.goodsIdoptions = res.data
|
|
|
- // })
|
|
|
- this.findObject(this.optionContactsBack.column, "goodsId").dicUrl = `/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=${this.dicUrlWithCustomId}`
|
|
|
|
|
|
-
|
|
|
+ watch: {
|
|
|
+ dicUrlWithCustomId() {
|
|
|
+ // 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 => {
|
|
|
+ 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.refresh(this.onLoad.id, true)
|
|
|
- } else if (this.onLoad.id) {
|
|
|
- console.log(2);
|
|
|
- this.refresh(this.onLoad.id, true)
|
|
|
- }
|
|
|
- if (!this.form.id) {
|
|
|
- console.log(3);
|
|
|
- this.$set(this.optionContactsBack, "addBtn", false)
|
|
|
- this['optionContacts'] = this['optionContactsBack'];
|
|
|
- this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
|
|
|
- }
|
|
|
- if (!this.detailData.id) {
|
|
|
- this.form.businessSource = '内部销售'
|
|
|
- }
|
|
|
- console.log('this.detailData.status', this.detailData.status);
|
|
|
- // if (this.detailData.status == 1) {
|
|
|
- // this.isExamineBtn = false;
|
|
|
- // }
|
|
|
- if(to.name == '销售订单'){
|
|
|
- console.log('销售订单');
|
|
|
- this.isExamineBtn = false;
|
|
|
+ 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.refresh(this.onLoad.id, true)
|
|
|
+ } else if (this.onLoad.id) {
|
|
|
+ console.log(2);
|
|
|
+ this.refresh(this.onLoad.id, true)
|
|
|
+ }
|
|
|
+ // if (!this.form.id) {
|
|
|
+ // console.log(3);
|
|
|
+ // // this.$set(this.optionContactsBack, "addBtn", false)
|
|
|
+ // this['optionContacts'] = this['optionContactsBack'];
|
|
|
+ // this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
|
|
|
+ // }
|
|
|
+ // if (!this.detailData.id) {
|
|
|
+ // this.form.businessSource = '内部销售'
|
|
|
+ // }
|
|
|
+
|
|
|
+ if (this.detailData.status == 1) {
|
|
|
+ this.isExamineBtn = false;
|
|
|
+ }
|
|
|
+ // if (to.name == '销售订单') {
|
|
|
+ // console.log('销售订单');
|
|
|
+ // this.isExamineBtn = false;
|
|
|
|
|
|
+ // }
|
|
|
}
|
|
|
- }
|
|
|
},
|
|
|
+
|
|
|
methods: {
|
|
|
editBtn(row, index) {
|
|
|
console.log(123);
|
|
@@ -775,11 +808,16 @@ export default {
|
|
|
}).then(res => {
|
|
|
this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
|
|
|
})
|
|
|
+ goodsListXs(this.dicUrlWithCustomId).then(res => {
|
|
|
+ this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
|
|
|
+ })
|
|
|
},
|
|
|
//表头编辑
|
|
|
confirmEditing() {
|
|
|
- console.log(this.form);
|
|
|
- if(this.form.status=='已取消'||this.form.status =='待发货'||this.form.status=='已发货'){
|
|
|
+ this.isAddBtn = false
|
|
|
+ if (this.form.status == '已取消' || this.form.status == '退款请核') {
|
|
|
+ this.isAddBtn = true
|
|
|
+ this.$message.error('当前状态不允许编辑')
|
|
|
// this.optionForm.column.forEach(item=>{
|
|
|
// if(item.prop= 'contacts'){
|
|
|
// item.disabled = true
|
|
@@ -787,95 +825,223 @@ export default {
|
|
|
// })
|
|
|
return;
|
|
|
}
|
|
|
+ this.optionContactsBack.column.forEach(its => {
|
|
|
+ if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
|
|
|
+ its.disabled = false
|
|
|
+ } else {
|
|
|
+ its.disabled = true
|
|
|
+ }
|
|
|
+ })
|
|
|
this.$set(this.optionForm, 'disabled', false)
|
|
|
this.$set(this.optionContactsBack, 'disabled', false)
|
|
|
this.isDisabled = false
|
|
|
- console.log('this.form.businessSource', this.form.businessSource);
|
|
|
if (this.form.businessSource == "外部销售") {
|
|
|
+ if (this.form.status == '待确认') {
|
|
|
+ const loadings = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ console.log('外部销售');
|
|
|
+ this.optionForm.column.forEach(its => {
|
|
|
+ if (its.prop == 'customerId') {
|
|
|
+ this.$set(its, 'disabled', true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //不能录入不能删除
|
|
|
+ this.isDisabled = true
|
|
|
+ this.$set(this.form, 'shipType', '物流')
|
|
|
+ this.$set(this.form, 'receivableType', '网络支付')
|
|
|
+ this.optionContactsBack.column.forEach(item => {
|
|
|
+ this.$set(item, 'disabled', true)
|
|
|
+ if (item.label == '批次号' || item.label == '备注') {
|
|
|
+ item.disabled = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ loadings.close()
|
|
|
+ }else{
|
|
|
+ const loadin = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ this.isAddBtn = true
|
|
|
+ this.isDisabled = true
|
|
|
+ this.optionForm.column.forEach(its => {
|
|
|
+ if (its.prop != 'remarks') {
|
|
|
+ its.disabled = true
|
|
|
+ } else {
|
|
|
+ its.disabled = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.optionContactsBack.column.forEach(its => {
|
|
|
+ if (its.prop != 'remarks') {
|
|
|
+ its.disabled = true
|
|
|
+ } else {
|
|
|
+ its.disabled = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ loadin.close()
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
text: '加载中',
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
});
|
|
|
- console.log('外部销售');
|
|
|
- this.optionForm.column.forEach(its => {
|
|
|
- if (its.prop == 'customerId') {
|
|
|
- this.$set(its, 'disabled', true)
|
|
|
- }
|
|
|
- })
|
|
|
- //不能录入不能删除
|
|
|
- this.$set(this.optionContactsBack, "addBtn", false)
|
|
|
- this.isDisabled = true
|
|
|
- this.$set(this.form, 'shipType', '物流')
|
|
|
- this.$set(this.form, 'receivableType', '网络支付')
|
|
|
- this.optionContactsBack.column.forEach(item => {
|
|
|
- this.$set(item, 'disabled', true)
|
|
|
- if (item.label == '批次号' || item.label == '备注') {
|
|
|
- item.disabled = false
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.form.status == '待发货' || this.form.status == '已发货') {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ this.optionForm.column.forEach(its => {
|
|
|
+ if (its.prop != 'remarks') {
|
|
|
+ its.disabled = true
|
|
|
+ } else {
|
|
|
+ its.disabled = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.optionContactsBack.column.forEach(its => {
|
|
|
+ if (its.prop != 'remarks') {
|
|
|
+ its.disabled = true
|
|
|
+ } else {
|
|
|
+ its.disabled = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ loading.close()
|
|
|
+ } else if (this.form.status == '录入') {
|
|
|
|
|
|
- // this['optionContacts'] = this['optionContactsBack'];
|
|
|
- // this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
|
|
|
+ // this.$set(this.optionForm, 'disabled', false)
|
|
|
+ // this.$set(this.optionContactsBack, 'disabled', false)
|
|
|
+ this.$set(this.optionForm, 'disabled', false)
|
|
|
+ this.$set(this.optionContactsBack, 'disabled', false)
|
|
|
+ this.isContacts = true
|
|
|
+ //删除按钮
|
|
|
+ this.isDisabled = false
|
|
|
+ // this.optionForm.column.forEach(item => {
|
|
|
+ // item.disabled = false
|
|
|
+ // })
|
|
|
+ loading.close()
|
|
|
+
|
|
|
+ } else if (this.form.status == '待确认') {
|
|
|
+ this.isDisabled = true
|
|
|
+ console.log('待确认');
|
|
|
+ this.optionForm.column.forEach(item => {
|
|
|
+ if (item.label === '仓库' || item.label === '备注' || item.label === '配送方式' || item.label === '物流公司') {
|
|
|
+ this.$set(item, 'disabled', false)
|
|
|
+ } else {
|
|
|
+ this.$set(item, 'disabled', true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.optionContactsBack.column.forEach(its => {
|
|
|
+ if (its.prop == 'remarks' || its.prop == 'dot') {
|
|
|
+ this.$set(its, 'disabled', false)
|
|
|
+ } else {
|
|
|
+ this.$set(its, 'disabled', true)
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ loading.close()
|
|
|
+ }
|
|
|
+ // this.$set(this.form, 'shipType', '物流')
|
|
|
+ // this.$set(this.form, 'receivableType', '现金')
|
|
|
+ // this.optionContactsBack.column.forEach(item => {
|
|
|
+ // this.$set(item, 'disabled', false)
|
|
|
+ // })
|
|
|
// this.optionContactsBack.column.forEach(item => {
|
|
|
- // if (item.prop == 'dot') {
|
|
|
- // this.$set(item, disabled, false)
|
|
|
- // } else {
|
|
|
- // this.$set(item, disabled, true)
|
|
|
+ // if (item.label === '规格型号' || item.label === '花纹' || item.label === '品牌' || item.label === '物料编码' || item.label === '单位' || item.label === '轮胎描述') {
|
|
|
+ // item.disabled = true;
|
|
|
// }
|
|
|
// })
|
|
|
- loading.close()
|
|
|
- } else {
|
|
|
- const loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: '加载中',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(255,255,255,0.7)'
|
|
|
- });
|
|
|
- this.$set(this.form, 'shipType', '物流')
|
|
|
- this.$set(this.form, 'receivableType', '现金')
|
|
|
- this.optionContactsBack.column.forEach(item => {
|
|
|
- this.$set(item, 'disabled', false)
|
|
|
- })
|
|
|
- this.optionContactsBack.column.forEach(item => {
|
|
|
- if (item.label === '规格型号' || item.label === '花纹' || item.label === '品牌' || item.label === '物料编码' || item.label === '单位' || item.label === '轮胎描述') {
|
|
|
- item.disabled = true;
|
|
|
- }
|
|
|
- })
|
|
|
- console.log(324324);
|
|
|
- this['optionContacts'] = this['optionContactsBack'];
|
|
|
- this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
|
|
|
+ // this['optionContacts'] = this['optionContactsBack'];
|
|
|
+ // this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
|
|
|
loading.close()
|
|
|
}
|
|
|
// this.$set(this.form.orderItemsList,'goodsNum',66)
|
|
|
+
|
|
|
},
|
|
|
generateOutbound() {
|
|
|
- if(!this.form.id){
|
|
|
+ if (!this.form.id) {
|
|
|
this.$message.error('请先保存')
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
if (this.buttonText === '生成任务') {
|
|
|
- // 将按钮文本更改为"撤销任务"
|
|
|
- this.buttonText = '撤销任务';
|
|
|
- // 将按钮颜色更改为对应的颜色
|
|
|
- this.buttonColor = 'warning'; // 比如改为warning
|
|
|
- //生成任务逻辑
|
|
|
- if (this.form.orderItemsList.length <= 0) {
|
|
|
- this.$message.error('请录入明细');
|
|
|
+ //生成任务逻辑
|
|
|
+ if (this.form.orderItemsList.length <= 0) {
|
|
|
+ this.$message.error('请录入明细');
|
|
|
+ } else {
|
|
|
+ this.$set(this.optionForm, 'disabled', true)
|
|
|
+ this.$set(this.optionContactsBack, 'disabled', true)
|
|
|
+ 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)'
|
|
|
+ });
|
|
|
+ // this.form.orderItemsList.forEach((items) => {
|
|
|
+ // let brandName = items.brandId
|
|
|
+ // items.brandId = items.brandName
|
|
|
+ // items.brandName = brandName
|
|
|
+
|
|
|
+ // let goodsName = items.goodsId
|
|
|
+ // items.goodsId = items.goodsName
|
|
|
+ // items.goodsName = goodsName
|
|
|
+
|
|
|
+ // })
|
|
|
+ generateShipTask(this.form).then(res => {
|
|
|
+ console.log(res.data);
|
|
|
+ this.refresh(res.data.data.id, true)
|
|
|
+ this.isContacts = true
|
|
|
+ // 将按钮文本更改为"撤销任务"
|
|
|
+ this.buttonText = '撤销任务';
|
|
|
+ // 将按钮颜色更改为对应的颜色
|
|
|
+ this.buttonColor = 'warning'; // 比如改为warning
|
|
|
+ this.$message.success("生成出库任务成功");
|
|
|
+ loading.close();
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.$message.error('请选择仓库')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.$set(this.optionForm, 'disabled', true)
|
|
|
- this.$set(this.optionContactsBack, 'disabled', true)
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
- if (valid) {
|
|
|
+ console.log(valid);
|
|
|
+ if (true) {
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
text: '加载中',
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
});
|
|
|
- generateShipTask(this.form).then(res => {
|
|
|
- this.$message.success("生成出库任务成功");
|
|
|
+ // this.form.orderItemsList.forEach((items) => {
|
|
|
+ // let brandName = items.brandId
|
|
|
+ // items.brandId = items.brandName
|
|
|
+ // items.brandName = brandName
|
|
|
+
|
|
|
+ // let goodsName = items.goodsId
|
|
|
+ // items.goodsId = items.goodsName
|
|
|
+ // items.goodsName = goodsName
|
|
|
+
|
|
|
+ // })
|
|
|
+ revokeGenerateShipTask(this.form).then(res => {
|
|
|
+ // 将按钮文本更改为"生成任务"
|
|
|
+ this.buttonText = '生成任务';
|
|
|
+ // 将按钮颜色还原为success
|
|
|
+ this.buttonColor = 'success';
|
|
|
+ this.$message.success("撤销出库成功");
|
|
|
+ this.refresh(res.data.data.id)
|
|
|
loading.close();
|
|
|
}).finally(() => {
|
|
|
loading.close();
|
|
@@ -883,29 +1049,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- } else {
|
|
|
- // 将按钮文本更改为"生成任务"
|
|
|
- this.buttonText = '生成任务';
|
|
|
- // 将按钮颜色还原为success
|
|
|
- this.buttonColor = 'success';
|
|
|
- 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)'
|
|
|
- });
|
|
|
- revokeGenerateShipTask(this.form).then(res => {
|
|
|
- this.$message.success("撤销出库成功");
|
|
|
- loading.close();
|
|
|
- }).finally(() => {
|
|
|
- loading.close();
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
|
|
|
}
|
|
|
},
|
|
@@ -932,6 +1075,16 @@ export default {
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
});
|
|
|
+ // this.form.orderItemsList.forEach(its => {
|
|
|
+ // console.log(its.goodsId);
|
|
|
+ // console.log(its.goodsName);
|
|
|
+ // its.brandId = its.brandName
|
|
|
+ // let goodsName = its.goodsId
|
|
|
+ // its.goodsId = its.goodsName
|
|
|
+ // its.goodsName = goodsName
|
|
|
+
|
|
|
+ // })
|
|
|
+
|
|
|
submit({
|
|
|
bsType: "XS",
|
|
|
...this.form
|
|
@@ -956,9 +1109,8 @@ export default {
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
})
|
|
|
getDetails({ id: id }).then(res => {
|
|
|
- console.log('res', res);
|
|
|
this.form = res.data.data
|
|
|
- let ordForm = { srcBillNo: this.form.srcOrdNo }
|
|
|
+ let ordForm = { srcBillNo: this.form.ordNo }
|
|
|
let _this = this
|
|
|
getList(1, 50, ordForm).then((res) => {
|
|
|
this.dataList = res.data.data.records ? res.data.data.records : [];
|
|
@@ -971,7 +1123,7 @@ export default {
|
|
|
if (this.form.status == '退款中') {
|
|
|
this.isConfirmRefundBtn = false;
|
|
|
}
|
|
|
- if(this.form.status == '已取消'){
|
|
|
+ if (this.form.status == '已取消') {
|
|
|
this.isConfirmRefundBtn = true;
|
|
|
}
|
|
|
|
|
@@ -979,21 +1131,37 @@ export default {
|
|
|
|
|
|
// this.isExamineBtn = false;
|
|
|
// }
|
|
|
- if(this.form.generateTask == '已生成'){
|
|
|
+ if (this.form.generateTask == '已生成') {
|
|
|
this.buttonText = '撤销任务';
|
|
|
this.isDisabledTask = false;
|
|
|
- this.buttonColor= 'warning'
|
|
|
+ this.buttonColor = 'warning'
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.form.status == '退款请核' || this.form.status == '退款中') {
|
|
|
this.isRevocationRequest = false;
|
|
|
}
|
|
|
+ //成本、毛利对销售角色隐藏
|
|
|
+ this.optionForm.column.forEach(its => {
|
|
|
+ if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('销售')) {
|
|
|
+ if (its.prop == 'cost' || its.prop == 'grossProfit') {
|
|
|
+ this.$set(its, 'display', false)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
this.form.orderItemsList.forEach((items) => {
|
|
|
if (!items.subTotalMoney) {
|
|
|
items.subTotalMoney = items.goodsNum * items.price
|
|
|
items.grossProfit = items.subTotalMoney - items.costprie
|
|
|
}
|
|
|
+ // let brandName = items.brandId
|
|
|
+ // items.brandId = items.brandName
|
|
|
+ // items.brandName = brandName
|
|
|
+
|
|
|
+ // let goodsName = items.goodsId
|
|
|
+ // items.goodsId = items.goodsName
|
|
|
+ // items.goodsName = goodsName
|
|
|
+
|
|
|
})
|
|
|
loading.close();
|
|
|
|
|
@@ -1052,6 +1220,7 @@ export default {
|
|
|
},
|
|
|
//关闭审核
|
|
|
choceCheckFun() {
|
|
|
+ this.isExamineBtn = !this.isExamineBtn
|
|
|
this.checkDialog = false;
|
|
|
},
|
|
|
//申请退款
|
|
@@ -1064,8 +1233,6 @@ export default {
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done()
|
|
|
if (valid) {
|
|
|
- console.log(this.form);
|
|
|
- console.log(this.$store.getters.domSaleStatus);
|
|
|
const data = {
|
|
|
id: this.form.id,
|
|
|
url: '/tirePartsMall/salesManagement/saleOrder/index',
|
|
@@ -1079,9 +1246,11 @@ export default {
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
});
|
|
|
checkOrder({ ...data }).then((res) => {
|
|
|
- loading.close();
|
|
|
+ this.refresh(res.data.data.id)
|
|
|
this.$message.success('申请退款成功');
|
|
|
this.isApplySettlement = !this.isApplySettlement
|
|
|
+ loading.close();
|
|
|
+ console.log(res);
|
|
|
}).catch(() => { loading.close(); })
|
|
|
}
|
|
|
})
|
|
@@ -1100,6 +1269,17 @@ export default {
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
});
|
|
|
+ // this.form.orderItemsList.forEach((items) => {
|
|
|
+
|
|
|
+ // let brandName = items.brandId
|
|
|
+ // items.brandId = items.brandName
|
|
|
+ // items.brandName = brandName
|
|
|
+
|
|
|
+ // let goodsName = items.goodsId
|
|
|
+ // items.goodsId = items.goodsName
|
|
|
+ // items.goodsName = goodsName
|
|
|
+
|
|
|
+ // })
|
|
|
confirmRefund({ ...this.form }).then((res) => {
|
|
|
loading.close()
|
|
|
this.$message.success('确定退款成功');
|
|
@@ -1108,7 +1288,6 @@ export default {
|
|
|
},
|
|
|
//审批
|
|
|
examineBtn() {
|
|
|
- console.log(this.$route.query.check);
|
|
|
this.checkData = this.$route.query.check
|
|
|
this.checkDialog = true;
|
|
|
},
|
|
@@ -1125,10 +1304,25 @@ export default {
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
});
|
|
|
+ // this.form.orderItemsList.forEach((items) => {
|
|
|
+ // if (!items.subTotalMoney) {
|
|
|
+ // items.subTotalMoney = items.goodsNum * items.price
|
|
|
+ // items.grossProfit = items.subTotalMoney - items.costprie
|
|
|
+ // }
|
|
|
+ // let brandName = items.brandId
|
|
|
+ // items.brandId = items.brandName
|
|
|
+ // items.brandName = brandName
|
|
|
+
|
|
|
+ // let goodsName = items.goodsId
|
|
|
+ // items.goodsId = items.goodsName
|
|
|
+ // items.goodsName = goodsName
|
|
|
+
|
|
|
+ // })
|
|
|
revokeCheckOrder({ ...this.form }).then(res => {
|
|
|
- loading.close();
|
|
|
+ this.isRevocationRequest = !this.isRevocationRequest
|
|
|
+ this.refresh(res.data.data.id)
|
|
|
this.$message.success('撤回成功')
|
|
|
- this.refresh(this.form.id)
|
|
|
+ loading.close();
|
|
|
})
|
|
|
})
|
|
|
},
|
|
@@ -1139,8 +1333,7 @@ export default {
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
if (row.id) {
|
|
|
- console.log(index);
|
|
|
- console.log(this.form.orderItemsList);
|
|
|
+
|
|
|
delOrderItem({ ids: row.id }).then(res => {
|
|
|
this.form.orderItemsList.splice(index, 1);
|
|
|
this.$message.success("操作成功!");
|
|
@@ -1158,6 +1351,18 @@ export default {
|
|
|
rowUpdate(form, index, done, loading) {
|
|
|
done(form)
|
|
|
},
|
|
|
+ // 新增轮胎
|
|
|
+ rowAdd(row) {
|
|
|
+ this.optionContactsBack.column.forEach(its => {
|
|
|
+ if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
|
|
|
+ its.disabled = false
|
|
|
+ } else {
|
|
|
+ its.disabled = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log('新增了', row);
|
|
|
+ this.$refs.formContacts.rowAdd()
|
|
|
+ },
|
|
|
//打印
|
|
|
handlePrint() {
|
|
|
this.switchDialog = !this.switchDialog;
|