|
@@ -10,9 +10,31 @@
|
|
width="60%">
|
|
width="60%">
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
<div class="common-main">
|
|
<div class="common-main">
|
|
- <a-alert type="info" v-if="detail.length" style="margin-bottom:10px">
|
|
+ <div style="display:flex;margin-bottom:10px;align-items: center;">
|
|
- <div slot="message">{{ customeName }},共 {{ detail && detail.length }} 个出库单,产品款数合计 <span>{{ productTotal&&productTotal.totalCategory }}</span> ,产品数量合计 <span>{{ productTotal&&productTotal.totalQty }}</span>。</div>
|
|
+ <a-button @click="showGlModal=true" type="primary" class="button-info" ghost v-if="isEdit">选择关联单据</a-button>
|
|
- </a-alert>
|
|
+ <div style="padding:0 15px;" v-if="sendBillStockOutList.length">
|
|
|
|
+ <div>{{ customeName }},共 {{ sendBillStockOutList && sendBillStockOutList.length }} 个出库单,产品款数合计 <span>{{ productTotal&&productTotal.totalCategory }}</span> ,产品数量合计 <span>{{ productTotal&&productTotal.totalQty }}</span>。</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div style="margin-bottom:10px;" v-if="isEdit">
|
|
|
|
+ <a-table :columns="glColumns" :pagination="false" :scroll="{ y: 200 }" :data-source="sendBillStockOutList" bordered>
|
|
|
|
+ <!-- 客户名称 -->
|
|
|
|
+ <template slot="buyerName" slot-scope="text, record">
|
|
|
|
+ {{ record.buyerName || record.demanderName }}
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 操作 -->
|
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-error"
|
|
|
|
+ @click="delStockOutList(record)"
|
|
|
|
+ >
|
|
|
|
+ 删除
|
|
|
|
+ </a-button>
|
|
|
|
+ </template>
|
|
|
|
+ </a-table>
|
|
|
|
+ </div>
|
|
<div class="toolsBar">
|
|
<div class="toolsBar">
|
|
<a-form-model
|
|
<a-form-model
|
|
ref="ruleForm"
|
|
ref="ruleForm"
|
|
@@ -22,42 +44,42 @@
|
|
:wrapper-col="formItemLayout.wrapperCol"
|
|
:wrapper-col="formItemLayout.wrapperCol"
|
|
>
|
|
>
|
|
<a-row>
|
|
<a-row>
|
|
- <a-col span="12">
|
|
+ <a-col span="8">
|
|
<a-form-model-item label="托运日期" prop="sendDate">
|
|
<a-form-model-item label="托运日期" prop="sendDate">
|
|
<a-date-picker :allowClear="false" inputReadOnly v-model="form.sendDate" :locale="locale"/>
|
|
<a-date-picker :allowClear="false" inputReadOnly v-model="form.sendDate" :locale="locale"/>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col span="12">
|
|
+ <a-col span="8">
|
|
- <a-form-model-item label="目的地">
|
|
|
|
- <a-input placeholder="请输入目的地(最多30字符)" :maxLength="30" v-model.trim="form.customerAddress"></a-input>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col span="12">
|
|
|
|
<a-form-model-item label="收货人" prop="customerCacateName">
|
|
<a-form-model-item label="收货人" prop="customerCacateName">
|
|
<a-input placeholder="请输入收货人(最多30字符)" :maxLength="30" v-model.trim="form.customerCacateName"></a-input>
|
|
<a-input placeholder="请输入收货人(最多30字符)" :maxLength="30" v-model.trim="form.customerCacateName"></a-input>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col span="12">
|
|
+ <a-col span="8">
|
|
<a-form-model-item label="电话" prop="customerCacatePhone">
|
|
<a-form-model-item label="电话" prop="customerCacatePhone">
|
|
<a-input placeholder="请输入电话" :maxLength="30" v-model.trim="form.customerCacatePhone"></a-input>
|
|
<a-input placeholder="请输入电话" :maxLength="30" v-model.trim="form.customerCacatePhone"></a-input>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col span="24">
|
|
<a-col span="24">
|
|
- <a-form-model-item label="详细地址" prop="customerAddressDetail" :label-col="{span:3}" :wrapper-col="{span:19}">
|
|
+ <a-form-model-item label="详细地址" prop="customerAddressDetail" :label-col="{span:2}" :wrapper-col="{span:21}">
|
|
<a-textarea placeholder="请输入详细地址(最多300字符)" :maxLength="300" v-model.trim="form.customerAddressDetail"></a-textarea>
|
|
<a-textarea placeholder="请输入详细地址(最多300字符)" :maxLength="300" v-model.trim="form.customerAddressDetail"></a-textarea>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col span="12">
|
|
+ <a-col span="8">
|
|
|
|
+ <a-form-model-item label="目的地">
|
|
|
|
+ <a-input placeholder="请输入目的地(最多30字符)" :maxLength="30" v-model.trim="form.customerAddress"></a-input>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col span="8">
|
|
<a-form-model-item label="物流电话" prop="transportTele">
|
|
<a-form-model-item label="物流电话" prop="transportTele">
|
|
<a-input placeholder="请输入物流电话" :maxLength="30" v-model.trim="form.transportTele"></a-input>
|
|
<a-input placeholder="请输入物流电话" :maxLength="30" v-model.trim="form.transportTele"></a-input>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col span="12">
|
|
+ <a-col span="8">
|
|
<a-form-model-item label="物流单号" prop="transportNo">
|
|
<a-form-model-item label="物流单号" prop="transportNo">
|
|
<a-input placeholder="请输入物流单号" :maxLength="30" v-model.trim="form.transportNo"></a-input>
|
|
<a-input placeholder="请输入物流单号" :maxLength="30" v-model.trim="form.transportNo"></a-input>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col span="12">
|
|
+ <a-col span="8">
|
|
<a-form-model-item label="付款方式">
|
|
<a-form-model-item label="付款方式">
|
|
<v-select
|
|
<v-select
|
|
v-model="form.payType"
|
|
v-model="form.payType"
|
|
@@ -67,7 +89,7 @@
|
|
allowClear></v-select>
|
|
allowClear></v-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col span="12">
|
|
+ <a-col span="8">
|
|
<a-form-model-item label="交货方式">
|
|
<a-form-model-item label="交货方式">
|
|
<v-select
|
|
<v-select
|
|
v-model="form.handoverType"
|
|
v-model="form.handoverType"
|
|
@@ -77,7 +99,7 @@
|
|
allowClear></v-select>
|
|
allowClear></v-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col span="12">
|
|
+ <a-col span="8">
|
|
<a-form-model-item label="运费合计">
|
|
<a-form-model-item label="运费合计">
|
|
<!-- <a-input disabled placeholder="请输入运费合计" v-model.trim="form.totalSendAmount"></a-input> -->
|
|
<!-- <a-input disabled placeholder="请输入运费合计" v-model.trim="form.totalSendAmount"></a-input> -->
|
|
{{ form.totalSendAmount||'--' }}
|
|
{{ form.totalSendAmount||'--' }}
|
|
@@ -104,7 +126,7 @@
|
|
</template>
|
|
</template>
|
|
<!-- 数量 -->
|
|
<!-- 数量 -->
|
|
<template slot="qty" slot-scope="text, record">
|
|
<template slot="qty" slot-scope="text, record">
|
|
- <a-input-number style="width: 100%;" :precision="0" v-model="record.goodsQty" :min="0" :max="999999"></a-input-number>
|
|
+ <a-input-number style="width: 100%;" :precision="0" v-model="record.goodsQty" :min="1" :max="999999"></a-input-number>
|
|
</template>
|
|
</template>
|
|
<!-- 体积 -->
|
|
<!-- 体积 -->
|
|
<template slot="volume" slot-scope="text, record">
|
|
<template slot="volume" slot-scope="text, record">
|
|
@@ -170,10 +192,18 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="btn-box">
|
|
<div class="btn-box">
|
|
- <a-button @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
|
|
+ <a-button size="large" @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
|
|
- <a-button type="primary" @click="handleCommonOk">{{ okText }}</a-button>
|
|
+ <a-button size="large" type="primary" @click="handleCommonOk">{{ okText }}</a-button>
|
|
</div>
|
|
</div>
|
|
</a-spin>
|
|
</a-spin>
|
|
|
|
+ <!-- 关联单据 -->
|
|
|
|
+ <selectGlOrderModal
|
|
|
|
+ ref="selGlModal"
|
|
|
|
+ modalTit="选择关联单据"
|
|
|
|
+ :chooseData="sendBillStockOutList"
|
|
|
|
+ :openModal="showGlModal"
|
|
|
|
+ @choose="getProductTotal"
|
|
|
|
+ @cancel="showGlModal=false"></selectGlOrderModal>
|
|
</a-modal>
|
|
</a-modal>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -181,10 +211,11 @@
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
import locale from 'ant-design-vue/es/date-picker/locale/zh_CN'
|
|
import locale from 'ant-design-vue/es/date-picker/locale/zh_CN'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
-import { sendBillInsert, sendBillFindBySn, sendBillUpdate } from '@/api/sendBill'
|
|
+import selectGlOrderModal from './selectGlOrderModal.vue'
|
|
|
|
+import { sendBillInsert, sendBillFindBySn, sendBillUpdate, deleteSendBillStockOut } from '@/api/sendBill'
|
|
export default {
|
|
export default {
|
|
name: 'SendGoodModal',
|
|
name: 'SendGoodModal',
|
|
- components: { STable, VSelect },
|
|
+ components: { STable, VSelect, selectGlOrderModal },
|
|
props: {
|
|
props: {
|
|
openModal: { // 弹框显示状态
|
|
openModal: { // 弹框显示状态
|
|
type: Boolean,
|
|
type: Boolean,
|
|
@@ -213,6 +244,7 @@ export default {
|
|
isShow: this.openModal, // 是否打开弹框
|
|
isShow: this.openModal, // 是否打开弹框
|
|
disabled: false,
|
|
disabled: false,
|
|
spinning: false,
|
|
spinning: false,
|
|
|
|
+ showGlModal: false,
|
|
form: {
|
|
form: {
|
|
'stockOutSnList': [], // 出库单列表
|
|
'stockOutSnList': [], // 出库单列表
|
|
'sendDate': moment(), // 托运时间
|
|
'sendDate': moment(), // 托运时间
|
|
@@ -237,7 +269,21 @@ export default {
|
|
labelCol: { span: 6 },
|
|
labelCol: { span: 6 },
|
|
wrapperCol: { span: 15 }
|
|
wrapperCol: { span: 15 }
|
|
},
|
|
},
|
|
- detail: [],
|
|
+ sendBillStockOutList: [],
|
|
|
|
+ glColumns: [
|
|
|
|
+ { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text } },
|
|
|
|
+ { title: '出库单号', dataIndex: 'stockOutNo', width: '10%', align: 'center' },
|
|
|
|
+ { title: '业务单号', dataIndex: 'outBizSubNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '出库类型', dataIndex: 'outBizTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '发货编号', dataIndex: 'sendNo', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '客户名称', scopedSlots: { customRender: 'buyerName' }, width: '12%', align: 'center', ellipsis: true },
|
|
|
|
+ { title: '收货客户名称', dataIndex: 'receiverName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '产品款数', dataIndex: 'productTotalCategory', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '产品数量', dataIndex: 'productTotalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '单据审核时间', dataIndex: 'auditTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '收款时间', dataIndex: 'settleTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
|
|
|
|
+ ],
|
|
productTotal: null,
|
|
productTotal: null,
|
|
tableData: [],
|
|
tableData: [],
|
|
columns: [
|
|
columns: [
|
|
@@ -261,7 +307,7 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
// 新增,出库单和收货人信息
|
|
// 新增,出库单和收货人信息
|
|
setData (data, customeInfo) {
|
|
setData (data, customeInfo) {
|
|
- this.detail = data
|
|
+ this.sendBillStockOutList = data
|
|
this.customeName = data[0].demanderName
|
|
this.customeName = data[0].demanderName
|
|
this.isEdit = false
|
|
this.isEdit = false
|
|
this.getProductTotal()
|
|
this.getProductTotal()
|
|
@@ -271,6 +317,25 @@ export default {
|
|
this.form.customerAddressDetail = customeInfo.addr
|
|
this.form.customerAddressDetail = customeInfo.addr
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 删除出库单
|
|
|
|
+ delStockOutList (row) {
|
|
|
|
+ const ri = this.sendBillStockOutList.findIndex(item => row.stockOutSn == item.stockOutSn)
|
|
|
|
+ // 新加的
|
|
|
|
+ if (row.id) {
|
|
|
|
+ this.sendBillStockOutList.splice(ri, 1)
|
|
|
|
+ this.getProductTotal()
|
|
|
|
+ } else {
|
|
|
|
+ // 删除后修改发货状态
|
|
|
|
+ this.spinning = true
|
|
|
|
+ deleteSendBillStockOut({ stockOutSn: row.stockOutSn, sendBillSn: this.form.sendBillSn }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.sendBillStockOutList.splice(ri, 1)
|
|
|
|
+ this.getProductTotal()
|
|
|
|
+ }
|
|
|
|
+ this.spinning = false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 编辑
|
|
// 编辑
|
|
getDetail (data) {
|
|
getDetail (data) {
|
|
this.spinning = true
|
|
this.spinning = true
|
|
@@ -280,7 +345,7 @@ export default {
|
|
console.log(res)
|
|
console.log(res)
|
|
this.spinning = false
|
|
this.spinning = false
|
|
if (res.data) {
|
|
if (res.data) {
|
|
- this.detail = res.data.sendBillStockOutList // 出库单
|
|
+ this.sendBillStockOutList = res.data.sendBillStockOutList // 出库单
|
|
this.tableData = res.data.detailList // 发货明细
|
|
this.tableData = res.data.detailList // 发货明细
|
|
this.tableData.map((item, i) => {
|
|
this.tableData.map((item, i) => {
|
|
item.no = i + 1
|
|
item.no = i + 1
|
|
@@ -310,19 +375,21 @@ export default {
|
|
totalQty: 0
|
|
totalQty: 0
|
|
}
|
|
}
|
|
const stockOutSnList = []
|
|
const stockOutSnList = []
|
|
- this.detail.map(item => {
|
|
+ this.sendBillStockOutList.map((item, index) => {
|
|
|
|
+ item.no = index + 1
|
|
ret.totalCategory = ret.totalCategory + item.productTotalCategory
|
|
ret.totalCategory = ret.totalCategory + item.productTotalCategory
|
|
ret.totalQty = ret.totalQty + item.productTotalQty
|
|
ret.totalQty = ret.totalQty + item.productTotalQty
|
|
stockOutSnList.push(item.stockOutSn)
|
|
stockOutSnList.push(item.stockOutSn)
|
|
})
|
|
})
|
|
// 编辑时不需要传
|
|
// 编辑时不需要传
|
|
- this.form.stockOutSnList = this.isEdit ? [] : stockOutSnList
|
|
+ this.form.stockOutSnList = stockOutSnList
|
|
this.productTotal = ret
|
|
this.productTotal = ret
|
|
},
|
|
},
|
|
// 计算运费合计
|
|
// 计算运费合计
|
|
getTotalSendAmount () {
|
|
getTotalSendAmount () {
|
|
let ret = 0
|
|
let ret = 0
|
|
- this.tableData.map(item => {
|
|
+ this.tableData.map((item, i) => {
|
|
|
|
+ item.no = i + 1
|
|
ret = ret + Number(item.totalAmount || 0)
|
|
ret = ret + Number(item.totalAmount || 0)
|
|
})
|
|
})
|
|
this.form.totalSendAmount = ret.toFixed(2)
|
|
this.form.totalSendAmount = ret.toFixed(2)
|
|
@@ -336,9 +403,6 @@ export default {
|
|
// 删除
|
|
// 删除
|
|
handleDel (row, index) {
|
|
handleDel (row, index) {
|
|
this.tableData.splice(index, 1)
|
|
this.tableData.splice(index, 1)
|
|
- this.tableData.map((item, i) => {
|
|
|
|
- item.no = i + 1
|
|
|
|
- })
|
|
|
|
this.getTotalSendAmount()
|
|
this.getTotalSendAmount()
|
|
},
|
|
},
|
|
// 添加
|
|
// 添加
|
|
@@ -386,6 +450,10 @@ export default {
|
|
_this.$message.info('请选择物品!')
|
|
_this.$message.info('请选择物品!')
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
|
|
+ if (_this.vaildGood('goodsQty').indexOf(false) >= 0) {
|
|
|
|
+ _this.$message.info('请输入件数!')
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
if (_this.vaildGood('totalAmount').indexOf(false) >= 0) {
|
|
if (_this.vaildGood('totalAmount').indexOf(false) >= 0) {
|
|
_this.$message.info('请输入费用!')
|
|
_this.$message.info('请输入费用!')
|
|
return false
|
|
return false
|
|
@@ -410,7 +478,7 @@ export default {
|
|
handleCommonCancel () {
|
|
handleCommonCancel () {
|
|
this.$emit('cancel')
|
|
this.$emit('cancel')
|
|
this.tableData = []
|
|
this.tableData = []
|
|
- this.detail = []
|
|
+ this.sendBillStockOutList = []
|
|
this.spinning = false
|
|
this.spinning = false
|
|
this.$refs.ruleForm.resetFields()
|
|
this.$refs.ruleForm.resetFields()
|
|
this.form = {
|
|
this.form = {
|
|
@@ -448,6 +516,7 @@ export default {
|
|
.sendGood-detail-modal{
|
|
.sendGood-detail-modal{
|
|
.common-main{
|
|
.common-main{
|
|
.toolsBar{
|
|
.toolsBar{
|
|
|
|
+ padding-top:15px;
|
|
border:1px solid #eee;
|
|
border:1px solid #eee;
|
|
border-radius: 3px;
|
|
border-radius: 3px;
|
|
display: flex;
|
|
display: flex;
|