Commit 3171d90a by chenwq

feat(采购订单): 添加签收功能及相关状态显示

- 在constants.js中添加待签收状态选项
- 新增deliverySign和deliverySignDetail API接口
- 实现签收弹窗功能及状态条件显示
- 完善签收详情表格数据展示
1 parent 046e3672
......@@ -64,4 +64,30 @@ export function exportExcel(params) {
})
}
export default { getTypeList, getDeliveryList, addPurchaseOrder, exportExcel, getDeliveryDetail }
\ No newline at end of file
// 采购订单-签收-详情查看
const deliverySignDetail = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smarcarlife.purchaseOrder.delivery.detail'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 采购订单-签收
const deliverySign = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smarcarlife.purchaseOrder.delivery.sign'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getTypeList, getDeliveryList, addPurchaseOrder, exportExcel, getDeliveryDetail, deliverySignDetail, deliverySign }
\ No newline at end of file
......@@ -65,19 +65,23 @@ export const putStatusOptions = [
]
// 入库状态
export const defaultPutStatusOptions = [
{
id: 1,
label: '未入库'
},
{
id: 2,
label: '已入库'
}
// {
// id: 3,
// label: "部分入库"
// },
]
{
id: 0,
label: '待签收'
},
{
id: 1,
label: '未入库'
},
{
id: 2,
label: '已入库'
}
// {
// id: 3,
// label: "部分入库"
// },
]
//采购类型
export const purchaseTypeList = [
{
......
......@@ -32,14 +32,13 @@
</div> -->
<!-- <el-form ref="addForm" :model="detailInfo" size="small" v-if="detailInfo.deliveryCardList === null || detailInfo.deliveryCardList.length == 0"> -->
<el-form ref="addForm" :model="detailInfo" size="small">
<GLTable :tableData="detailInfo.goodsWarehousingList" :noDataImg="url" :tableParams="tableParams" :hasPage="false">
<template slot="increaseStockNum" slot-scope="scope">
<!-- <span>{{ membraneTypeList.includes(scope.scope.goodsType) ? `${scope.scope.increaseStockNum}米` : `${scope.scope.increaseStockNum}件` }}</span> -->
<GLTable :tableData="detailInfo.deliveryDetailList" :noDataImg="url" :tableParams="tableParams" :hasPage="false">
<!-- <template slot="increaseStockNum" slot-scope="scope">
<span>{{ scope.scope.increaseStockNum || scope.scope.increaseStockNum == 0 ?
(membraneTypeList.includes(scope.scope.goodsType) ? parseFloat(scope.scope.increaseStockNum /
scope.scope.alternateUnits).toFixed(2) : parseFloat(scope.scope.increaseStockNum).toFixed(2)) +
(membraneTypeList.includes(scope.scope.goodsType) ? '卷' : '件') : '-' }}</span>
</template>
</template> -->
</GLTable>
</el-form>
<!-- <div v-else class="message">
......@@ -109,19 +108,25 @@ export default {
tableColumns: [
{
label: '商品名称',
prop: ''
prop: 'upgradeGoodsName'
},
{
label: '商品编号',
prop: ''
prop: 'type'
},
{
label: '发货数量',
prop: ''
prop: '',
formatter: cellValue => {
return membraneTypeList.includes(cellValue.goodsType) ? `${cellValue.purchaseNumber}卷` : `${cellValue.purchaseNumber}件`
}
},
{
label: '可用库存数量',
prop: ''
prop: '',
formatter: cellValue => {
return cellValue.stockNum + (membraneTypeList.includes(cellValue.goodsType) ? '米' : '件')
}
}
// {
// label: '入库数量',
......@@ -166,23 +171,48 @@ export default {
}
console.log(data, '保存图片----')
const base64 = 'png@' + data.split('base64,')[1]
this.loading = true
this.$apis.sysBase.uploadImg({ file: base64, fileType: 'image' }).then(res => {
console.log(res, 'res----')
this.deliverySign(res)
}).catch(() => {
this.loading = false
})
},
deliverySign(url) {
const params = {
id: this.detailInfo.orderDeliveryId,
signFileUrl: url
}
console.log(params, 'params----')
this.$apis.delivery.deliverySign(params)
.then(res => {
if (res.code == 0) {
this.$message({
message: '签收成功',
type: 'success',
customClass: 'message-Z-zinde'
})
this.$emit('handleConfirm')
} else {
this.$message({
type: 'error',
message: res.message,
customClass: 'message-Z-zinde'
})
}
})
.finally(() => {
this.loading = false
})
},
handleDetailClose() {
this.$emit('handleClose')
},
getDetail() {
this.$apis.delivery.getDeliveryDetail({ id: this.info.id }).then(res => {
this.$apis.delivery.deliverySignDetail({ id: this.info.orderDeliveryId }).then(res => {
const { data } = res
if (res.code == 0) {
data.goodsWarehousingList.forEach(item => {
// 换算单位
// item.deliveryDetailList.forEach(info => {
item.alternateUnits = data?.stockNum / data?.purchaseNumber
// })
})
this.detailInfo = data
}
})
......
......@@ -36,7 +36,7 @@
</div>
<deliver-add v-if="addVisible" :visible.sync="addVisible" :id="id" @handleSuccess="handleSearch"></deliver-add>
<deliver-detail :visible.sync="detailVisible" :id="id"></deliver-detail>
<sign-dialog v-if="signVisible" :visible.sync="signVisible" :info="signInfo" @handleClose="signVisibleChange"></sign-dialog>
<sign-dialog v-if="signVisible" :visible.sync="signVisible" :info="signInfo" @handleClose="signVisibleChange" @handleConfirm="handleSignConfirm"></sign-dialog>
</div>
</template>
......@@ -57,7 +57,7 @@ export default {
},
filters: {
formatCar(list) {
console.log(list, 'list')
// console.log(list, 'list')
let str = list.map(item => {
return item.carTypeName
}).join(',')
......@@ -193,6 +193,10 @@ export default {
type: 'text',
fn: '签收'
},
condition: row => {
return row.putStatus == 0
},
listeners: {
click: this.handleSign
}
......@@ -306,6 +310,7 @@ export default {
},
mounted() {
this.getOptionsList('showFormData')
this.getTypeList()
this.$apis.purchaseShopping.getMerchantList({}).then(res => {
this.baseData.merchantName = res
......@@ -348,6 +353,11 @@ export default {
this.signVisibleChange()
},
handleSignConfirm() {
this.signVisibleChange()
this.$refs.orderRef.refreshTable()
},
// 入库
handleWarehousing(row) {
this.id = row.id
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!