Commit ccd0c276 by 前端

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

上线合并

See merge request !41
2 parents 41963209 3b5be850
......@@ -102,4 +102,29 @@ const getSignList = params => {
})
}
export default { getTypeList, getDeliveryList, addPurchaseOrder, exportExcel, getDeliveryDetail, deliverySignDetail, deliverySign, getSignList }
\ No newline at end of file
// 下载凭证
const downloadLabelCode = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.labelCode.download'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const queryScanConfigByYq = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.scenemerchantref.queryScanConfigByYq'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { queryScanConfigByYq,getTypeList, getDeliveryList, addPurchaseOrder, exportExcel, getDeliveryDetail, deliverySignDetail, deliverySign, getSignList, downloadLabelCode }
\ No newline at end of file
......@@ -32,14 +32,16 @@
</div>
<div>
发货数量:
<span>{{ membraneTypeList.includes(item.goodsType) ?item.orderType == 1 ? `${item.purchaseNumber}米` : `${item.purchaseNumber}卷` : `${item.purchaseNumber}件`}}</span>
<span>{{ membraneTypeList.includes(item.goodsType) ? (item.orderType == 1 ? `${item.purchaseNumber}米` : `${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) && detailInfo.orderType != 1">添加入库记录</div>
<div class="add-btn" @click="addLineTable(index)" v-if="(item.deliveryCardList === null || item.deliveryCardList.length == 0) && detailInfo.orderType != 1">
添加入库记录
</div>
</div>
<div v-if="detailInfo.orderType != 1">
<el-form ref="addForm" :model="item" size="small" :rules="rules" v-if="item.deliveryCardList === null || item.deliveryCardList.length == 0">
......@@ -61,7 +63,7 @@
</template>
<!-- 入库仓库 -->
<template slot="yqMerchantId" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.yqMerchantId'" :rules="rules.shopMerchantName">
<el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.yqMerchantId'" :rules="rules.shopMerchantName" filterable>
<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>
......@@ -69,7 +71,7 @@
</template>
<!-- 入库门店 -->
<template slot="merchantId" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.merchantId'" :rules="rules.merchantId">
<el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.merchantId'" :rules="rules.merchantId" filterable>
<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>
......@@ -85,9 +87,7 @@
<GLTable v-else :tableData="item.goodsWarehousingList" :noDataImg="url" :tableParams="tableParams" :hasPage="false">
<template slot="increaseStockNum" slot-scope="scope">
<!-- <span>{{ membraneTypeList.includes(detailInfo.goodsType) ? `${scope.scope.increaseStockNum}米` : `${scope.scope.increaseStockNum}件` }}</span> -->
<span>{{ scope.scope.increaseStockNum || scope.scope.increaseStockNum == 0 ?
parseFloat(scope.scope.increaseStockNum).toFixed(2) +
(membraneTypeList.includes(detailInfo.goodsType) ? '米' : '件') : '-' }}</span>
<span>{{ scope.scope.increaseStockNum || scope.scope.increaseStockNum == 0 ? parseFloat(scope.scope.increaseStockNum).toFixed(2) + (membraneTypeList.includes(detailInfo.goodsType) ? '米' : '件') : '-' }}</span>
</template>
<template slot="film" slot-scope="scope">
<div>
......@@ -107,16 +107,14 @@
</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>
<GLTable class="look-card-wrap" :tableData="tableData" :noDataImg="url" :tableParams="innerParams" :hasPage="false"></GLTable>
</el-dialog>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogShow = false">关闭</el-button>
<el-button type="primary" size="small" @click="beforeSave" :loading="loading">保存入库</el-button>
</span>
</GLDialog>
<filmDialog :visible.sync="filmVisible" :info="info" maxAddNumAttr="stockAddNum" @handleConfirm="handleFilmConfirm">
</filmDialog>
<filmDialog :visible.sync="filmVisible" :info="info" maxAddNumAttr="stockAddNum" @handleConfirm="handleFilmConfirm"></filmDialog>
</div>
</template>
<script>
......@@ -263,6 +261,10 @@ export default {
deliveryDetailList.forEach(item => {
item.goodsWarehousingList[0].yqMerchantName = storeUsageList[0].merchantName
item.goodsWarehousingList[0].yqMerchantId = storeUsageList[0].merchantNo
if (this.detailInfo.orderType != 1) {
item.goodsWarehousingList[0].merchantName = storeUsageList[0].merchantName
item.goodsWarehousingList[0].merchantId = storeUsageList[0].merchantNo
}
})
this.getRefByYqShopList(deliveryDetailList[0].goodsWarehousingList[0], storeUsageList[0].merchantNo)
},
......@@ -334,10 +336,11 @@ export default {
orderCode: data.orderCode,
orderDeliveryId: data.orderDeliveryId,
upgradeGoodsId: data.upgradeGoodsId,
orderType:data.orderType,
orderType: data.orderType,
goodsWarehousingList: [
//orderType:调拨1、采购0
{
increaseStockNum: data.orderType == 1 ? data.stockNum : '',
increaseStockNum: data.orderType == 1 ? data.stockNum : data.purchaseNumber,
yqMerchantId: data.orderType == 1 ? data.callInYqMerchantId : '',
yqMerchantName: data.orderType == 1 ? data.callInYqMerchantName : '',
merchantId: data.orderType == 1 ? data.callInMerchantId : '',
......@@ -496,6 +499,7 @@ export default {
color: #666666ff;
font-size: 14px;
margin-bottom: 16px;
span {
color: #333333ff;
}
......
......@@ -30,8 +30,7 @@
</div>
<div>
发货数量:
<span>{{ membraneTypeList.includes(detailInfo.goodsType) ?detailInfo.orderType == 1 ? `${detailInfo.purchaseNumber}米` : `${detailInfo.purchaseNumber}卷` :
`${detailInfo.purchaseNumber}件` }}</span>
<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>
</div>
<div>
......@@ -43,10 +42,7 @@
<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>
<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) ? (detailInfo.orderType == 1 ? '米' : '卷') : '件') : '-' }}</span>
</template>
<template slot="film" slot-scope="scope">
<div v-if="manageMode && membraneTypeList.includes(scope.scope.goodsType)">
......@@ -65,8 +61,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>
<GLTable class="look-card-wrap" :tableData="tableData" :noDataImg="url" :tableParams="innerParams" :hasPage="false"></GLTable>
</el-dialog>
</GLDialog>
</template>
......
......@@ -54,6 +54,7 @@ import DeliverDetail from './deliverDetail'
import SignDialog from './SignDialog'
import { membraneTypeList } from '@/utils/constants.js'
import { defaultStatusOptions, defaultDeliveryStatusOptions, defaultPutStatusOptions, purchaseTypeList, orderTypeOptions } from '@/utils/constants.js'
// import { saveAs } from 'file-saver'
export default {
name: 'PurchaseOrder',
components: {
......@@ -74,6 +75,7 @@ export default {
},
data() {
return {
scanEnable: 0,
size: 'small',
url: url,
searchForm: {
......@@ -198,7 +200,7 @@ export default {
fn: '入库'
},
condition: row => {
return row.putStatus == 1 || row.putStatus == 3
return this.scanEnable == 0 && (row.putStatus == 1 || row.putStatus == 3)
},
listeners: {
click: this.handleWarehousing
......@@ -218,6 +220,21 @@ export default {
listeners: {
click: this.handleSign
}
},
{
type: 'GLButton',
name: '下载凭证',
attrs: {
type: 'text',
fn: '下载凭证'
},
condition: row => {
return this.scanEnable == 1 && row.putStatus == 1
},
listeners: {
click: this.handleDownload
}
}
],
// 表格
......@@ -225,7 +242,7 @@ export default {
tableParams: {
listName: 'list',
tableOption: {
width: '110px'
width: '180'
},
tableColumns: [
{
......@@ -367,7 +384,9 @@ export default {
}
}
},
created() {
this.queryScanConfigByYq()
},
mounted() {
this.getOptionsList('showFormData')
this.getTypeList()
......@@ -379,6 +398,34 @@ export default {
},
methods: {
queryScanConfigByYq() {
this.$apis.delivery.queryScanConfigByYq({ merchantId: this.$globalState?.session?.merchantId }).then(res => {
if (res.code == 0) {
this.scanEnable = res.data.scanEnable
}
})
},
handleDownload(row) {
const params = {
deliveryDetailId:row.id,
upgradeGoodsId: row.upgradeGoodsId, // sku编码
businessCode: row.orderCode // 采购订单号
}
this.$apis.delivery.downloadLabelCode(params).then(res => {
if (res.code == 0) {
const downloadUrl = res.data
const link = document.createElement('a')
link.style.display = 'none'
link.href = downloadUrl
link.download = ''
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
} else {
this.$message.error(res.message)
}
})
},
getTypeList() {
this.$apis.delivery.getTypeList({}).then(res => {
this.baseData.goodsTypeOptions = res
......
......@@ -171,9 +171,13 @@ export default {
})
},
getSelectingList() {
console.log(this.upgradeGoodsInfo, 'this.upgradeGoodsInfo')
const upgradeGoodsId = this.upgradeGoodsInfo.upgradeGoodsId || this.upgradeGoodsInfo.id
if (!upgradeGoodsId) {
this.carLoading = false
return
}
this.carLoading = true
this.$apis.purchaseShopping.getCanSelectCarBrandList({ upgradeGoodsId: this.upgradeGoodsInfo.upgradeGoodsId || this.upgradeGoodsInfo.upgradeGoodsList[0].id }).then(res => {
this.$apis.purchaseShopping.getCanSelectCarBrandList({ upgradeGoodsId }).then(res => {
console.log(res, 'getSelectingList')
this.carLoading = false
this.options = res.data
......
<template>
<div>
<GLDialog destroy-on-close="true" :visible.sync="dialogShow" :hasFooter="false" mode="big" bigTitle="产品详情" :close-on-click-modal="false" @onOk="handleSubmit" @onCancel="handleDetailClose">
<GLDialog destroy-on-close="true" :visible.sync="dialogShow" :hasFooter="false" mode="big" bigTitle="产品详情"
:close-on-click-modal="false" @onOk="handleSubmit" @onCancel="handleDetailClose">
<div class="detail-content">
<!-- 商品详情 -->
<div class="goodsInfoCom">
......@@ -19,17 +20,22 @@
<span class="num">{{ goodsInfo.purchaseOrderCount || 0 }}笔</span>
</span>
</div>
<div class="productCode" v-if="goodsInfo.upgradeGoodsList && goodsInfo.upgradeGoodsList.length > 0">产品编码:{{ goodsInfo.upgradeGoodsList[selectIndex].type }}</div>
<div class="productCode" v-if="goodsInfo.upgradeGoodsList && goodsInfo.upgradeGoodsList.length > 0">产品编码:{{
goodsInfo.upgradeGoodsList[selectIndex].type }}</div>
<!--选择商品规格多规格 v-if="!isSkuArguments"-->
<div class="content fix-header fix-bottom" v-if="goodsInfo.specificationType == 2">
<div class="mask">
<div class="mask-content">
<div class="spec-items">
<div class="spec-menu-item js-spec-menu skuCon" v-for="(item, index) in goodsTypeList" :key="item.id">
<div class="spec-menu-item js-spec-menu skuCon" v-for="(item, index) in goodsTypeList"
:key="item.id">
<div class="spec-note label">{{ item.name }}:</div>
<div class="spec-choices">
<span v-for="(el, i) in item.propertyList" :key="el.id" class="spec-nor skuItem one-line-ellipsis pointer" :class="{ active: el.selected, disabled: el.disabled }" @click="handleClickSpecs1(item.id, el.id, el, index, i)">{{ el.name }}</span>
<span v-for="(el, i) in item.propertyList" :key="el.id"
class="spec-nor skuItem one-line-ellipsis pointer"
:class="{ active: el.selected, disabled: el.disabled }"
@click="handleClickSpecs1(item.id, el.id, el, index, i)">{{ el.name }}</span>
</div>
</div>
</div>
......@@ -40,7 +46,8 @@
<div class="skuCon" v-if="goodsInfo.specificationType == 1">
<div class="label">规格:</div>
<div class="itemCon">
<div class="skuItem one-line-ellipsis pointer" :class="{ active: index === selectIndex }" v-for="(item, index) in goodsInfo.upgradeGoodsList" :key="index" @click="singleClick(item, index)">
<div class="skuItem one-line-ellipsis pointer" :class="{ active: index === selectIndex }"
v-for="(item, index) in goodsInfo.upgradeGoodsList" :key="index" @click="singleClick(item, index)">
{{ item.purchaseGoodsName || item.thirdPartyName || item.upgradeGoodsName }}
</div>
</div>
......@@ -55,11 +62,15 @@
{{ membraneTypeList.includes(goodsInfo.goodsType) ? `卷(1卷=${goodsInfo.convertedValue || 30}米)` : '件' }}
</div>
</div>
<div class="munCom" v-if="upgradeGoodsInfo.suitCarType == 2">
<div class="munCom" v-if="selectedUpgradeGoods && selectedUpgradeGoods.suitCarType == 2">
<div class="label">适用车型:</div>
<div class="munItem car-select">
<el-select ref="choose" :clearable="false" width="300" collapse-tags multiple @focus="handleCarDialog" value-key="carTypeId" v-model="goodsInfo.suitCarTypeList" style="margin-left: 20px;width: 300px;" placeholder="请选择">
<el-option v-for="children in goodsInfo.suitCarTypeList" :key="children.carTypeId" :label="children.carTypeName" :value="children"></el-option>
<el-select ref="choose" :clearable="false" width='300' collapse-tags multiple @focus="handleCarDialog"
:disabled="!isGoodsSelected" value-key="carTypeId" v-model="goodsInfo.suitCarTypeList"
style="margin-left: 20px;width: 300px;" placeholder="请选择">
<el-option v-for="(children) in goodsInfo.suitCarTypeList" :key="children.carTypeId"
:label="children.carTypeName" :value="children">
</el-option>
</el-select>
</div>
</div>
......@@ -83,7 +94,9 @@
</div>
</div>
</GLDialog>
<carBandDialog v-if="relateStoreVisible" :upgradeGoodsInfo="goodsInfo" @handleRelateStoreConfirm="handleConfirm" :relateStoreVisible.sync="relateStoreVisible" :goodsInfo="goodsInfo"></carBandDialog>
<carBandDialog v-if="relateStoreVisible" :upgradeGoodsInfo="carBandUpgradeGoodsInfo"
@handleRelateStoreConfirm="handleConfirm" :relateStoreVisible.sync="relateStoreVisible" :goodsInfo="goodsInfo">
</carBandDialog>
</div>
</template>
......@@ -538,7 +551,7 @@ export default {
},
selectItemInfo: {
type: Object,
default: () => {}
default: () => { }
},
goodsId: {
type: [String, Number]
......@@ -611,7 +624,6 @@ export default {
}
]
},
tableInfo: [],
upgradeGoodsInfo: {
suitCarType: 1
},
......@@ -626,6 +638,36 @@ export default {
set(val) {
this.$emit('update:visible', val)
}
},
isGoodsSelected() {
if (this.goodsInfo.specificationType == 2) {
return this.selectItemList.length === this.goodsTypeList.length && this.goodsTypeList.length > 0
}
return !!this.handleItemInfo.upgradeGoodsId
},
selectedUpgradeGoods() {
if (!this.isGoodsSelected) {
return null
}
if (this.goodsInfo.specificationType == 2) {
return this.upgradeGoodsInfo
}
return this.goodsInfo.upgradeGoodsList?.[this.selectIndex] || this.upgradeGoodsInfo
},
carBandUpgradeGoodsInfo() {
const selected = this.selectedUpgradeGoods || {}
return {
...selected,
upgradeGoodsId: selected.id,
suitCarTypeList: this.goodsInfo.suitCarTypeList || []
}
},
tableInfo() {
const selected = this.selectedUpgradeGoods
if (!selected?.merchantGoodsInfo) {
return []
}
return selected.merchantGoodsInfo.filter(item => item.goodsAlias)
}
},
watch: {
......@@ -642,6 +684,7 @@ export default {
},
methods: {
singleClick(item, index) {
this.goodsInfo.suitCarTypeList = []
this.setHandleItemInfo(item)
this.selectIndex = index
this.upgradeGoodsInfo = item
......@@ -651,7 +694,10 @@ export default {
this.goodsInfo.suitCarTypeList = list
},
handleCarDialog() {
console.log('handleCarDialog')
if (!this.isGoodsSelected) {
this.$message.warning('请先选择商品规格')
return
}
this.$refs.choose.blur()
this.relateStoreVisible = true
},
......@@ -761,12 +807,13 @@ export default {
this.upgradeGoodsInfo = this.orgData.upgradeGoodsList.find(item => item.specificationData == spcName)
console.log(this.upgradeGoodsInfo, ' this.upgradeGoodsInfo')
}
// this.upgradeGoodsInfo = selectSpc.suitCarType
this.handleItemInfo.purchasePrice = skusItem.purchasePrice
//goodsInfo upgradeGoodsList suitCarType
this.handleItemInfo.upgradeGoodsId = this.upgradeGoodsInfo?.id || ''
} else {
this.handleItemInfo.purchasePrice = ''
this.handleItemInfo.upgradeGoodsId = ''
}
this.goodsInfo.suitCarTypeList = []
// 取出组ID
let x_selected_grounpIds = []
selectItemList.forEach(item => {
......@@ -881,7 +928,6 @@ export default {
// this.handleClickSpecs1(item.id, sku.propertyId, sku, index, sku.index)
// })
this.goodsInfo = res
this.tableInfo = res?.upgradeGoodsList[0]?.merchantGoodsInfo
} else {
this.goodsInfo = res
// 默认选中第一个
......@@ -889,7 +935,9 @@ export default {
this.setHandleItemInfo(item)
}
console.log(res?.upgradeGoodsList, 'res?.upgradeGoodsList')
this.upgradeGoodsInfo = res?.upgradeGoodsList[0]
if (res?.specificationType != 2) {
this.upgradeGoodsInfo = res?.upgradeGoodsList[0]
}
})
},
setHandleItemInfo(item = {}) {
......@@ -899,8 +947,6 @@ export default {
upgradeGoodsId: id,
purchasePrice
})
this.tableInfo = item.merchantGoodsInfo && item.merchantGoodsInfo.filter(item => item.goodsAlias)
console.log(this.tableInfo)
},
handleDetailClose() {
this.dialogShow = false
......@@ -958,7 +1004,7 @@ export default {
}
}
// 如果是专用商品 但没有选适配车型
if (this.upgradeGoodsInfo.suitCarType == 2 && !this.goodsInfo.suitCarTypeList?.length) {
if (this.selectedUpgradeGoods?.suitCarType == 2 && !this.goodsInfo.suitCarTypeList?.length) {
return this.$message({
message: '请完善商品适用车型',
type: 'error',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!