Commit b0e83a1a by 前端

Merge branch 'SAAS+V5.6.2' into 'master'

上线合并

See merge request !32
2 parents 3cfcef6f 5bec247a
......@@ -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-preview="handlePictureCardPreview" :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">
......@@ -53,6 +67,7 @@
<el-button type="primary" size="small" style="margin-left: 10px;" @click="save" v-loading="loading || btnLoading">确定</el-button>
</span>
</template>
<el-image ref="previewImg" :preview-src-list="previewSrcList" :src="''" style="display: none;"></el-image>
</GLDialog>
</template>
......@@ -86,6 +101,7 @@ export default {
},
data() {
return {
previewSrcList: [],
options: {
penColor: '#000',
minWidth: 1,
......@@ -119,7 +135,7 @@ export default {
label: '发货数量',
prop: '',
formatter: cellValue => {
return membraneTypeList.includes(cellValue.goodsType) ? `${cellValue.purchaseNumber}卷` : `${cellValue.purchaseNumber}件`
return membraneTypeList.includes(cellValue.goodsType) ? this.detailInfo.orderType == 1 ? `${cellValue.purchaseNumber}米` : `${cellValue.purchaseNumber}卷` : `${cellValue.purchaseNumber}件`
}
},
{
......@@ -132,16 +148,103 @@ 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
const typeList = ['image/jpeg', 'image/png', 'image/jpg']
const isType = typeList.includes(file.type)
if (!isType) {
this.$message({
message: '上传凭证只能是 jpg, jpeg, png 格式!',
type: 'error',
customClass: 'message-Z-zinde'
})
}
if (!isLt2M) {
this.$message({
message: '上传图片大小不能超过 2MB!',
type: 'error',
customClass: 'message-Z-zinde'
})
}
return isLt2M && isType
},
handlePictureCardPreview(file) {
const urlList = this.uploadFileList.map(item => item.url)
const index = urlList.findIndex(url => url === file.url)
// 将当前点击的图片排在第一位,其余依次向后排列
this.previewSrcList = [...urlList.slice(index), ...urlList.slice(0, index)]
this.$nextTick(() => {
this.$refs.previewImg.clickHandler()
})
},
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 +253,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 +265,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 +303,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 +371,6 @@ export default {
opacity: 1 !important;
}
.table-wrap {
border: 1px solid #e5e5e5;
padding: 16px;
box-sizing: border-box;
margin-top: 16px;
......@@ -274,8 +382,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 +411,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>
<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-b-33" 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">
......@@ -24,26 +30,23 @@
</div>
<div>
发货数量:
<span>{{ membraneTypeList.includes(detailInfo.goodsType) ? `${detailInfo.purchaseNumber}卷` :
<span>{{ membraneTypeList.includes(detailInfo.goodsType) ?detailInfo.orderType == 1 ? `${detailInfo.purchaseNumber}米` : `${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 ?
(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>
(membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') : '-' }}</span>
</template>
<template slot="film" slot-scope="scope">
<div v-if="manageMode && membraneTypeList.includes(scope.scope.goodsType)">
......@@ -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
......@@ -187,7 +189,6 @@ export default {
color: #666666ff;
font-size: 14px;
margin-bottom: 16px;
span {
color: #333333ff;
}
......@@ -199,11 +200,14 @@ export default {
}
}
.m-b-33 {
margin-bottom: 33px;
}
.table-wrap {
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,14 +261,14 @@ 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}件`
return membraneTypeList.includes(cellValue.goodsType) ? cellValue.orderType == 1 ? `${cellValue.purchaseNumber}米` : `${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!