Commit fc1a0be9 by chenwq

feat(发货单): 添加签收功能并集成vue-signature-pad

- 新增签收对话框组件SignDialog.vue,包含签名板功能
- 在发货单列表页添加签收按钮和相关逻辑
- 安装并配置vue-signature-pad依赖
- 调整表格列宽和样式优化
1 parent c277f808
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
"glsx-components": "^1.5.7", "glsx-components": "^1.5.7",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vue-signature-pad": "^2.0.5",
"vuex": "^3.1.2" "vuex": "^3.1.2"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -14,6 +14,8 @@ import './public-path' ...@@ -14,6 +14,8 @@ import './public-path'
import '@/assets/css/public.scss' import '@/assets/css/public.scss'
import '@/components' import '@/components'
import '@/filter' import '@/filter'
import VueSignaturePad from 'vue-signature-pad'
Vue.use(VueSignaturePad)
// import 'glsx-components/dist/glsx-components.css' // import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup' import { start } from '@/setup'
Vue.config.productionTip = false Vue.config.productionTip = false
......
<template>
<GLDialog v-if="dialogShow" bigTitle="详细信息" mode="big" :visible.sync="dialogShow" :close-on-click-modal="false" :hasFooter="false">
<div class="detail-info">
<div>
发货单号:
<span>{{ detailInfo.deliveryNumber }}</span>
</div>
<div>
承运公司:
<span>{{ detailInfo.deliveryCompany }}</span>
</div>
<div>
发货时间:
<span>{{ dayjs(detailInfo.deliveryDate).format('YYYY-MM-DD HH:mm:ss') }}</span>
</div>
</div>
<!-- <template v-for="(item, index) in detailInfo.deliveryDetailList"> -->
<div class="table-wrap">
<div class="detail-info">
<div>
商品名称:
<span>{{ detailInfo.upgradeGoodsName }}&nbsp;&nbsp; {{ detailInfo.specificationData }}</span>
</div>
<div>
发货数量:
<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>
</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">
<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 ?
(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>
</GLTable>
</el-form>
<div v-else class="message">
已自动入库至商户的权益卡管理中,可前往“库存管理-权益卡管理”中查询
</div>
<div class="sign-box">
<div class="red-txt">*请在区域内签字完成</div>
<div class="background-text">点击开始签字</div>
<div class="signature-container">
<VueSignaturePad width="100%" height="100%" ref="signaturePad" :options="options" />
</div>
<div class="btns">
<el-button type="text" size="mini" @click="save">保存</el-button>
<el-button type="text" size="mini" @click="clear">清除</el-button>
<el-button type="text" size="mini" @click="undo">撤销</el-button>
</div>
</div>
</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>
</el-dialog>
</GLDialog>
</template>
<script>
import * as dayjs from 'dayjs'
import { membraneTypeList } from '@/utils/constants.js'
export default {
name: 'DeliverAdd',
props: {
visible: {
type: Boolean,
default: false
},
info: {
type: Object,
default: () => { }
}
},
computed: {
dialogShow: {
get() {
if (this.visible) {
this.getDetail()
}
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
},
data() {
return {
innerVisible: false,
options: {
penColor: '#000',
minWidth: 1,
maxWidth: 2,
dotSize: 1,
velocityFilterWeight: 0.7,
backgroundColor: 'rgba(255, 255, 255, 0.0)'
},
membraneTypeList: membraneTypeList,
dayjs: dayjs,
goodsList: [],
storeUsageList: [],
refByYqShopList: [],
tableParams: {
tableOption: false,
tableColumns: [
{
label: '入库数量',
prop: 'increaseStockNum',
addHtml: 'increaseStockNum'
},
{
label: '入库仓库',
prop: 'yqMerchantName'
},
{
label: '入库门店',
prop: 'merchantName'
}
]
},
innerParams: {
tableOption: false,
tableColumns: [
{
label: '卡号',
prop: 'cardNum',
width: 630
}
]
},
tableData: [],
detailInfo: {}
}
},
created() { },
methods: {
undo() {
this.$refs.signaturePad.undoSignature()
},
clear() {
this.$refs.signaturePad.clearSignature()
},
save() {
// if (!this.$refs.signaturePad) {
// this.$message.warning('签名组件未加载')
// return
// }
const { isEmpty, data } = this.$refs.signaturePad.saveSignature()
if (isEmpty) {
this.$message({
message: '请先完成签名',
type: 'warning',
customClass: 'message-Z-zinde'
})
return
}
console.log(data, '保存图片----')
const base64 = 'png@' + data.split('base64,')[1]
this.$apis.sysBase.uploadImg({ file: base64, fileType: 'image' }).then(res => {
console.log(res, 'res----')
})
},
handleDetailClose() {
this.dialogShow = false
},
getDetail() {
this.$apis.delivery.getDeliveryDetail({ id: this.info.id }).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
}
})
},
lookNumber(data) {
this.innerVisible = true
this.tableData = data.map(item => {
return { cardNum: item }
})
}
}
}
</script>
<style lang="scss" scoped>
.detail-info {
display: flex;
align-items: center;
justify-content: space-between;
color: #666666ff;
font-size: 14px;
margin-bottom: 16px;
span {
color: #333333ff;
}
.add-btn {
font-size: 14px;
color: #5850ff;
cursor: pointer;
}
}
.table-wrap {
border: 1px solid #e5e5e5;
padding: 16px;
box-sizing: border-box;
margin-top: 16px;
::v-deep .el-form-item__error {
padding-top: 2px;
z-index: 9999999;
position: static;
}
.sign-box {
position: relative;
width: 640px;
height: 226px;
border-radius: 4px;
opacity: 1;
border: 1px solid #e5e5e5;
background: #fafafa;
margin: 24px auto 19px;
.signature-container {
position: relative;
width: 640px;
height: 226px;
}
.background-text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
text-align: center;
color: #ededed;
font-size: 88px;
pointer-events: none;
letter-spacing: 8px;
}
::v-deep .vue-signature-pad {
position: relative;
z-index: 2;
}
.red-txt {
position: absolute;
top: 8px;
left: 262.5px;
text-align: center;
color: #eb4e4e;
font-size: 12px;
}
.btns {
position: absolute;
bottom: 8px;
right: 12px;
display: flex;
flex-direction: row-reverse;
.el-button--mini {
margin-left: 0px !important;
}
}
}
}
.lookNumber {
font-size: 14px;
color: #5850ff !important;
cursor: pointer;
margin-left: 8px;
}
.look-card-wrap {
max-height: 600px;
overflow-y: scroll;
overflow-x: hidden;
::v-deep.el-table th.el-table__cell > .cell {
padding: 0 16px;
text-align: center;
}
::v-deep.el-table__body td.el-table__cell {
text-align: center;
}
}
</style>
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
<template> <template>
<div class="purchase"> <div class="purchase">
<div class="container"> <div class="container">
<GLCombiForm ref="showSearch" :rowNumber="2" :formObj="searchForm" :formData="showFormData" <GLCombiForm ref="showSearch" :rowNumber="2" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
@handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header"> <div class="table-header">
<h2>发货单列表</h2> <h2>发货单列表</h2>
<div> <div>
...@@ -12,20 +11,17 @@ ...@@ -12,20 +11,17 @@
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="orderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" <GLTable ref="orderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
:tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun">
<template slot="putStatus" slot-scope="scope"> <template slot="putStatus" slot-scope="scope">
<div> <div>
<span <span :class="[scope.scope.putStatus == 1 ? 'ashSpot' : scope.scope.putStatus == 2 ? 'greenSpot' : 'yellowSpot']"></span>
:class="[scope.scope.putStatus == 1 ? 'ashSpot' : scope.scope.putStatus == 2 ? 'greenSpot' : 'yellowSpot']"></span>
<span>{{ scope.scope.putStatus | puStatus }}</span> <span>{{ scope.scope.putStatus | puStatus }}</span>
</div> </div>
</template> </template>
<template slot="carName" slot-scope="scope"> <template slot="carName" slot-scope="scope">
<!-- <div>{{ JSON.stringify(scope.scope.suitCarTypeList) }}</div> --> <!-- <div>{{ JSON.stringify(scope.scope.suitCarTypeList) }}</div> -->
<el-tooltip v-if="scope.scope.suitCarTypeList && scope.scope.suitCarTypeList.length" placement="top"> <el-tooltip v-if="scope.scope.suitCarTypeList && scope.scope.suitCarTypeList.length" placement="top">
<div slot="content"> <div slot="content" style="max-height: 200px; overflow-y: scroll;">
<div v-for="(item, index) in scope.scope.suitCarTypeList" :key="index">{{ item.carTypeName }}</div> <div v-for="(item, index) in scope.scope.suitCarTypeList" :key="index">{{ item.carTypeName }}</div>
</div> </div>
<div>{{ scope.scope.suitCarTypeList | formatCar }}</div> <div>{{ scope.scope.suitCarTypeList | formatCar }}</div>
...@@ -40,6 +36,7 @@ ...@@ -40,6 +36,7 @@
</div> </div>
<deliver-add v-if="addVisible" :visible.sync="addVisible" :id="id" @handleSuccess="handleSearch"></deliver-add> <deliver-add v-if="addVisible" :visible.sync="addVisible" :id="id" @handleSuccess="handleSearch"></deliver-add>
<deliver-detail :visible.sync="detailVisible" :id="id"></deliver-detail> <deliver-detail :visible.sync="detailVisible" :id="id"></deliver-detail>
<sign-dialog v-if="signVisible" :visible.sync="signVisible" :info="signInfo" @refresh="handleSearch"></sign-dialog>
</div> </div>
</template> </template>
...@@ -48,13 +45,15 @@ import * as dayjs from 'dayjs' ...@@ -48,13 +45,15 @@ import * as dayjs from 'dayjs'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import DeliverAdd from './deliverAdd' import DeliverAdd from './deliverAdd'
import DeliverDetail from './deliverDetail' import DeliverDetail from './deliverDetail'
import SignDialog from './SignDialog'
import { membraneTypeList } from '@/utils/constants.js' import { membraneTypeList } from '@/utils/constants.js'
import { defaultStatusOptions, defaultDeliveryStatusOptions, defaultPutStatusOptions, purchaseTypeList } from '@/utils/constants.js' import { defaultStatusOptions, defaultDeliveryStatusOptions, defaultPutStatusOptions, purchaseTypeList } from '@/utils/constants.js'
export default { export default {
name: 'PurchaseOrder', name: 'PurchaseOrder',
components: { components: {
DeliverAdd, DeliverAdd,
DeliverDetail DeliverDetail,
SignDialog
}, },
filters: { filters: {
formatCar(list) { formatCar(list) {
...@@ -83,6 +82,8 @@ export default { ...@@ -83,6 +82,8 @@ export default {
// 查看门店 // 查看门店
addVisible: false, addVisible: false,
detailVisible: false, detailVisible: false,
signVisible: false,
signInfo: {},
showFormData: [ showFormData: [
{ {
label: '商品名称', label: '商品名称',
...@@ -184,6 +185,17 @@ export default { ...@@ -184,6 +185,17 @@ export default {
listeners: { listeners: {
click: this.handleWarehousing click: this.handleWarehousing
} }
},
{
type: 'GLButton',
name: '签收',
attrs: {
type: 'text',
fn: '签收'
},
listeners: {
click: this.handleSign
}
} }
], ],
// 表格 // 表格
...@@ -210,7 +222,7 @@ export default { ...@@ -210,7 +222,7 @@ export default {
{ {
label: '适用车型', label: '适用车型',
addHtml: 'carName', addHtml: 'carName',
width: 200, width: 200
}, },
{ {
label: '系列', label: '系列',
...@@ -253,13 +265,15 @@ export default { ...@@ -253,13 +265,15 @@ export default {
{ {
label: '发货时间', label: '发货时间',
prop: 'deliveryDate', prop: 'deliveryDate',
width: '180px',
formatter: cellValue => { formatter: cellValue => {
return cellValue.deliveryDate ? dayjs(cellValue.deliveryDate).format('YYYY-MM-DD HH:mm:ss') : '--' return cellValue.deliveryDate ? dayjs(cellValue.deliveryDate).format('YYYY-MM-DD HH:mm:ss') : '--'
} }
}, },
{ {
label: '所属订单', label: '所属订单',
prop: 'orderCode' prop: 'orderCode',
width: '170px'
}, },
{ {
label: '所属商户', label: '所属商户',
...@@ -326,6 +340,14 @@ export default { ...@@ -326,6 +340,14 @@ export default {
}) })
}, },
signVisibleChange() {
this.signVisible = !this.signVisible
},
handleSign(row) {
this.signInfo = row
this.signVisibleChange()
},
// 入库 // 入库
handleWarehousing(row) { handleWarehousing(row) {
this.id = row.id 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!