Commit 1ec0a906 by chenwq

feat(发货管理): 新增订单类型筛选和签收凭证上传功能

- 在发货列表页面新增订单类型筛选条件(采购订单/调拨订单)
- 在发货详情页面显示签收凭证图片预览
- 在签收弹窗中增加凭证上传功能,支持最多10张图片
- 优化发货详情页面的布局和样式,调整部分字段显示
1 parent 629f4927
......@@ -86,6 +86,17 @@ export const defaultPutStatusOptions = [
// label: "部分入库"
// },
]
// 订单类型
export const orderTypeOptions = [
{
id: 0,
label: '采购订单'
},
{
id: 1,
label: '调拨订单'
}
]
//采购类型
export const purchaseTypeList = [
{
......
......@@ -17,8 +17,7 @@
<div v-loading="loading || btnLoading">
<div class="table-wrap">
<el-form ref="addForm" :model="detailInfo" size="small">
<GLTable :tableData="detailInfo.deliveryDetailList" :noDataImg="url" :tableParams="tableParams" :hasPage="false">
</GLTable>
<GLTable :tableData="detailInfo.deliveryDetailList" :noDataImg="url" :tableParams="tableParams" :hasPage="false"></GLTable>
</el-form>
<div class="sign-box-wrap">
<div class="preset-box">
......@@ -44,6 +43,21 @@
</div>
</div>
</div>
<div class="upload-module">
<el-form ref="uploadForm" :model="uploadForm" :rules="uploadRules" size="small" label-width="154px">
<el-form-item prop="files" label="上传凭证:" class="upload-form-item">
<div class="upload-content">
<el-upload action="" list-type="picture-card" :http-request="uploadRequest" :before-upload="beforeUpload" :on-remove="handleRemove" :on-success="handleSuccess" :file-list="uploadFileList" :limit="10" :on-exceed="handleExceed" multiple accept=".jpg,.jpeg,.png" class="upload-voucher">
<div class="upload-trigger-content">
<i class="el-icon-plus"></i>
<div class="upload-count">{{ uploadFileList.length }}/10</div>
</div>
</el-upload>
<div class="upload-tip">请上传小于2M的图片。</div>
</div>
</el-form-item>
</el-form>
</div>
</div>
</div>
<template slot="footer">
......@@ -132,16 +146,84 @@ export default {
]
},
tableData: [],
detailInfo: {}
detailInfo: {},
uploadFileList: [],
uploadForm: {
files: []
},
uploadRules: {
files: [
{ required: true, validator: this.validateFiles, trigger: 'change' }
]
}
}
},
mounted() {
this.getSignList()
},
methods: {
validateFiles(rule, value, callback) {
if (this.uploadFileList.length === 0) {
callback(new Error('请上传凭证'))
} else if (this.uploadFileList.length > 10) {
callback(new Error('最多上传10张图片'))
} else {
callback()
}
},
undo() {
this.$refs.signaturePad.undoSignature()
},
uploadRequest(param) {
const file = param.file
const isLt2M = file.size / 1024 / 1024 < 2
if (!isLt2M) {
this.$message({
message: '上传图片大小不能超过 2MB!',
type: 'error',
customClass: 'message-Z-zinde'
})
param.onError('上传图片大小不能超过 2MB!')
return
}
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = () => {
const extension = file.name.split('.').pop()
const base64 = extension + '@' + reader.result.split(',')[1]
this.$apis.sysBase.uploadImg({ file: base64, fileType: 'image' }).then(res => {
param.onSuccess(res)
}).catch(err => {
param.onError(err)
})
}
},
beforeUpload(file) {
const isLt2M = file.size / 1024 / 1024 < 2
if (!isLt2M) {
this.$message({
message: '上传图片大小不能超过 2MB!',
type: 'error',
customClass: 'message-Z-zinde'
})
}
return isLt2M
},
handleRemove(file, fileList) {
this.uploadFileList = fileList
this.$refs.uploadForm.validateField('files')
},
handleSuccess(response, file, fileList) {
this.uploadFileList = fileList
this.$refs.uploadForm.validateField('files')
},
handleExceed(files, fileList) {
this.$message({
message: `当前限制选择 10 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`,
type: 'warning',
customClass: 'message-Z-zinde'
})
},
clear() {
if (this.activeSignIdx != -1) {
this.activeSignIdx = -1
......@@ -150,10 +232,6 @@ export default {
this.$refs.signaturePad.clearSignature()
},
save() {
// if (!this.$refs.signaturePad) {
// this.$message.warning('签名组件未加载')
// return
// }
const { isEmpty, data } = this.$refs.signaturePad.saveSignature()
if (this.btnLoading) {
return
......@@ -166,19 +244,29 @@ export default {
})
return
}
console.log(data, '保存图片----')
if (this.activeSignIdx != -1) {
this.deliverySign(this.signList[this.activeSignIdx].signFileUrl)
} else {
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
})
}
this.$refs.uploadForm.validate(valid => {
if (valid) {
const uploadFileUrl = this.uploadFileList.map(item => (item.response ? item.response : item.url)).join(',')
console.log(data, '保存图片----')
if (this.activeSignIdx != -1) {
this.deliverySign(this.signList[this.activeSignIdx].signFileUrl, uploadFileUrl)
} else {
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, uploadFileUrl)
}).catch(() => {
this.loading = false
})
}
} else {
console.log('error submit!!');
return false;
}
})
},
getSignList() {
......@@ -194,10 +282,11 @@ export default {
this.activeSignIdx = index
this.$refs.signaturePad.clearSignature()
},
deliverySign(url) {
deliverySign(url, uploadFileUrl) {
const params = {
id: this.info.orderDeliveryId,
signFileUrl: url
signFileUrl: url,
uploadFileUrl: uploadFileUrl
}
this.btnLoading = true
console.log(params, 'params----')
......@@ -261,8 +350,6 @@ export default {
opacity: 1 !important;
}
.table-wrap {
border: 1px solid #e5e5e5;
padding: 16px;
box-sizing: border-box;
margin-top: 16px;
......@@ -274,8 +361,9 @@ export default {
.sign-box-wrap {
display: flex;
justify-content: space-between;
height: 226px;
margin: 24px auto 19px;
padding-bottom: 20px;
border-bottom: 1px solid #e5e5e5;
}
.preset-box {
width: calc(100% - 640px);
......@@ -302,6 +390,61 @@ export default {
border: 1px solid #5850ff;
}
}
.upload-module {
margin-top: 26px;
.upload-form-item {
margin-bottom: 0;
display: flex;
::v-deep .el-form-item__content {
margin-left: 0 !important;
}
::v-deep .el-form-item__label {
color: #333333;
font-size: 14px;
padding: 0px;
}
::v-deep .el-form-item__label:before {
margin-right: 4px;
}
}
.upload-content {
.upload-tip {
color: #999999;
font-size: 14px;
margin-top: 10px;
}
::v-deep .el-upload--picture-card {
box-sizing: border-box;
width: 104px;
height: 104px;
border-radius: 4px;
opacity: 1;
border: 1px dashed #00000026;
background: #0000000a;
}
::v-deep .el-upload-list--picture-card .el-upload-list__item {
width: 104px;
height: 104px;
}
.upload-trigger-content {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
line-height: normal;
.el-icon-plus {
font-size: 20px;
color: #666666;
margin-bottom: 14px;
}
.upload-count {
font-size: 12px;
color: #666666;
}
}
}
}
.check-sign-img {
width: 640px;
height: 226px;
......
<template>
<div v-if="dialogShow">
<GLDialog bigTitle="详细信息" mode="big" :visible.sync="dialogShow" :close-on-click-modal="false">
<GLDialog bigTitle="入库信息" mode="big" :visible.sync="dialogShow" :close-on-click-modal="false">
<div class="detail-info">
<div>
发货单号:
......@@ -12,7 +12,8 @@
</div>
<div>
发货时间:
<span>{{ dayjs(detailInfo.deliveryDate).format('YYYY-MM-DD HH:mm:ss') }}</span>
<span v-if="detailInfo.deliveryDate">{{ detailInfo.deliveryDate ? dayjs(detailInfo.deliveryDate).format('YYYY-MM-DD HH:mm:ss') : '-' }}</span>
<span v-else>-</span>
</div>
</div>
<template v-for="(item, index) in detailInfo.deliveryDetailList">
......@@ -24,33 +25,25 @@
</div>
<div>
发货数量:
<span>{{ membraneTypeList.includes(item.goodsType) ? `${item.purchaseNumber}卷` : `${item.purchaseNumber}件`
}}</span>
<span class="lookNumber" @click="lookNumber(item.deliveryCardList)"
v-if="item.deliveryCardList && item.deliveryCardList.length > 0">查看卡号</span>
<span>{{ membraneTypeList.includes(item.goodsType) ? `${item.purchaseNumber}卷` : `${item.purchaseNumber}件`}}</span>
<span class="lookNumber" @click="lookNumber(item.deliveryCardList)" v-if="item.deliveryCardList && item.deliveryCardList.length > 0">查看卡号</span>
</div>
<div>
可用库存数量:
<span>{{ item.stockNum }}{{ membraneTypeList.includes(item.goodsType) ? `米` : `件` }}</span>
</div>
<div class="add-btn" @click="addLineTable(index)"
v-if="item.deliveryCardList === null || item.deliveryCardList.length == 0">添加入库记录</div>
<div class="add-btn" @click="addLineTable(index)" v-if="item.deliveryCardList === null || item.deliveryCardList.length == 0">添加入库记录</div>
</div>
<el-form ref="addForm" :model="item" size="small" :rules="rules"
v-if="item.deliveryCardList === null || item.deliveryCardList.length == 0">
<GLTable :tableData="item.goodsWarehousingList" :noDataImg="url" :tableParams="tableParams"
:hasPage="false">
<el-form ref="addForm" :model="item" size="small" :rules="rules" v-if="item.deliveryCardList === null || item.deliveryCardList.length == 0">
<GLTable :tableData="item.goodsWarehousingList" :noDataImg="url" :tableParams="tableParams" :hasPage="false">
<template slot="increaseStockNum" slot-scope="scope">
<el-form-item style="margin-bottom: 0px"
:prop="'goodsWarehousingList.' + scope.index + '.increaseStockNum'" :rules="rules.increaseStockNum">
<el-input v-model="scope.scope.increaseStockNum" placeholder="请输入"
@blur="handleCalculate(scope.scope, 'increaseStockNum', index)"></el-input>
<el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.increaseStockNum'" :rules="rules.increaseStockNum">
<el-input v-model="scope.scope.increaseStockNum" placeholder="请输入" @blur="handleCalculate(scope.scope, 'increaseStockNum', index)"></el-input>
</el-form-item>
</template>
<template slot="film" slot-scope="scope">
<div v-if="manageMode && filmTypeList.includes(detailInfo.goodsType)">
<el-button v-if="!scope.scope.filmRollList" type="text"
@click="handleSelectFilm(scope.scope, index, scope.index)">请选择</el-button>
<el-button v-if="!scope.scope.filmRollList" type="text" @click="handleSelectFilm(scope.scope, index, scope.index)">请选择</el-button>
<div v-else>
<span class="film-txt">...({{ scope.scope.filmRollList.length }})</span>
<el-button type="text" @click="handleSelectFilm(scope.scope, index, scope.index)">重新选择</el-button>
......@@ -60,23 +53,17 @@
</template>
<!-- 入库仓库 -->
<template slot="yqMerchantId" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.yqMerchantId'"
:rules="rules.shopMerchantName">
<el-select style="width: 100%" v-model="scope.scope.yqMerchantId" placeholder="请选择"
@change="handleSelect(scope.scope, scope.scope.yqMerchantId)">
<el-option v-for="item in storeUsageList" :key="item.merchantNo" :label="item.merchantName"
:value="item.merchantNo"></el-option>
<el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.yqMerchantId'" :rules="rules.shopMerchantName">
<el-select style="width: 100%" v-model="scope.scope.yqMerchantId" placeholder="请选择" @change="handleSelect(scope.scope, scope.scope.yqMerchantId)">
<el-option v-for="item in storeUsageList" :key="item.merchantNo" :label="item.merchantName" :value="item.merchantNo"></el-option>
</el-select>
</el-form-item>
</template>
<!-- 入库门店 -->
<template slot="merchantId" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.merchantId'"
:rules="rules.merchantId">
<el-select style="width: 100%" v-model="scope.scope.merchantId" placeholder="请选择"
@change="handleStoreSelect(scope.scope, scope.scope.merchantId)">
<el-option v-for="item in refByYqShopList" :key="item.merchantId" :label="item.merchantName"
:value="item.merchantId"></el-option>
<el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.merchantId'" :rules="rules.merchantId">
<el-select style="width: 100%" v-model="scope.scope.merchantId" placeholder="请选择" @change="handleStoreSelect(scope.scope, scope.scope.merchantId)">
<el-option v-for="item in refByYqShopList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId"></el-option>
</el-select>
</el-form-item>
</template>
......@@ -89,8 +76,7 @@
</div>
</template>
<el-dialog width="750px" title="查看发货卡号" :visible.sync="innerVisible" append-to-body>
<GLTable class="look-card-wrap" :tableData="tableData" :noDataImg="url" :tableParams="innerParams"
:hasPage="false">
<GLTable class="look-card-wrap" :tableData="tableData" :noDataImg="url" :tableParams="innerParams" :hasPage="false">
</GLTable>
</el-dialog>
<span slot="footer" class="dialog-footer">
......@@ -481,7 +467,7 @@ export default {
}
.look-card-wrap {
::v-deep.el-table th.el-table__cell>.cell {
::v-deep.el-table th.el-table__cell > .cell {
padding: 0 16px;
text-align: center;
}
......
<template>
<GLDialog v-if="dialogShow" bigTitle="详细信息" mode="big" :visible.sync="dialogShow" :close-on-click-modal="false"
:hasFooter="false">
<GLDialog v-if="dialogShow" bigTitle="详细信息" mode="big" :visible.sync="dialogShow" :close-on-click-modal="false" :hasFooter="false">
<div class="detail-info">
<div>
发货单号:
......@@ -12,9 +11,16 @@
</div>
<div>
发货时间:
<span>{{ dayjs(detailInfo.deliveryDate).format('YYYY-MM-DD HH:mm:ss') }}</span>
<span>{{ detailInfo.deliveryDate ? dayjs(detailInfo.deliveryDate).format('YYYY-MM-DD HH:mm:ss') : '-' }}</span>
</div>
</div>
<div class="detail-info m-t-16" style="justify-content: flex-start; align-items: flex-start;">
签收凭证:
<div v-if="detailInfo.uploadFileUrl">
<el-image v-for="(url, index) in detailInfo.uploadFileUrl.split(',')" :key="index" :src="url" :preview-src-list="detailInfo.uploadFileUrl.split(',')" style="width: 36px; height: 36px; margin-right: 8px; cursor: pointer;" class="sign-image" fit="cover" />
</div>
<div v-else>-</div>
</div>
<!-- <template v-for="(item, index) in detailInfo.deliveryDetailList"> -->
<div class="table-wrap">
<div class="detail-info">
......@@ -26,18 +32,15 @@
发货数量:
<span>{{ membraneTypeList.includes(detailInfo.goodsType) ? `${detailInfo.purchaseNumber}卷` :
`${detailInfo.purchaseNumber}件` }}</span>
<span class="lookNumber" @click="lookNumber(detailInfo.deliveryCardList)"
v-if="detailInfo.deliveryCardList && detailInfo.deliveryCardList.length > 0">查看卡号</span>
<span class="lookNumber" @click="lookNumber(detailInfo.deliveryCardList)" v-if="detailInfo.deliveryCardList && detailInfo.deliveryCardList.length > 0">查看卡号</span>
</div>
<div>
可用库存数量:
<span>{{ detailInfo.stockNum }}{{ membraneTypeList.includes(detailInfo.goodsType) ? `米` : `件` }}</span>
</div>
</div>
<el-form ref="addForm" :model="detailInfo" size="small"
v-if="detailInfo.deliveryCardList === null || detailInfo.deliveryCardList.length == 0">
<GLTable :tableData="detailInfo.goodsWarehousingList" :noDataImg="url" :tableParams="tableParams"
:hasPage="false">
<el-form ref="addForm" :model="detailInfo" size="small" v-if="detailInfo.deliveryCardList === null || detailInfo.deliveryCardList.length == 0">
<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> -->
<span>{{ scope.scope.increaseStockNum || scope.scope.increaseStockNum == 0 ?
......@@ -62,8 +65,7 @@
</div>
<!-- </template> -->
<el-dialog width="750px" title="查看发货卡号" :visible.sync="innerVisible" append-to-body>
<GLTable class="look-card-wrap" :tableData="tableData" :noDataImg="url" :tableParams="innerParams"
:hasPage="false">
<GLTable class="look-card-wrap" :tableData="tableData" :noDataImg="url" :tableParams="innerParams" :hasPage="false">
</GLTable>
</el-dialog>
</GLDialog>
......@@ -143,9 +145,9 @@ export default {
detailInfo: {}
}
},
created() {
created() {
this.getManageMode()
},
},
methods: {
handleDetailClose() {
this.dialogShow = false
......@@ -188,6 +190,9 @@ export default {
font-size: 14px;
margin-bottom: 16px;
.m-t-16 {
margin-bottom: 16px;
}
span {
color: #333333ff;
}
......@@ -203,7 +208,6 @@ export default {
border: 1px solid #e5e5e5;
padding: 16px;
box-sizing: border-box;
margin-top: 16px;
::v-deep .el-form-item__error {
padding-top: 2px;
......@@ -224,7 +228,7 @@ export default {
overflow-y: scroll;
overflow-x: hidden;
::v-deep.el-table th.el-table__cell>.cell {
::v-deep.el-table th.el-table__cell > .cell {
padding: 0 16px;
text-align: center;
}
......
......@@ -12,6 +12,12 @@
<!-- 表格区域 开始 -->
<GLTable ref="orderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="uploadFileUrl" slot-scope="scope">
<div v-if="scope.scope.uploadFileUrl">
<el-image :src="scope.scope.uploadFileUrl.split(',')[0]" fit="fill" :preview-src-list="scope.scope.uploadFileUrl.split(',')" style="width: 36px; height: 36px;"></el-image>
</div>
<div v-else>--</div>
</template>
<template slot="putStatus" slot-scope="scope">
<div>
<span :class="[scope.scope.putStatus == 1 ? 'ashSpot' : scope.scope.putStatus == 2 ? 'greenSpot' : 'yellowSpot']"></span>
......@@ -48,7 +54,7 @@ import DeliverAdd from './deliverAdd'
import DeliverDetail from './deliverDetail'
import SignDialog from './SignDialog'
import { membraneTypeList } from '@/utils/constants.js'
import { defaultStatusOptions, defaultDeliveryStatusOptions, defaultPutStatusOptions, purchaseTypeList } from '@/utils/constants.js'
import { defaultStatusOptions, defaultDeliveryStatusOptions, defaultPutStatusOptions, purchaseTypeList, orderTypeOptions } from '@/utils/constants.js'
export default {
name: 'PurchaseOrder',
components: {
......@@ -76,7 +82,8 @@ export default {
putStatus: '',
orderCode: this.$route.query.orderCode ? this.$route.query.orderCode : '',
merchantName: '',
placeOrderTimeStr: ''
placeOrderTimeStr: '',
orderType: ''
},
tableSearchForm: {},
id: '',
......@@ -94,7 +101,7 @@ export default {
maxlength: 100
},
{
label: '商品编号',
label: '商品编码',
name: 'type',
type: 'input',
isClear: true,
......@@ -158,6 +165,15 @@ export default {
optionId: 'id',
optionLabel: 'label',
optionsName: 'defaultPutStatusOptions'
},
{
label: '订单类型',
name: 'orderType',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'label',
optionsName: 'orderTypeOptions'
}
],
tableButtonList: [
......@@ -211,14 +227,22 @@ export default {
},
tableColumns: [
{
label: '订单类型',
prop: 'orderType',
width: '120px',
formatter: cellValue => {
return orderTypeOptions.find(item => item.id == cellValue.orderType)?.label || '--'
}
},
{
label: '商品名称',
prop: 'upgradeGoodsName',
width: '120px'
width: '120px'
},
{
label: '商品编码',
prop: 'type',
width: '120px'
width: '140px'
},
{
label: '规格',
......@@ -237,12 +261,12 @@ export default {
{
label: '所属分类',
prop: 'goodsTypeName',
width: '120px'
width: '120px'
},
{
label: '发货数量',
prop: '',
width: '120px',
width: '120px',
formatter: cellValue => {
return membraneTypeList.includes(cellValue.goodsType) ? `${cellValue.purchaseNumber}卷` : `${cellValue.purchaseNumber}件`
}
......@@ -258,7 +282,7 @@ export default {
{
label: '承运单号',
prop: 'deliveryNumber',
width: '120px',
width: '120px',
formatter: cellValue => {
return cellValue.deliveryNumber || '--'
}
......@@ -266,7 +290,7 @@ export default {
{
label: '承运公司',
prop: 'deliveryCompany',
width: '120px',
width: '120px',
formatter: cellValue => {
return cellValue.deliveryCompany || '--'
}
......@@ -288,7 +312,7 @@ export default {
{
label: '所属商户',
prop: 'merchantName',
width: '120px'
width: '120px'
},
{
label: '备注',
......@@ -296,9 +320,33 @@ export default {
width: 150
},
{
label: '收货人',
prop: 'contactName',
width: 150,
line: 1
},
{
label: '收货人电话',
prop: 'contactPhone',
width: 200,
line: 1
},
{
label: '收货地址',
prop: 'contactAddress',
width: 150,
line: 1
},
{
label: '凭证',
prop: 'uploadFileUrl',
width: 150,
addHtml: 'uploadFileUrl'
},
{
label: '状态',
prop: 'putStatus',
width: '120px',
width: '120px',
addHtml: 'putStatus'
}
]
......@@ -309,6 +357,7 @@ export default {
defaultStatusOptions: defaultStatusOptions,
defaultDeliveryStatusOptions: defaultDeliveryStatusOptions,
defaultPutStatusOptions: defaultPutStatusOptions,
orderTypeOptions: orderTypeOptions,
merchantName: [],
storeUsageList: [],
purchaseTypeList: purchaseTypeList,
......@@ -447,7 +496,8 @@ export default {
putStatus: '',
orderCode: '',
merchantName: '',
placeOrderTimeStr: ''
placeOrderTimeStr: '',
orderType: ''
}
this.handleSearch()
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!