|
@@ -17,10 +17,26 @@
|
|
|
<el-button
|
|
|
class="el-button--small-yh"
|
|
|
type="primary"
|
|
|
+ size="small"
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"
|
|
|
+ v-if="form.deliveryStatus == '已到货'"
|
|
|
+ @click="cancelArrival"
|
|
|
+ >撤销到货</el-button>
|
|
|
+ <el-button
|
|
|
+ class="el-button--small-yh"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"
|
|
|
+ v-if="form.deliveryStatus == '已发货'"
|
|
|
+ @click="confirmArrival"
|
|
|
+ >确认到货</el-button>
|
|
|
+ <el-button
|
|
|
+ class="el-button--small-yh"
|
|
|
+ type="primary"
|
|
|
@click="revokeOutGoods"
|
|
|
size="small"
|
|
|
- v-if="form.deliveryStatus !== '录入'"
|
|
|
- :disabled="detailData.seeDisabled"
|
|
|
+ v-if="form.deliveryStatus == '已发货'"
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"
|
|
|
>撤销发货</el-button>
|
|
|
<el-button
|
|
|
class="el-button--small-yh"
|
|
@@ -28,19 +44,19 @@
|
|
|
@click="sendOutGoods"
|
|
|
size="small"
|
|
|
v-if="form.deliveryStatus == '录入'"
|
|
|
- :disabled="detailData.seeDisabled || !form.id"
|
|
|
+ :disabled="detailData.seeDisabled || !form.id || arrivalDisabled"
|
|
|
>确认发货</el-button>
|
|
|
<el-button
|
|
|
class="el-button--small-yh"
|
|
|
size="small"
|
|
|
type="success" @click="copyOrder"
|
|
|
- :disabled="detailData.seeDisabled || !form.id">
|
|
|
+ :disabled="detailData.seeDisabled || !form.id || arrivalDisabled">
|
|
|
复制单据
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
class="el-button--small-yh"
|
|
|
type="primary"
|
|
|
- :disabled="disabled || detailData.seeDisabled"
|
|
|
+ :disabled="disabled || detailData.seeDisabled || arrivalDisabled"
|
|
|
@click="editCustomer(false)"
|
|
|
:loading="saveLoading"
|
|
|
size="small"
|
|
@@ -58,31 +74,31 @@
|
|
|
<!-- <avue-input-tree v-if="item.prop === 'corpsTypeId'" leaf-only multiple :props="{label:'title'}" v-model="form[item.prop]" placeholder="请选择内容" type="tree" :dic="dic"-->
|
|
|
<!-- ></avue-input-tree>-->
|
|
|
<el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]"
|
|
|
- size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" :disabled="item.disabled || detailData.seeDisabled"/>
|
|
|
+ size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled"/>
|
|
|
<el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]"
|
|
|
size="small" type="date" placeholder="选择日期"
|
|
|
- :disabled="detailData.seeDisabled"/>
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"/>
|
|
|
<crop-select
|
|
|
v-else-if="item.prop === 'corpId'"
|
|
|
v-model="form[item.prop]"
|
|
|
corpType="KH"
|
|
|
- :disabled="detailData.seeDisabled"
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"
|
|
|
style="width: 100%"
|
|
|
></crop-select>
|
|
|
<crop-select
|
|
|
v-else-if="item.prop === 'salesCompany'"
|
|
|
v-model="form[item.prop]"
|
|
|
corpType="GS"
|
|
|
- :disabled="detailData.seeDisabled"
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"
|
|
|
></crop-select>
|
|
|
<!-- <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]"-->
|
|
|
<!-- :configuration="configuration" style="width: 100%" :disabled="detailData.seeDisabled"/>-->
|
|
|
<!-- <selectComponent v-else-if="item.prop === 'salesCompany'" v-model="form[item.prop]" typeData="GS"-->
|
|
|
<!-- :configuration="companyConfiguration" style="width: 100%" :disabled="detailData.seeDisabled"/>-->
|
|
|
- <el-select v-else-if="item.prop === 'deliveryStatus'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="item.disabled || detailData.seeDisabled">
|
|
|
+ <el-select v-else-if="item.prop === 'deliveryStatus'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled">
|
|
|
<el-option v-for="(item,index) in statusOption" :key="index" :label="item.dictValue" :value="item.dictValue" size="small"></el-option>
|
|
|
</el-select>
|
|
|
- <el-select v-else-if="item.prop === 'warehouseType'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled">
|
|
|
+ <el-select v-else-if="item.prop === 'warehouseType'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled || arrivalDisabled">
|
|
|
<el-option v-for="(item,index) in warehouseTypeOption" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
|
|
|
</el-select>
|
|
|
<!-- <avue-input-tree-->
|
|
@@ -98,17 +114,17 @@
|
|
|
<!-- >-->
|
|
|
<!-- </avue-input-tree>-->
|
|
|
<warehouse-select v-else-if="item.prop === 'storageId'" v-model="form[item.prop]"
|
|
|
- :configuration="configurationWarehouse" style="width: 100%" :disabled="detailData.seeDisabled"/>
|
|
|
+ :configuration="configurationWarehouse" style="width: 100%" :disabled="detailData.seeDisabled || arrivalDisabled"/>
|
|
|
<el-input
|
|
|
v-else-if="item.type == 'number'"
|
|
|
placeholder="请输入"
|
|
|
v-input-limit="2"
|
|
|
size="small"
|
|
|
- :disabled="item.disabled || detailData.seeDisabled"
|
|
|
+ :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled"
|
|
|
v-model.trim="form[item.prop]"
|
|
|
/>
|
|
|
- <el-input type="textarea" v-else-if="item.type === 'textarea'" v-model.trim="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled"></el-input>
|
|
|
- <el-input type="age" v-else v-model.trim="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled"></el-input>
|
|
|
+ <el-input type="textarea" v-else-if="item.type === 'textarea'" v-model.trim="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled"></el-input>
|
|
|
+ <el-input type="age" v-else v-model.trim="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -128,7 +144,7 @@
|
|
|
:cell-style="goodsRowClassName"
|
|
|
>
|
|
|
<template slot="code" slot-scope="{row,index}">
|
|
|
- <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="commodityChoice(row)" :disabled="detailData.seeDisabled || !row.$cellEdit">选择</el-button>
|
|
|
+ <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="commodityChoice(row)" :disabled="detailData.seeDisabled || !row.$cellEdit || arrivalDisabled">选择</el-button>
|
|
|
<span>{{ row.code }}</span>
|
|
|
</template>
|
|
|
<template slot-scope="{row,index}" slot="menu">
|
|
@@ -136,7 +152,7 @@
|
|
|
type="text"
|
|
|
size="small"
|
|
|
@click="rowCell(row,index)"
|
|
|
- :disabled="detailData.seeDisabled"
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"
|
|
|
>{{ row.$cellEdit ? '保存' : '修改' }}
|
|
|
</el-button>
|
|
|
<el-button
|
|
@@ -144,22 +160,31 @@
|
|
|
icon="el-icon-delete"
|
|
|
type="text"
|
|
|
@click="rowDel(row, index)"
|
|
|
- :disabled="detailData.seeDisabled"
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"
|
|
|
v-if="!row.$cellEdit"
|
|
|
>删 除</el-button>
|
|
|
</template>
|
|
|
<template slot="menuLeft" slot-scope="{size}">
|
|
|
<el-tabs v-model="goodsActives" @tab-click="handleClick">
|
|
|
- <el-tab-pane label="商品" name="goods" :key="'first'" :disabled="goodsDisabled">
|
|
|
+ <el-tab-pane label="商品" name="goods" :key="'first'" :disabled="goodsDisabled || goodsActives == 'goods'">
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="赠品" name="gift" :key="'second'" :disabled="goodsDisabled">
|
|
|
+ <el-tab-pane label="赠品" name="gift" :key="'second'" :disabled="goodsDisabled || goodsActives == 'gift'">
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
<el-button type="primary"
|
|
|
icon="el-icon-plus"
|
|
|
size="small"
|
|
|
@click="marketDialog = true"
|
|
|
- :disabled="detailData.seeDisabled"
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"
|
|
|
+ v-if="goodsActives == 'goods'"
|
|
|
+ >录入明细
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="small"
|
|
|
+ @click="commoditySelection"
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"
|
|
|
+ v-if="goodsActives == 'gift'"
|
|
|
>录入明细
|
|
|
</el-button>
|
|
|
<el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
|
|
@@ -167,7 +192,7 @@
|
|
|
type="warning"
|
|
|
icon="el-icon-refresh"
|
|
|
size="small"
|
|
|
- :disabled="detailData.seeDisabled"
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"
|
|
|
@click="resetStock"
|
|
|
>库存刷新</el-button>
|
|
|
</template>
|
|
@@ -180,6 +205,16 @@
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.actualQuantity }}</span>
|
|
|
</template>
|
|
|
+<!-- 到货数量-->
|
|
|
+ <template slot="arrivalQuantity" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model.trim="row.arrivalQuantity"
|
|
|
+ v-input-limit="0"
|
|
|
+ @change="arrivalQuantityChange(row)"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.arrivalQuantity }}</span>
|
|
|
+ </template>
|
|
|
<template slot="corpId" slot-scope="{ row, index }">
|
|
|
<crop-select
|
|
|
v-if="row.$cellEdit"
|
|
@@ -187,7 +222,7 @@
|
|
|
:cropIndex="index"
|
|
|
corpType="GYS"
|
|
|
@getCorpData="getcorpId"
|
|
|
- :disabled="detailData.seeDisabled"
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"
|
|
|
></crop-select>
|
|
|
<span v-else>{{ row.corpName }}</span>
|
|
|
</template>
|
|
@@ -196,7 +231,7 @@
|
|
|
<fee-info
|
|
|
ref="feeInfo"
|
|
|
:orderFeesList="advantageProjectData"
|
|
|
- :disabled="detailData.seeDisabled"
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"
|
|
|
feeUrl="/blade-deliver-goods/deliveryfees/update"
|
|
|
/>
|
|
|
<!-- <containerTitle title="费用明细"></containerTitle>-->
|
|
@@ -280,7 +315,7 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="small"
|
|
|
@click.stop="$refs.uploadCrud.rowAdd()"
|
|
|
- :disabled="detailData.seeDisabled"
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"
|
|
|
>上传</el-button
|
|
|
>
|
|
|
</template>
|
|
@@ -290,7 +325,7 @@
|
|
|
icon="el-icon-edit"
|
|
|
type="text"
|
|
|
@click="$refs.uploadCrud.rowEdit(row, index)"
|
|
|
- :disabled="detailData.seeDisabled"
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"
|
|
|
>编 辑</el-button
|
|
|
>
|
|
|
<el-button
|
|
@@ -298,7 +333,7 @@
|
|
|
icon="el-icon-delete"
|
|
|
type="text"
|
|
|
@click="rowDelBankOfDeposit(row, index)"
|
|
|
- :disabled="detailData.seeDisabled"
|
|
|
+ :disabled="detailData.seeDisabled || arrivalDisabled"
|
|
|
>删 除</el-button
|
|
|
>
|
|
|
</template>
|
|
@@ -420,7 +455,9 @@ import {
|
|
|
corpsitem,
|
|
|
getList,
|
|
|
sendOutGoods,
|
|
|
- revokeOutGoods
|
|
|
+ revokeOutGoods,
|
|
|
+ confirmArrival,
|
|
|
+ cancelArrival
|
|
|
} from "@/api/basicData/deliveryNotice"
|
|
|
import customerContact from "./configuration/customerContact.json"
|
|
|
import advantageProject from "./configuration/advantageProject.json"
|
|
@@ -729,6 +766,28 @@ export default {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
+ },{
|
|
|
+ label: '赠送积分',
|
|
|
+ prop: 'presenterIntegral',
|
|
|
+ disabled: true,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: false,
|
|
|
+ message: ' ',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },{
|
|
|
+ label: '兑换积分',
|
|
|
+ prop: 'convertIntegral',
|
|
|
+ disabled: true,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: false,
|
|
|
+ message: ' ',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
}, {
|
|
|
label: "备注",
|
|
|
span: 24,
|
|
@@ -766,6 +825,10 @@ export default {
|
|
|
giftData: [],
|
|
|
// 商品信息展示数据
|
|
|
goodsShowData: [],
|
|
|
+ // 确认收货禁用
|
|
|
+ deliverDisabled: false,
|
|
|
+ // 确认到货禁用
|
|
|
+ arrivalDisabled: false,
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -788,7 +851,8 @@ export default {
|
|
|
this.warehouseTypeOption = res.data.data
|
|
|
})
|
|
|
this.$set(this.form,'deliveryStatus','录入')
|
|
|
- this.$set(this.oldForm,'deliveryStatus','录入')
|
|
|
+ this.$set(this.form, 'presenterIntegral' , 0)
|
|
|
+ this.$set(this.form, 'convertIntegral' , 0)
|
|
|
wareHouseType().then(res => {
|
|
|
this.warehouseType = res.data.data.records
|
|
|
this.warehouseType.forEach(item => {
|
|
@@ -817,7 +881,6 @@ export default {
|
|
|
this.warehouseType = result
|
|
|
});
|
|
|
selectWareHouse().then(res => {
|
|
|
- console.log(res)
|
|
|
this.warehouseName = res.data.data.records
|
|
|
})
|
|
|
if (this.detailData.id) {
|
|
@@ -828,6 +891,9 @@ export default {
|
|
|
delete this.form.createTime
|
|
|
delete this.form.id
|
|
|
delete this.form.sysNo
|
|
|
+ this.form.orderItemsList.forEach(item => {
|
|
|
+ this.$set(item, 'contractNumber', this.form.orgOrderNo)
|
|
|
+ })
|
|
|
this.contactsData = this.form.orderItemsList.filter(item => {
|
|
|
return item.goodType == 0
|
|
|
})
|
|
@@ -838,6 +904,7 @@ export default {
|
|
|
this.$set(item, 'deliveryAmount', item.amount)
|
|
|
this.$set(item, 'specificationAndModel', item.itemType)
|
|
|
this.$set(item, 'orgOrderNo', this.form.orgOrderNo)
|
|
|
+ this.$set(item, 'srcOrderNo', this.form.srcOrderNo)
|
|
|
this.$set(item, "srcId", item.id)
|
|
|
delete item.id
|
|
|
delete item.pid
|
|
@@ -882,6 +949,7 @@ export default {
|
|
|
this.contactsData.forEach(item => {
|
|
|
this.$set(item, 'specificationAndModel', item.itemType)
|
|
|
this.$set(item, 'orgOrderNo', this.form.orgOrderNo)
|
|
|
+ this.$set(item, 'srcOrderNo', this.form.srcOrderNo)
|
|
|
this.$set(item, "srcId", item.id)
|
|
|
this.$set(item, "actualQuantity", (Number(item.orderQuantity) - Number(item.actualQuantity)))
|
|
|
this.$set(item, "deliveryAmount", item.amount)
|
|
@@ -904,13 +972,24 @@ export default {
|
|
|
let id = this.detailData.copyId
|
|
|
this.queryData(id, true)
|
|
|
}
|
|
|
+ this.oldForm = Object.assign({}, this.form)
|
|
|
},
|
|
|
watch: {
|
|
|
},
|
|
|
methods: {
|
|
|
- queryData(id, isCopy = false) {
|
|
|
+ queryData(id, isCopy = false, type) {
|
|
|
detail(id).then(res => {
|
|
|
this.form = res.data.data;
|
|
|
+ if (this.form.deliveryStatus == '已发货') {
|
|
|
+ this.deliverDisabled = true;
|
|
|
+ this.arrivalDisabled = false;
|
|
|
+ } else if (this.form.deliveryStatus == '已到货') {
|
|
|
+ this.arrivalDisabled = true;
|
|
|
+ this.deliverDisabled = false;
|
|
|
+ } else {
|
|
|
+ this.arrivalDisabled = false;
|
|
|
+ this.deliverDisabled = false;
|
|
|
+ }
|
|
|
// this.contactsData = this.form.deliveryItemsList
|
|
|
this.contactsData = this.form.deliveryItemsList.filter(item => {
|
|
|
return item.goodType == 0
|
|
@@ -984,7 +1063,7 @@ export default {
|
|
|
this.oldFeesList = []
|
|
|
this.oldUploadList = []
|
|
|
this.oldForm = Object.assign({}, this.form)
|
|
|
- this.oldGoodsList = this.deepClone(this.contactsData)
|
|
|
+ this.oldGoodsList = this.deepClone(this.goodsShowData)
|
|
|
this.oldFeesList = this.deepClone(this.advantageProjectData)
|
|
|
this.oldUploadList = this.deepClone(this.bankOfDepositData)
|
|
|
if (isCopy) {
|
|
@@ -1004,6 +1083,36 @@ export default {
|
|
|
})
|
|
|
this.form.deliveryStatus == '录入'
|
|
|
}
|
|
|
+ if (type == '发货') {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.form.deliveryItemsList = this.contactsData.concat(this.giftData)
|
|
|
+ this.form.deliveryFeesList = this.advantageProjectData
|
|
|
+ this.form.deliveryFilesList = this.bankOfDepositData
|
|
|
+ if (typeof this.form.corpsTypeId == 'object') {
|
|
|
+ this.form.corpsTypeId = this.form.corpsTypeId.join(",")
|
|
|
+ }
|
|
|
+ this.pageLoading = true
|
|
|
+ sendOutGoods(this.form).then(res => {
|
|
|
+ this.$message.success('发货成功')
|
|
|
+ this.queryData(res.data.data.id)
|
|
|
+ }).finally(() => {
|
|
|
+ this.pageLoading = false
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else if (type == '到货') {
|
|
|
+ if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
|
|
|
+ this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
|
|
|
+ } else {
|
|
|
+ this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
|
|
|
+ }
|
|
|
+ this.pageLoading = true
|
|
|
+ confirmArrival(this.form).then(res => {
|
|
|
+ this.$message.success('已确认到货')
|
|
|
+ this.queryData(this.form.id)
|
|
|
+ }).catch(() => {
|
|
|
+ this.pageLoading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
}).finally(() => {
|
|
|
this.saveLoading = false
|
|
|
});
|
|
@@ -1014,15 +1123,35 @@ export default {
|
|
|
},
|
|
|
// 出库数量变化时调用
|
|
|
actualQuantityChange(row) {
|
|
|
- if (row.scale) {
|
|
|
- row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
|
|
|
+ // if (row.scale) {
|
|
|
+ // row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
|
|
|
+ // }
|
|
|
+ if (this.goodsActives == 'goods') {
|
|
|
+ row.deliveryAmount = Number(row.actualQuantity) * Number(row.price)
|
|
|
+ this.form.deliveryAmount = 0
|
|
|
+ this.form.totalQuantity = 0
|
|
|
+ this.contactsData.forEach(item => {
|
|
|
+ this.form.deliveryAmount += Number(item.deliveryAmount)
|
|
|
+ this.form.totalQuantity += Number(item.actualQuantity)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ row.integral = Number(row.integralMultiples) * Number(row.actualQuantity)
|
|
|
+ this.$set(this.form, 'convertIntegral' , 0)
|
|
|
+ this.goodsShowData.forEach(item => {
|
|
|
+ this.form.convertIntegral = (Number(this.form.convertIntegral) + Number(item.integral)).toFixed(2)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 到货数量变化计算
|
|
|
+ arrivalQuantityChange(row) {
|
|
|
+ if (this.goodsActives == 'goods') {
|
|
|
+ row.integral = Number(row.integralMultiples) * Number(row.arrivalQuantity)
|
|
|
+ this.$set(this.form, 'presenterIntegral' , 0)
|
|
|
+ this.goodsShowData.forEach(item => {
|
|
|
+ this.form.presenterIntegral = (Number(this.form.presenterIntegral) + Number(item.integral)).toFixed(2)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
}
|
|
|
- this.form.deliveryAmount = 0
|
|
|
- this.form.totalQuantity = 0
|
|
|
- this.contactsData.forEach(item => {
|
|
|
- this.form.deliveryAmount += Number(item.deliveryAmount)
|
|
|
- this.form.totalQuantity += Number(item.actualQuantity)
|
|
|
- })
|
|
|
},
|
|
|
// 类别变换时触发
|
|
|
warehouseTreeChange(id) {
|
|
@@ -1153,10 +1282,14 @@ export default {
|
|
|
this.$set(this.tableData[item], 'deliveryAmount', 0)
|
|
|
this.tableData[item].price = 0
|
|
|
this.tableData[item].amount = 0
|
|
|
+ if (this.goodsActives == "goods") {
|
|
|
+ this.$set(this.tableData[item], 'goodType', 0)
|
|
|
+ } else {
|
|
|
+ this.$set(this.tableData[item], 'goodType', 1)
|
|
|
+ }
|
|
|
this.tableData[item].sort = this.maxGoodsNum + 1
|
|
|
this.maxGoodsNum++
|
|
|
this.$refs.crudContact.rowCellAdd(this.tableData[item]);
|
|
|
- console.log(this.contactsData)
|
|
|
this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
|
|
|
})
|
|
|
}
|
|
@@ -1230,14 +1363,14 @@ export default {
|
|
|
type: "success",
|
|
|
message: "操作成功!"
|
|
|
});
|
|
|
- this.contactsData.splice(index, 1);
|
|
|
+ this.goodsShowData.splice(index, 1);
|
|
|
})
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
message: "操作成功!"
|
|
|
});
|
|
|
- this.contactsData.splice(index, 1);
|
|
|
+ this.goodsShowData.splice(index, 1);
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -1377,6 +1510,16 @@ export default {
|
|
|
this.contactsData.forEach(item => {
|
|
|
this.$set(item, 'contractAmount', item.deliveryAmount)
|
|
|
})
|
|
|
+ if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
|
|
|
+ this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
|
|
|
+ } else {
|
|
|
+ this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
|
|
|
+ }
|
|
|
+ this.form.deliveryItemsList.forEach(item => {
|
|
|
+ this.$set(item, 'contractNumber', item.orderNo)
|
|
|
+ this.$set(item, 'srcOrderNo', item.orderNo)
|
|
|
+ this.$set(item, 'contractAmount', item.deliveryAmount)
|
|
|
+ })
|
|
|
this.form.deliveryItemsList = this.contactsData.concat(this.giftData)
|
|
|
this.form.deliveryFeesList = this.advantageProjectData
|
|
|
this.form.deliveryFilesList = this.bankOfDepositData
|
|
@@ -1392,24 +1535,7 @@ export default {
|
|
|
//成功关闭此页面回到列表页
|
|
|
this.$emit("goBack");
|
|
|
} else {
|
|
|
- this.queryData(res.data.data.id)
|
|
|
- }
|
|
|
- if (type == '发货') {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.form.deliveryItemsList = this.contactsData.concat(this.giftData)
|
|
|
- this.form.deliveryFeesList = this.advantageProjectData
|
|
|
- this.form.deliveryFilesList = this.bankOfDepositData
|
|
|
- if (typeof this.form.corpsTypeId == 'object') {
|
|
|
- this.form.corpsTypeId = this.form.corpsTypeId.join(",")
|
|
|
- }
|
|
|
- this.pageLoading = true
|
|
|
- sendOutGoods(this.form).then(res => {
|
|
|
- this.$message.success('发货成功')
|
|
|
- this.queryData(res.data.data.id)
|
|
|
- }).finally(() => {
|
|
|
- this.pageLoading = false
|
|
|
- })
|
|
|
- })
|
|
|
+ this.queryData(res.data.data.id, false, type)
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
this.saveLoading = false
|
|
@@ -1426,7 +1552,7 @@ export default {
|
|
|
//返回列表
|
|
|
backToList() {
|
|
|
if (contrastObj(this.form, this.oldForm) ||
|
|
|
- contrastList(this.contactsData, this.oldGoodsList) ||
|
|
|
+ contrastList(this.goodsShowData, this.oldGoodsList) ||
|
|
|
contrastList(this.advantageProjectData, this.oldFeesList) ||
|
|
|
contrastList(this.bankOfDepositData, this.oldUploadList)
|
|
|
) {
|
|
@@ -1451,7 +1577,7 @@ export default {
|
|
|
return this.$message.error('商品信息为空')
|
|
|
}
|
|
|
if (contrastObj(this.form, this.oldForm) ||
|
|
|
- contrastList(this.contactsData, this.oldGoodsList) ||
|
|
|
+ contrastList(this.goodsShowData, this.oldGoodsList) ||
|
|
|
contrastList(this.advantageProjectData, this.oldFeesList) ||
|
|
|
contrastList(this.bankOfDepositData, this.oldUploadList)
|
|
|
) {
|
|
@@ -1466,7 +1592,11 @@ export default {
|
|
|
})
|
|
|
} else {
|
|
|
//商品信息
|
|
|
- this.form.deliveryItemsList = this.contactsData.concat(this.giftData)
|
|
|
+ if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
|
|
|
+ this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
|
|
|
+ } else {
|
|
|
+ this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
|
|
|
+ }
|
|
|
this.form.deliveryFeesList = this.advantageProjectData
|
|
|
this.form.deliveryFilesList = this.bankOfDepositData
|
|
|
if (typeof this.form.corpsTypeId == 'object') {
|
|
@@ -1508,6 +1638,52 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // 确认到货
|
|
|
+ confirmArrival() {
|
|
|
+ if (contrastObj(this.form, this.oldForm) ||
|
|
|
+ contrastList(this.goodsShowData, this.oldGoodsList) ||
|
|
|
+ contrastList(this.advantageProjectData, this.oldFeesList) ||
|
|
|
+ contrastList(this.bankOfDepositData, this.oldUploadList)
|
|
|
+ ) {
|
|
|
+ this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.editCustomer(false, '到货')
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.info('已取消')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
|
|
|
+ this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
|
|
|
+ } else {
|
|
|
+ this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
|
|
|
+ }
|
|
|
+ this.pageLoading = true
|
|
|
+ confirmArrival(this.form).then(res => {
|
|
|
+ this.$message.success('已确认到货')
|
|
|
+ this.queryData(this.form.id)
|
|
|
+ }).catch(() => {
|
|
|
+ this.pageLoading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 撤销到货
|
|
|
+ cancelArrival() {
|
|
|
+ if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
|
|
|
+ this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
|
|
|
+ } else {
|
|
|
+ this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
|
|
|
+ }
|
|
|
+ this.pageLoading = true
|
|
|
+ cancelArrival(this.form).then(res => {
|
|
|
+ this.$message.success('撤销到货成功')
|
|
|
+ this.queryData(this.form.id)
|
|
|
+ }).catch(() => {
|
|
|
+ this.pageLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
// 导入销售明细
|
|
|
importMarket(list) {
|
|
|
list.forEach(item => {
|
|
@@ -1520,13 +1696,22 @@ export default {
|
|
|
}
|
|
|
this.$set(item, 'actualQuantity', item.orderQuantity)
|
|
|
this.$set(item, 'inventoryNumber', item.storageQuantity)
|
|
|
+ this.$set(item, 'integral', 0)
|
|
|
+ this.$set(item, 'arrivalQuantity', 0)
|
|
|
+ this.$set(item, 'orgOrderNo', this.form.orgOrderNo)
|
|
|
+ this.$set(item, 'srcOrderNo', this.form.srcOrderNo)
|
|
|
+ this.$set(item, "srcId", item.id)
|
|
|
+ if (this.goodsActives == "goods") {
|
|
|
+ this.$set(item, 'goodType', 0)
|
|
|
+ } else {
|
|
|
+ this.$set(item, 'goodType', 1)
|
|
|
+ }
|
|
|
delete item.id
|
|
|
delete item.createTime
|
|
|
delete item.createUser
|
|
|
delete item.pid
|
|
|
this.$refs.crudContact.rowCellAdd(item);
|
|
|
})
|
|
|
- console.log(this.contactsData)
|
|
|
this.marketDialog = false;
|
|
|
},
|
|
|
// 关闭销售弹窗
|
|
@@ -1589,11 +1774,13 @@ export default {
|
|
|
this.giftData = this.goodsShowData
|
|
|
// 显示
|
|
|
this.customerContact.column.forEach(item => {
|
|
|
- if (item.prop == 'deliveryAmount') item.label = '出库金额'
|
|
|
+ if (item.prop == 'integralMultiples') item.label = '积分倍数'
|
|
|
+ if (item.prop == 'integral') item.label = '赠送积分'
|
|
|
if (item.prop == 'actualQuantity') item.label = '出库数量'
|
|
|
if (item.prop == 'priceType' || item.prop == 'code' || item.prop == 'typeno' || item.prop == 'corpId'
|
|
|
|| item.prop == 'packageRemarks' || item.prop == 'invoiceWeight'
|
|
|
|| item.prop == 'inventoryNumber' || item.prop == 'inventoryAmount'
|
|
|
+ || item.prop == 'arrivalQuantity'
|
|
|
) {
|
|
|
item.hide = false;
|
|
|
item.showColumn = true;
|
|
@@ -1607,11 +1794,12 @@ export default {
|
|
|
// 隐藏字段
|
|
|
this.contactsData = this.goodsShowData
|
|
|
this.customerContact.column.forEach(item => {
|
|
|
- if (item.prop == 'deliveryAmount') item.label = '积分'
|
|
|
+ if (item.prop == 'integralMultiples') item.label = '积分单价'
|
|
|
+ if (item.prop == 'integral') item.label = '兑换积分'
|
|
|
if (item.prop == 'actualQuantity') item.label = '数量'
|
|
|
if (item.prop == 'priceType' || item.prop == 'code' || item.prop == 'typeno' || item.prop == 'corpId'
|
|
|
|| item.prop == 'packageRemarks' || item.prop == 'invoiceWeight' || item.prop == 'inventoryNumber'
|
|
|
- || item.prop == 'inventoryAmount'
|
|
|
+ || item.prop == 'inventoryAmount' || item.prop == 'arrivalQuantity'
|
|
|
) {
|
|
|
item.hide = true;
|
|
|
item.showColumn = false;
|