Commit 793fcd52 by chenwq

feat(采购发货): 新增批量发货和分配功能

- 新增批量发货校验接口和批量发货功能
- 新增批量分配功能
- 优化发货单详情页,增加编辑和导出签收单功能
- 重构分配弹窗组件,支持批量操作
- 调整发货流程,支持批量操作
- 修复编辑时数据未清空的问题
1 parent c08418fb
...@@ -106,11 +106,19 @@ export function purchaseOrderCancelOrCheck(data) { ...@@ -106,11 +106,19 @@ export function purchaseOrderCancelOrCheck(data) {
// return request(data) // return request(data)
// } // }
// 采购订单批量发货校验
export function deliveryBatchCheck(data) {
data.method = "dj.api.smarcarlife.purchaseOrder.delivery.batch.check"
return request(data, "post")
}
// 确认发货 // 确认发货
export function purchaseOrderDelivery(data) { export function purchaseOrderDelivery(data) {
data.method = "dj.api.smarcarlife.purchaseOrder.delivery" data.method = "dj.api.smarcarlife.purchaseOrder.delivery.batch"
return request(data, "post") return request(data, "post")
} // 发货单分页查询 }
// 发货单分页查询
export function purchaseOrderDeliveryPage(data) { export function purchaseOrderDeliveryPage(data) {
data.method = `${path}purchaseOrder.delivery.page` data.method = `${path}purchaseOrder.delivery.page`
return request(data) return request(data)
...@@ -177,6 +185,12 @@ export function factoryView(data) { ...@@ -177,6 +185,12 @@ export function factoryView(data) {
return request(data) return request(data)
} }
// 仓库/工厂发货-编辑
export function factoryUpdate(data) {
data.method = "dj.api.smarcarlife.warehousedeliver.detail.update"
return request(data, "post")
}
// 商务审核分页查询 // 商务审核分页查询
export function businessreviewPage(data) { export function businessreviewPage(data) {
data.method = `${path}businessreview.page` data.method = `${path}businessreview.page`
......
...@@ -189,13 +189,6 @@ export const routerName = { ...@@ -189,13 +189,6 @@ export const routerName = {
authId: "9090402", authId: "9090402",
parentId: "90904", parentId: "90904",
label: "发货", label: "发货",
ruleObj: {
attr: "deliveryStatus",
rule: {
1: "发货",
3: "发货"
}
},
handle: "handleDelivery" handle: "handleDelivery"
}, },
{ {
...@@ -223,6 +216,22 @@ export const routerName = { ...@@ -223,6 +216,22 @@ export const routerName = {
parentId: "90904", parentId: "90904",
label: "结束", label: "结束",
handle: "handleEnd" handle: "handleEnd"
},
{
authId: "9090407",
parentId: "90904",
label: "批量发货",
category: "Button",
type: "primary",
handle: "handleBatchDelivery"
},
{
authId: "9090408",
parentId: "90904",
label: "批量分配",
category: "Button",
type: "primary",
handle: "handleBatchAllocat"
} }
], ],
component: _import("purchase/purchaseAndDelivery") component: _import("purchase/purchaseAndDelivery")
...@@ -346,15 +355,23 @@ export const routerName = { ...@@ -346,15 +355,23 @@ export const routerName = {
authId: "9090702", authId: "9090702",
parentId: "90907", parentId: "90907",
label: "发货", label: "发货",
ruleObj: {
attr: "deliveryStatus",
rule: {
1: "发货",
3: "发货"
// 2: "发货"
}
},
handle: "handleDelivery" handle: "handleDelivery"
},
{
authId: "9090703",
parentId: "90907",
label: "批量发货",
category: "Button",
type: "primary",
handle: "handleBatchDelivery"
},
{
authId: "9090704",
parentId: "90907",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
} }
// { // {
// authId: "9090703", // authId: "9090703",
......
<template> <template>
<div> <div>
<baseDialog :is-show.sync="dialogShow" :config="dialogConfig.setting" :dialog-config="dialogConfig.config" <baseDialog :is-show.sync="dialogShow" :config="dialogConfig.setting" :dialog-config="dialogConfig.config" @closeDialog="handleDetailClose(false)">
@closeDialog="handleDetailClose(false)">
<div class="edit-order-dialog" v-if="dialogShow"> <div class="edit-order-dialog" v-if="dialogShow">
<div class="addressTitle">
<img src="../images/addressIcon.webp" alt="" class="icon">
<span class="title">{{ paramsObj.merchantName }}</span>
</div>
<div class="address-info">
<span class="name">收货人:<span class="label">{{ detailInfo.contactName }}</span></span>
<span class="phone">电话:<span class="label">{{ detailInfo.contactPhone }}</span></span>
<span class="address">收货地址:<span class="label">{{ detailInfo.contactAddress }}</span></span>
</div>
<div class="address-info" v-if="detailInfo.purchaseOrderRemark">
<span class="address">备注:<span class="label">{{ detailInfo.purchaseOrderRemark }}</span></span>
</div>
<div class="table-class"> <div class="table-class">
<d2-table ref="purchaseOrderDetailTable" :table-params="tableParams" :has-page="hasPage" <d2-table ref="purchaseOrderDetailTable" :table-params="tableParams" :has-page="hasPage" @refreshTable="refreshTable" :table-data="tableList" :table-total="detailInfo.tableTotal">
@refreshTable="refreshTable" :table-data="detailInfo.tableData" :table-total="detailInfo.tableTotal">
<div slot="nowPurNum" slot-scope="scope"> <div slot="nowPurNum" slot-scope="scope">
<span v-if="scope.scope.refundStatus != 'Y'"> <el-select v-model="nowPurNumList[scope.index]" placeholder="请选择" clearable>
<div <el-option v-for="item in staffList" :key="item.uuid" :label="item.staffName" :value="item.uuid">
v-if="detailInfo.tableData[scope.index].purchaseNumber == detailInfo.tableData[scope.index].goodsNumber"> </el-option>
{{ detailInfo.tableData[scope.index].shipper || '未分配' }}</div> </el-select>
<div
v-else-if="detailInfo.tableData[scope.index].shipper && detailInfo.tableData[scope.index].purchaseNumber != 0">
{{ detailInfo.tableData[scope.index].shipper }}</div>
<div
v-else-if="detailInfo.tableData[scope.index].purchaseNumber != 0 && !detailInfo.tableData[scope.index].shipper">
未分配</div>
<el-select v-else v-model="nowPurNumList[scope.index]" placeholder="请选择" clearable>
<el-option v-for="item in staffList" :key="item.uuid" :label="item.staffName" :value="item.uuid">
</el-option>
</el-select>
</span>
<span v-else>--</span>
</div> </div>
<template slot="upgradeGoodsName" slot-scope="scope"> <template slot="upgradeGoodsName" slot-scope="scope">
<div> <div>
...@@ -52,23 +26,23 @@ ...@@ -52,23 +26,23 @@
</el-tooltip> </el-tooltip>
<div v-else>-</div> <div v-else>-</div>
</template> </template>
<template slot="deliveryRemark" slot-scope="scope">
<el-input v-model="scope.scope.deliveryRemark" maxlength="50" placeholder="请输入"></el-input>
</template>
</d2-table> </d2-table>
</div> </div>
<div class="footer"> <div class="footer">
<el-button @click="handleDetailClose(false)">取消</el-button> <el-button @click="handleDetailClose(false)">取消</el-button>
<el-button @click="submit" type="primary" v-preventReClick <el-button @click="submit" type="primary" v-preventReClick :loading="$store.state.d2admin.loading.value">确定</el-button>
:loading="$store.state.d2admin.loading.value">确定</el-button>
</div> </div>
</div> </div>
</baseDialog> </baseDialog>
<card-dialog v-if="cardVisible" :card-visible="cardVisible" :order-info="orderInfo" <card-dialog v-if="cardVisible" :card-visible="cardVisible" :order-info="orderInfo" :selected-list="selectedCardList" @handleClose="handleCardDialog" @handleConfirm="handleCardConfirm"></card-dialog>
:selected-list="selectedCardList" @handleClose="handleCardDialog"
@handleConfirm="handleCardConfirm"></card-dialog>
</div> </div>
</template> </template>
<script> <script>
import { purchaseOrderDetail, getShipperList, saveshipper } from '@/api/purchaseShopping.js' import { getShipperList, saveshipper } from '@/api/purchaseShopping.js'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import CardDialog from './CardDialog' import CardDialog from './CardDialog'
export default { export default {
...@@ -78,10 +52,14 @@ export default { ...@@ -78,10 +52,14 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
paramsObj: { tableList: {
type: Object, type: Array,
default: () => { } default: () => []
} }
// paramsObj: {
// type: Object,
// default: () => { }
// }
}, },
components: { components: {
CardDialog CardDialog
...@@ -143,7 +121,7 @@ export default { ...@@ -143,7 +121,7 @@ export default {
{ {
label: '适用车型', label: '适用车型',
addHtml: 'carName', addHtml: 'carName',
width: 200, width: 200
}, },
{ {
label: '系列', label: '系列',
...@@ -176,6 +154,11 @@ export default { ...@@ -176,6 +154,11 @@ export default {
} }
}, },
{ {
label: '备注',
prop: 'remark',
width: 150
},
{
label: '已发货数量', label: '已发货数量',
prop: 'purchaseNumber', prop: 'purchaseNumber',
formatter: (cellValue) => { formatter: (cellValue) => {
...@@ -185,11 +168,13 @@ export default { ...@@ -185,11 +168,13 @@ export default {
{ {
label: '发货方', label: '发货方',
prop: '', prop: '',
width: 150,
addHtml: 'nowPurNum' addHtml: 'nowPurNum'
}, },
{ {
label: '备注', label: '发货备注',
prop: 'remark', prop: 'deliveryRemark',
addHtml: 'deliveryRemark',
width: 150 width: 150
} }
] ]
...@@ -200,7 +185,6 @@ export default { ...@@ -200,7 +185,6 @@ export default {
}, },
filters: { filters: {
formatCar(list) { formatCar(list) {
console.log(list, 'list')
let str = list.map(item => { let str = list.map(item => {
return `${item.brandName}-${item.childName}-${item.seriesName}-${item.carTypeName}` return `${item.brandName}-${item.childName}-${item.seriesName}-${item.carTypeName}`
}).join(',') }).join(',')
...@@ -208,13 +192,20 @@ export default { ...@@ -208,13 +192,20 @@ export default {
} }
}, },
mounted() { mounted() {
console.log(this.tableList, 'tableList')
this.getStaffList() this.getStaffList()
}, },
methods: { methods: {
getStaffList() { getStaffList() {
getShipperList({}).then(res => { getShipperList({}).then(res => {
this.staffList = res this.staffList = res
this.getDetail({ currentPage: 1, pageSize: 999 }) this.tableList.forEach((item, idx) => {
if (item.shipper) {
this.nowPurNumList[idx] = {}
this.nowPurNumList[idx] = this.staffList.find(k => k.staffName == item.shipper)?.uuid || ''
}
})
// this.getDetail({ currentPage: 1, pageSize: 999 })
}) })
}, },
handleDetailClose(isRefresh = false) { handleDetailClose(isRefresh = false) {
...@@ -228,17 +219,17 @@ export default { ...@@ -228,17 +219,17 @@ export default {
// return true // return true
// } // }
this.nowPurNumList = [] this.nowPurNumList = []
purchaseOrderDetail({ orderCode: this.paramsObj.orderCode, pageSize: pageObj.pageSize, currentPage: pageObj.currentPage }).then(res => { // purchaseOrderDetail({ orderCode: this.paramsObj.orderCode, pageSize: pageObj.pageSize, currentPage: pageObj.currentPage }).then(res => {
this.detailInfo = res // this.detailInfo = res
this.detailInfo.tableData = res.pagination.list // this.detailInfo.tableData = res.pagination.list
this.detailInfo.tableTotal = res.pagination.total // this.detailInfo.tableTotal = res.pagination.total
this.detailInfo.tableData.forEach((item, idx) => { // this.detailInfo.tableData.forEach((item, idx) => {
if (item.shipper) { // if (item.shipper) {
this.nowPurNumList[idx] = {} // this.nowPurNumList[idx] = {}
this.nowPurNumList[idx] = this.staffList.find(k => k.staffName == item.shipper)?.uuid || '' // this.nowPurNumList[idx] = this.staffList.find(k => k.staffName == item.shipper)?.uuid || ''
} // }
}) // })
}) // })
}, },
submit() { submit() {
this.isSubmit = true this.isSubmit = true
...@@ -250,16 +241,17 @@ export default { ...@@ -250,16 +241,17 @@ export default {
var params = { var params = {
purchaseOrderGoodsList: [] purchaseOrderGoodsList: []
} }
this.detailInfo.tableData.forEach((item, idx) => { this.tableList.forEach((item, idx) => {
// if (this.nowPurNumList[idx]) { // if (this.nowPurNumList[idx]) {
params.purchaseOrderGoodsList.push({ params.purchaseOrderGoodsList.push({
orderCode: this.paramsObj.orderCode,
id: item.id, id: item.id,
shipperUuid: this.nowPurNumList[idx] || '', shipperUuid: this.nowPurNumList[idx] || '',
shipper: this.staffList.find(k => k.uuid == this.nowPurNumList[idx])?.staffName || '' shipper: this.staffList.find(k => k.uuid == this.nowPurNumList[idx])?.staffName || '',
deliveryRemark: item.deliveryRemark || ''
}) })
// } // }
}) })
console.log(params, 'params---')
saveshipper(params).then(res => { saveshipper(params).then(res => {
this.handleDetailClose(true) this.handleDetailClose(true)
this.notice.okTips() this.notice.okTips()
...@@ -314,7 +306,7 @@ export default { ...@@ -314,7 +306,7 @@ export default {
font-size: 14px; font-size: 14px;
color: #666666; color: #666666;
>span { > span {
margin-right: 20px; margin-right: 20px;
margin-bottom: 10px; margin-bottom: 10px;
} }
......
<!-- 发货单详情弹窗 --> <!-- 发货单详情弹窗 -->
<template> <template>
<div> <div>
<baseDialog title="详细信息" :is-show.sync="detailVisible" :config="dialogConfig.setting" <baseDialog title="详细信息" :is-show.sync="detailVisible" :config="dialogConfig.setting" :dialog-config="dialogConfig.config" width="1050px" :no-cancel="true" btn-ok-label="关闭" @closeDialog="handleClose" @confirmDialog="handleClose">
:dialog-config="dialogConfig.config" width="1050px" :no-cancel="true" btn-ok-label="关闭" @closeDialog="handleClose"
@confirmDialog="handleClose">
<div class="stockMonthDailog"> <div class="stockMonthDailog">
<div class="addressTitle"> <div class="addressTitle">
<img src="../images/addressIcon.webp" alt="" class="icon"> <img src="../images/addressIcon.webp" alt="" class="icon">
...@@ -19,21 +17,24 @@ ...@@ -19,21 +17,24 @@
</div> </div>
<div v-for="(itemList, index) in detailInfo" :key="index"> <div v-for="(itemList, index) in detailInfo" :key="index">
<div class="detail-info"> <div class="detail-info">
<div> <div style="width: 319px;">
发货单号: <!-- 发货单号: -->
<span>{{ itemList.deliveryNumber }}</span> <span>{{ itemList.deliveryNumber }}</span>
</div> </div>
<div> <div style="width: 319px;">
承运公司: <!-- 承运公司: -->
<span>{{ itemList.deliveryCompany }}</span> <span>{{ itemList.deliveryCompany }}</span>
</div> </div>
<div> <div>
发货时间: 发货时间:
<span>{{ itemList.deliveryDate }}</span> <span>{{ itemList.deliveryDate }}</span>
</div> </div>
<div>
<el-button v-if="itemList.putStatus == 0" type="text" @click="handleEdit(itemList)">编辑</el-button>
<el-button type="text" @click="handleExport(itemList)">发货签收单</el-button>
</div>
</div> </div>
<d2-table ref="recordTable" :table-data="itemList.deliveryDetailList" :table-params="tableParams" <d2-table ref="recordTable" :table-data="itemList.deliveryDetailList" :table-params="tableParams" :has-page="false">
:has-page="false">
<span slot="deliveryCard" slot-scope="scope"> <span slot="deliveryCard" slot-scope="scope">
<template v-if="scope.scope.deliveryCardList && scope.scope.deliveryCardList.length > 1"> <template v-if="scope.scope.deliveryCardList && scope.scope.deliveryCardList.length > 1">
<!-- {{ scope.scope.deliveryCardList.length || 0 }} --> <!-- {{ scope.scope.deliveryCardList.length || 0 }} -->
...@@ -51,20 +52,19 @@ ...@@ -51,20 +52,19 @@
</div> </div>
</div> </div>
</baseDialog> </baseDialog>
<baseDialog title="查看发货卡号" :config="carDialogConfig.setting" :dialog-config="carDialogConfig.config" <baseDialog title="查看发货卡号" :config="carDialogConfig.setting" :dialog-config="carDialogConfig.config" :is-show.sync="handleDeliveryCardVisible" width="500px" :no-cancel="true" btn-ok-label="关闭" @closeDialog="handleDeliveryCardVisible = false" @confirmDialog="handleDeliveryCardVisible = false">
:is-show.sync="handleDeliveryCardVisible" width="500px" :no-cancel="true" btn-ok-label="关闭" <d2-table class="deliveryCardCon" ref="recordTable" :table-data="deliveryCardList" :table-params="innerParams" :has-page="false">
@closeDialog="handleDeliveryCardVisible = false" @confirmDialog="handleDeliveryCardVisible = false">
<d2-table class="deliveryCardCon" ref="recordTable" :table-data="deliveryCardList" :table-params="innerParams"
:has-page="false">
</d2-table> </d2-table>
</baseDialog> </baseDialog>
<!-- 编辑 -->
<glsk-form-dialog v-if="editVisible" :selectVisible="editVisible" :dialogConfig="editDialogConfig" label-width="104px" dialog-width="520px" :formRules="editRules" :editData="editData" :editFormData="editFormData" :base-data="baseData" @handleClose="editVisible = false" @handleConfirm="handleEditConfirm"></glsk-form-dialog>
</div> </div>
</template> </template>
<script> <script>
import { Util, deepClone } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { factoryView } from '@/api/purchaseShopping.js' import { factoryView, factoryUpdate } from '@/api/purchaseShopping.js'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
export default { export default {
...@@ -151,7 +151,36 @@ export default { ...@@ -151,7 +151,36 @@ export default {
] ]
}, },
handleDeliveryCardVisible: false, handleDeliveryCardVisible: false,
deliveryCardList: [] deliveryCardList: [],
// 编辑
editVisible: false,
editData: {
id: '',
deliveryNumber: '',
deliveryCompany: ''
},
editFormData: [{
name: 'deliveryNumber',
label: '承运单号',
type: 'input',
inputType: 'textarea',
rows: 3,
maxlength: '50',
isClear: true
}, {
name: 'deliveryCompany',
label: '承运公司',
type: 'input',
maxlength: '20',
isClear: true
}],
editRules: {
deliveryNumber: [{ required: true, message: '请输入承运单号', trigger: 'change' }],
deliveryCompany: [{ required: true, message: '请输入承运公司', trigger: 'change' }]
},
editDialogConfig: {
title: '编辑'
}
} }
}, },
computed: { computed: {
...@@ -187,7 +216,7 @@ export default { ...@@ -187,7 +216,7 @@ export default {
}, },
getDetail() { getDetail() {
var params = { orderCode: deepClone(this.recordInfo.orderCode), currentPage: 1, pageSize: 1000 } var params = { id: deepClone(this.recordInfo.id), currentPage: 1, pageSize: 1000 }
factoryView(params).then(res => { factoryView(params).then(res => {
console.log(res, 'res') console.log(res, 'res')
this.detailInfo = res.list this.detailInfo = res.list
...@@ -215,6 +244,28 @@ export default { ...@@ -215,6 +244,28 @@ export default {
}) })
}) })
}, },
// 编辑
editDialogVisible() {
this.editVisible = !this.editVisible
},
handleEdit(targetItem) {
this.editData = {}
this.editData.id = targetItem.id
this.editDialogVisible()
},
handleEditConfirm() {
this.loading = true
factoryUpdate(this.editData).then((res) => {
this.notice.okTips()
this.editDialogVisible()
this.getDetail()
// this.handleReset()
}).finally(() => {
this.loading = false
})
},
handleClose() { handleClose() {
// this.$emit('dialogClose') // this.$emit('dialogClose')
...@@ -251,7 +302,7 @@ export default { ...@@ -251,7 +302,7 @@ export default {
font-size: 14px; font-size: 14px;
color: #666666; color: #666666;
>span { > span {
margin-right: 20px; margin-right: 20px;
margin-bottom: 10px; margin-bottom: 10px;
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</div> </div>
<div class="address-info"> <div class="address-info">
<span class="name">收货人:<span class="label">{{ detailInfo.contactName }}</span></span> <span class="name">收货人:<span class="label">{{ detailInfo.contactName }}</span></span>
<span class="phone">电话:<span class="label">{{ detailInfo.contactPhone }}</span></span> <span class="phone">收货人电话:<span class="label">{{ detailInfo.contactPhone }}</span></span>
<span class="address">收货地址:<span class="label">{{ detailInfo.contactAddress }}</span></span> <span class="address">收货地址:<span class="label">{{ detailInfo.contactAddress }}</span></span>
</div> </div>
<div class="address-info" v-if="detailInfo.purchaseOrderRemark"> <div class="address-info" v-if="detailInfo.purchaseOrderRemark">
......
...@@ -308,6 +308,7 @@ export default { ...@@ -308,6 +308,7 @@ export default {
this.editVisible = !this.editVisible this.editVisible = !this.editVisible
}, },
handleEdit(row) { handleEdit(row) {
this.editData = {}
this.editData.id = row.id this.editData.id = row.id
this.editDialogVisible() this.editDialogVisible()
}, },
......
...@@ -13,18 +13,23 @@ ...@@ -13,18 +13,23 @@
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header> <d2-table-header>
<!-- <span slot="left"> --> <span style="margin-right: 10px">
<!-- <auth-button category="Button" /> --> <auth-button category="Button" :show-btn-ids="['9090407']" />
<!-- <auth-button category="Button" /> </span>
</span> --> <span style="margin-right: 10px">
<auth-button category="Button" :show-btn-ids="['9090408']" />
</span>
<span> <span>
<!-- <el-button type="primary" size="mini" @click="handleExport">
导出
</el-button> -->
<auth-button category="Button" :show-btn-ids="['9090405']" /> <auth-button category="Button" :show-btn-ids="['9090405']" />
</span> </span>
</d2-table-header> </d2-table-header>
<d2-table ref="purchaseAndDeliveryTable" :search-form="tableSearchForm" :table-params="tableParams" :table-data="tableData" :get-list-api="getListApi" :before-search-fn="beforeSearchFn"> <d2-table ref="purchaseAndDeliveryTable" :search-form="tableSearchForm" :table-params="tableParams" :get-list-api="getListApi" @selectionTable="handleSelectionTable" :before-search-fn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @current-change="handleCurrentChange">
<template slot="upgradeGoodsName" slot-scope="scope">
<div>
<img v-if="scope.scope.refundStatus == 'Y'" class="return" src="@/assets/retrun.png" alt="">
<span>{{ scope.scope.upgradeGoodsName }}</span>
</div>
</template>
<div slot="suitCarTypeList" slot-scope="scope"> <div slot="suitCarTypeList" slot-scope="scope">
<el-tooltip v-if="scope.scope.suitCarTypeList && scope.scope.suitCarTypeList.length" effect="dark" placement="top" :content="scope.columnsObj.formatter(scope.scope)"> <el-tooltip v-if="scope.scope.suitCarTypeList && scope.scope.suitCarTypeList.length" effect="dark" placement="top" :content="scope.columnsObj.formatter(scope.scope)">
<span class="one-line-ellipsis">{{ scope.columnsObj.formatter(scope.scope) }}</span> <span class="one-line-ellipsis">{{ scope.columnsObj.formatter(scope.scope) }}</span>
...@@ -37,13 +42,11 @@ ...@@ -37,13 +42,11 @@
<auth-button :data="scope.scope" :show-btn-ids="['9090401']" /> <auth-button :data="scope.scope" :show-btn-ids="['9090401']" />
</span> </span>
<!-- 确认发货 --> <!-- 确认发货 -->
<span v-if="scope.scope.deliveryStatus == 1 || scope.scope.deliveryStatus == 3" style="margin-right: 10px"> <span v-if="scope.scope.refundStatus != 'Y' && (scope.scope.deliveryStatus == 1 || scope.scope.deliveryStatus == 3)" style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9090402']" /> <auth-button :data="scope.scope" :show-btn-ids="['9090402']" />
</span> </span>
<!-- 分配 --> <!-- 分配 -->
<span v-if="scope.scope.deliveryStatus != 2 && scope.scope.deliveryStatus != 4 <span v-if="scope.scope.deliveryStatus == 1" style="margin-right: 10px">
" style="margin-right: 10px">
<!-- <el-button :data="scope.scope" type="text" @click="handleAllocat(scope.scope)">分配</el-button> -->
<auth-button :data="scope.scope" :show-btn-ids="['9090404']" /> <auth-button :data="scope.scope" :show-btn-ids="['9090404']" />
</span> </span>
<!-- 驳回 --> <!-- 驳回 -->
...@@ -58,9 +61,9 @@ ...@@ -58,9 +61,9 @@
</d2-table> </d2-table>
</div> </div>
<orderDeatilDialog :visible.sync="detailVisible" v-if="detailVisible" :params-obj="paramsObj"></orderDeatilDialog> <orderDeatilDialog :visible.sync="detailVisible" v-if="detailVisible" :params-obj="paramsObj"></orderDeatilDialog>
<EditOrderDialog v-if="editVisible" :is-empty-edit="true" :visible.sync="editVisible" :params-obj="dialogData" @editClose="editClose"> <EditOrderDialog v-if="editVisible" :is-empty-edit="true" :visible.sync="editVisible" :tableList="editTableList" :params-obj="dialogData" @editClose="editClose">
</EditOrderDialog> </EditOrderDialog>
<AllocateDialog v-if="allocateVisible" :visible.sync="allocateVisible" :params-obj="allocateData" @editClose="allocateClose"> <AllocateDialog v-if="allocateVisible" :visible.sync="allocateVisible" :tableList="allocateTableList" @editClose="allocateClose">
</AllocateDialog> </AllocateDialog>
<!-- :config="rejectConfig.setting" :dialog-config="rejectConfig.config" :config="rejectConfig.setting"--> <!-- :config="rejectConfig.setting" :dialog-config="rejectConfig.config" :config="rejectConfig.setting"-->
<baseDialog :is-show.sync="rejectVisible" :dialog-config="rejectConfig.config" @handleClick="handleRejectConfirm"> <baseDialog :is-show.sync="rejectVisible" :dialog-config="rejectConfig.config" @handleClick="handleRejectConfirm">
...@@ -118,7 +121,8 @@ import { ...@@ -118,7 +121,8 @@ import {
getPurchaseOrderShipmentList, getPurchaseOrderShipmentList,
getMerchantList, getMerchantList,
purchaseOrderReject, purchaseOrderReject,
shipmentTerminate shipmentTerminate,
deliveryBatchCheck
} from "@/api/purchaseShopping.js" } from "@/api/purchaseShopping.js"
import orderDeatilDialog from "./components/orderDetailDialog" import orderDeatilDialog from "./components/orderDetailDialog"
import EditOrderDialog from "./components/EditOrderDialog" import EditOrderDialog from "./components/EditOrderDialog"
...@@ -135,6 +139,7 @@ export default { ...@@ -135,6 +139,7 @@ export default {
data() { data() {
return { return {
editVisible: false, editVisible: false,
editTableList: [],
allocateVisible: false, allocateVisible: false,
membraneTypeList: baseConfig.membraneTypeList, membraneTypeList: baseConfig.membraneTypeList,
reg: { reg: {
...@@ -301,17 +306,19 @@ export default { ...@@ -301,17 +306,19 @@ export default {
maxlength: 50 maxlength: 50
} }
], ],
selectedList: [],
getListApi: getPurchaseOrderShipmentList, getListApi: getPurchaseOrderShipmentList,
// 表格参数 // 表格参数
tableParams: { tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list", listName: "list",
mutiSelectUniqueKey: "id", mutiSelectUniqueKey: "id",
mutiSelectName: "deliveryId", mutiSelectName: "deliveryList",
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: "商品名称", label: "商品名称",
addHtml: 'upgradeGoodsName',
prop: "upgradeGoodsName" prop: "upgradeGoodsName"
}, },
{ {
...@@ -511,7 +518,8 @@ export default { ...@@ -511,7 +518,8 @@ export default {
deliveryCompany: "", deliveryCompany: "",
deliveryNumber: "" deliveryNumber: ""
}, },
allocateData: {} allocateTableList: []
// allocateData: {}
} }
}, },
computed: { computed: {
...@@ -668,12 +676,23 @@ export default { ...@@ -668,12 +676,23 @@ export default {
} }
}) })
}, },
// 批量分配
handleBatchAllocat() {
if (this.selectedList.length == 0) {
this.notice.errorTips('请选择要发货的订单')
return true
}
if (this.selectedList.filter(item => item.deliveryStatus != 1).length) {
this.notice.errorTips('请选择可分配的记录')
return true
}
this.allocateTableList = deepClone(this.selectedList)
this.allocateVisible = true
},
// 分配 // 分配
handleAllocat(row) { handleAllocat(row) {
this.allocateTableList = [row]
this.allocateVisible = true this.allocateVisible = true
this.allocateData.orderCode = row.orderCode
this.allocateData.merchantName = row.merchantName
this.allocateData.merchantId = row.merchantId
}, },
allocateClose(isRefresh) { allocateClose(isRefresh) {
this.handleAllocateClose() this.handleAllocateClose()
...@@ -682,11 +701,81 @@ export default { ...@@ -682,11 +701,81 @@ export default {
handleAllocateClose() { handleAllocateClose() {
this.allocateVisible = !this.allocateVisible this.allocateVisible = !this.allocateVisible
}, },
// recoverySelection(list) {
// var exitIds = this.selectedList.map((item) => item.id)
// console.log(exitIds)
// list.forEach((item) => {
// console.log(item.id, "item.id")
// exitIds.includes(item.id) &&
// this.$refs.purchaseAndDeliveryTable.$refs.deliveryIdMutiTable.toggleRowSelection(
// item,
// true
// )
// })
// },
setTableFinishFun(data) {
this.$nextTick(() => {
this.tableData = data
// this.recoverySelection(data)
})
},
handleCurrentChange(val) {
// this.selectedList = this.$refs.purchaseAndDeliveryTable.mutiSelectArr.deliveryList
},
handleSelectionTable(val) {
this.selectedList = val
// console.log(val)
// var list = val
// const currentSelectIds = val.map(item => item.id)
// const pageIds = this.tableData.map(item => item.id)
// this.selectedList.forEach(item => {
// if (!currentSelectIds.includes(item.id)) {
// if (currentSelectIds.includes(item.id)) {
// list.push(item)
// }
// if (!currentSelectIds.includes(item.id) && !pageIds.includes(item.id)) {
// list.push(item)
// }
// } else if (!pageIds.includes(item.id)) {
// list.push(item)
// }
// })
// this.selectedList = list
console.log(this.selectedList, 'selectedList')
},
// 确认发货 // 确认发货
handleDelivery(row) { handleDelivery(row) {
this.editVisible = true this.editTableList = [row]
this.dialogData.orderCode = row.orderCode
this.dialogData.merchantName = row.merchantName this.dialogData.merchantName = row.merchantName
this.dialogData.sendOutMerchantName = row.sendOutMerchantName
this.dialogData.contactName = row.contactName
this.dialogData.contactPhone = row.contactPhone
this.dialogData.contactAddress = row.contactAddress
this.editVisible = true
},
// 批量发货
handleBatchDelivery() {
// console.log(this.$refs.purchaseAndDeliveryTable.mutiSelectArr.deliveryList)
if (this.selectedList.length == 0) {
this.notice.errorTips('请选择要发货的订单')
return
}
const params = {
deliveryDetailList: this.selectedList.map(item => { return { id: item.id } })
}
deliveryBatchCheck(params).then(res => {
console.log(res, 'res')
if (res) {
const target = this.selectedList[0]
this.editTableList = deepClone(this.selectedList)
this.dialogData.merchantName = target.merchantName
this.dialogData.contactName = target.contactName
this.dialogData.contactPhone = target.contactPhone
this.dialogData.contactAddress = target.contactAddress
this.editVisible = true
}
})
}, },
// 查看详情 // 查看详情
handleDetail(row) { handleDetail(row) {
...@@ -758,6 +847,13 @@ export default { ...@@ -758,6 +847,13 @@ export default {
} }
} }
.return {
width: 15px;
height: 14px;
margin-right: 2px;
vertical-align: middle;
}
.footer { .footer {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!