Commit 1d0b0f48 by 张立顺

Merge branch 'dev_v4.32.0_1130' into 'develop'

Dev v4.32.0 1130

See merge request !9
2 parents af3fc35a 2e5c408d
This diff could not be displayed because it is too large.
...@@ -3,7 +3,7 @@ import { http } from '@/main' ...@@ -3,7 +3,7 @@ import { http } from '@/main'
const path = 'dj.api.' const path = 'dj.api.'
const path2 = 'dj.smartcarlife.api.' const path2 = 'dj.smartcarlife.api.'
// 获取素材详情 // 获取素材详情
const getProductInfo = (params) => { const getProductInfo = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}goodsinfo.get.byId` params.routerMethod = `${path}goodsinfo.get.byId`
return http({ return http({
...@@ -15,7 +15,7 @@ const getProductInfo = (params) => { ...@@ -15,7 +15,7 @@ const getProductInfo = (params) => {
} }
// 获取场景下类目 // 获取场景下类目
const getProductTypeBySceneId = (params) => { const getProductTypeBySceneId = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}goodsCategoryConfiguration.queryGoodsCategoryBySceneId` params.routerMethod = `${path}goodsCategoryConfiguration.queryGoodsCategoryBySceneId`
return http({ return http({
...@@ -27,7 +27,7 @@ const getProductTypeBySceneId = (params) => { ...@@ -27,7 +27,7 @@ const getProductTypeBySceneId = (params) => {
} }
// 查询产品列表 // 查询产品列表
const getGoodsList = (params) => { const getGoodsList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}goodsinfo.list` params.routerMethod = `${path}goodsinfo.list`
return http({ return http({
...@@ -38,7 +38,7 @@ const getGoodsList = (params) => { ...@@ -38,7 +38,7 @@ const getGoodsList = (params) => {
}) })
} }
//查询服务商所有商品列表 //查询服务商所有商品列表
const getfwsGoodsList = (params) => { const getfwsGoodsList = params => {
params.method = `scrm.api.partner.goods.list` params.method = `scrm.api.partner.goods.list`
return http({ return http({
url: 'rop-scrm-partner/router', url: 'rop-scrm-partner/router',
...@@ -50,17 +50,16 @@ const getfwsGoodsList = (params) => { ...@@ -50,17 +50,16 @@ const getfwsGoodsList = (params) => {
// 添加自采订单 // 添加自采订单
const addSelfOrder = (params) => { const addSelfOrder = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseOrder.selfAddOrEdit` params.routerMethod = `dj.api.smarcarlife.purchaseOrder.selfAddOrEdit`
return http({ return http({
url: 'rop-scrm-boutiquecoupon/router', url: 'rop-scrm-boutiquecoupon/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true,
returnAll: true
}) })
} }
export default { addSelfOrder, getGoodsList, getProductInfo, getProductTypeBySceneId, getfwsGoodsList }
export default { addSelfOrder,getGoodsList,getProductInfo, getProductTypeBySceneId ,getfwsGoodsList}
...@@ -4,7 +4,7 @@ const path = 'dj.api.smarcarlife.' ...@@ -4,7 +4,7 @@ const path = 'dj.api.smarcarlife.'
const path2 = 'dj.api.goodsInfo.' const path2 = 'dj.api.goodsInfo.'
const path3 = 'dj.api.smartcarlife.' const path3 = 'dj.api.smartcarlife.'
// 分页查询采购订单 // 分页查询采购订单
const getPurchaseOrderList = (params) => { const getPurchaseOrderList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.page` params.routerMethod = `${path}purchaseOrder.page`
return http({ return http({
...@@ -15,7 +15,7 @@ const getPurchaseOrderList = (params) => { ...@@ -15,7 +15,7 @@ const getPurchaseOrderList = (params) => {
}) })
} }
// 采购订单取消/审核 // 采购订单取消/审核
const purchaseOrderCancelOrCheck = (params) => { const purchaseOrderCancelOrCheck = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.cancelOrCheck` params.routerMethod = `${path}purchaseOrder.cancelOrCheck`
return http({ return http({
...@@ -26,7 +26,7 @@ const purchaseOrderCancelOrCheck = (params) => { ...@@ -26,7 +26,7 @@ const purchaseOrderCancelOrCheck = (params) => {
returnAll: true returnAll: true
}) })
} }
const purchaseOrderDelete = (params) => { const purchaseOrderDelete = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseOrder.deleteByOrderCode` params.routerMethod = `dj.api.smarcarlife.purchaseOrder.deleteByOrderCode`
return http({ return http({
...@@ -37,8 +37,20 @@ const purchaseOrderDelete = (params) => { ...@@ -37,8 +37,20 @@ const purchaseOrderDelete = (params) => {
returnAll: true returnAll: true
}) })
} }
// 库存管理模式
const getManageMode = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.stock.management.mode`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 查看采购订单 // 查看采购订单
const purchaseOrderDetail = (params) => { const purchaseOrderDetail = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.view` params.routerMethod = `${path}purchaseOrder.view`
return http({ return http({
...@@ -49,7 +61,7 @@ const purchaseOrderDetail = (params) => { ...@@ -49,7 +61,7 @@ const purchaseOrderDetail = (params) => {
}) })
} }
// 分页查询采购商城素材信息 // 分页查询采购商城素材信息
const listWithPagePurchaseInfo = (params) => { const listWithPagePurchaseInfo = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path2}listWithPage.purchaseInfo` params.routerMethod = `${path2}listWithPage.purchaseInfo`
return http({ return http({
...@@ -72,9 +84,8 @@ const addressGet = (params = {}) => { ...@@ -72,9 +84,8 @@ const addressGet = (params = {}) => {
}) })
} }
// 保存园区店商户收货地址 // 保存园区店商户收货地址
const addressSave = (params) => { const addressSave = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}yqMerchantDeliveryAddress.save` params.routerMethod = `${path}yqMerchantDeliveryAddress.save`
return http({ return http({
...@@ -86,7 +97,7 @@ const addressSave = (params) => { ...@@ -86,7 +97,7 @@ const addressSave = (params) => {
} }
// 按商品类目分组获取购物车列表 // 按商品类目分组获取购物车列表
const listGroupByGoodsType = (params) => { const listGroupByGoodsType = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.listGroupByGoodsType` params.routerMethod = `${path}purchaseShoppingCar.listGroupByGoodsType`
return http({ return http({
...@@ -97,9 +108,8 @@ const listGroupByGoodsType = (params) => { ...@@ -97,9 +108,8 @@ const listGroupByGoodsType = (params) => {
}) })
} }
// 更新购物车商品选中标识 // 更新购物车商品选中标识
const updateSelectedFlag = (params) => { const updateSelectedFlag = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.updateSelectedFlag` params.routerMethod = `${path}purchaseShoppingCar.updateSelectedFlag`
return http({ return http({
...@@ -110,7 +120,7 @@ const updateSelectedFlag = (params) => { ...@@ -110,7 +120,7 @@ const updateSelectedFlag = (params) => {
}) })
} }
// 移除购物车商品 // 移除购物车商品
const shoppingCarRemove = (params) => { const shoppingCarRemove = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.remove` params.routerMethod = `${path}purchaseShoppingCar.remove`
return http({ return http({
...@@ -122,7 +132,7 @@ const shoppingCarRemove = (params) => { ...@@ -122,7 +132,7 @@ const shoppingCarRemove = (params) => {
} }
// 添加到购物车 // 添加到购物车
const shoppingCarAdd = (params) => { const shoppingCarAdd = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.add` params.routerMethod = `${path}purchaseShoppingCar.add`
return http({ return http({
...@@ -133,8 +143,6 @@ const shoppingCarAdd = (params) => { ...@@ -133,8 +143,6 @@ const shoppingCarAdd = (params) => {
}) })
} }
// 修改购物车商品数量 // 修改购物车商品数量
export function shoppingCarUpdateNumber(params) { export function shoppingCarUpdateNumber(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
...@@ -146,12 +154,6 @@ export function shoppingCarUpdateNumber(params) { ...@@ -146,12 +154,6 @@ export function shoppingCarUpdateNumber(params) {
}) })
} }
// 添加采购订单 // 添加采购订单
export function purchaseOrderAdd(params) { export function purchaseOrderAdd(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
...@@ -164,8 +166,6 @@ export function purchaseOrderAdd(params) { ...@@ -164,8 +166,6 @@ export function purchaseOrderAdd(params) {
}) })
} }
export function exportExcel(params) { export function exportExcel(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseOrder.export` params.routerMethod = `dj.api.smarcarlife.purchaseOrder.export`
...@@ -200,7 +200,7 @@ export function getMerchantList(params) { ...@@ -200,7 +200,7 @@ export function getMerchantList(params) {
}) })
} }
//查询园区店关联的4s店列表 -入库门店 //查询园区店关联的4s店列表 -入库门店
const get4SRefByYqShopList = (params) => { const get4SRefByYqShopList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.scenemerchantref.query4SRefByYqShop` params.routerMethod = `dj.api.scenemerchantref.query4SRefByYqShop`
return http({ return http({
...@@ -231,7 +231,7 @@ export function checkShipper(params) { ...@@ -231,7 +231,7 @@ export function checkShipper(params) {
method: 'POST', method: 'POST',
data: params, data: params,
sign: true, sign: true,
returnAll:true returnAll: true
}) })
} }
// 确认发货 // 确认发货
...@@ -241,4 +241,4 @@ export function checkShipper(params) { ...@@ -241,4 +241,4 @@ export function checkShipper(params) {
// return http(data) // return http(data)
// } // }
export default {checkShipper,get4SRefByYqShopList, selectByOrderCode,purchaseOrderDelete, getMerchantList, purchaseOrderPutIn, exportExcel, shoppingCarUpdateNumber, purchaseOrderAdd, shoppingCarAdd, shoppingCarRemove, updateSelectedFlag, listGroupByGoodsType, getPurchaseOrderList, purchaseOrderCancelOrCheck, purchaseOrderDetail, listWithPagePurchaseInfo, addressGet, addressSave }
\ No newline at end of file \ No newline at end of file
export default { checkShipper, get4SRefByYqShopList, selectByOrderCode, purchaseOrderDelete, getManageMode, getMerchantList, purchaseOrderPutIn, exportExcel, shoppingCarUpdateNumber, purchaseOrderAdd, shoppingCarAdd, shoppingCarRemove, updateSelectedFlag, listGroupByGoodsType, getPurchaseOrderList, purchaseOrderCancelOrCheck, purchaseOrderDetail, listWithPagePurchaseInfo, addressGet, addressSave }
...@@ -5,7 +5,7 @@ html { ...@@ -5,7 +5,7 @@ html {
margin: 0; margin: 0;
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
background-color: #F4F5FA; background-color: #f4f5fa;
} }
.purchase .container { .purchase .container {
...@@ -21,8 +21,8 @@ html { ...@@ -21,8 +21,8 @@ html {
.purchase .p-t-20 { .purchase .p-t-20 {
padding-top: 20px; padding-top: 20px;
} }
.pointer{ .pointer {
cursor: pointer; cursor: pointer;
} }
.carIcon { .carIcon {
display: inline-block; display: inline-block;
...@@ -32,6 +32,10 @@ cursor: pointer; ...@@ -32,6 +32,10 @@ cursor: pointer;
background-size: 100% 100%; background-size: 100% 100%;
margin-right: 4px; margin-right: 4px;
} }
.el-cascader-menu__wrap{ .el-cascader-menu__wrap {
height: 204px!important; height: 204px !important;
}
.message-Z-zinde {
z-index: 9999 !important;
} }
...@@ -86,6 +86,7 @@ export const purchaseTypeList = [ ...@@ -86,6 +86,7 @@ export const purchaseTypeList = [
} }
] ]
export const membraneTypeList = [1, 4, 6, 12, 14] export const membraneTypeList = [1, 4, 6, 12, 14]
export const goodsTypeList = ['自建商品-太阳膜', '自建商品-车衣', '自建商品-改色膜']
// 采购上架状态 // 采购上架状态
export const purchaseGroundingStatusList = [ export const purchaseGroundingStatusList = [
......
<template> <template>
<GLDialog v-if="dialogShow" bigTitle="详细信息" mode="big" :visible.sync="dialogShow" :close-on-click-modal="false"> <div v-if="dialogShow">
<GLDialog bigTitle="详细信息" mode="big" :visible.sync="dialogShow" :close-on-click-modal="false">
<div class="detail-info"> <div class="detail-info">
<div> <div>
发货单号: 发货单号:
...@@ -41,6 +42,16 @@ ...@@ -41,6 +42,16 @@
<el-input v-model="scope.scope.increaseStockNum" placeholder="请输入" @blur="handleCalculate(scope.scope, 'increaseStockNum', index)"></el-input> <el-input v-model="scope.scope.increaseStockNum" placeholder="请输入" @blur="handleCalculate(scope.scope, 'increaseStockNum', index)"></el-input>
</el-form-item> </el-form-item>
</template> </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>
<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>
</div>
</div>
<div v-else>--</div>
</template>
<!-- 入库仓库 --> <!-- 入库仓库 -->
<template slot="yqMerchantId" slot-scope="scope"> <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">
...@@ -75,11 +86,14 @@ ...@@ -75,11 +86,14 @@
<el-button type="primary" size="small" @click="handleSave">保存入库</el-button> <el-button type="primary" size="small" @click="handleSave">保存入库</el-button>
</span> </span>
</GLDialog> </GLDialog>
<filmDialog :visible.sync="filmVisible" :info="info" maxAddNumAttr="stockAddNum" @handleConfirm="handleFilmConfirm"></filmDialog>
</div>
</template> </template>
<script> <script>
import BigNumber from 'bignumber.js' import BigNumber from 'bignumber.js'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import { membraneTypeList } from '@/utils/constants.js' import { membraneTypeList } from '@/utils/constants.js'
import filmDialog from '../purchaseOrder/components/FilmDialog'
export default { export default {
name: 'DeliverAdd', name: 'DeliverAdd',
props: { props: {
...@@ -123,15 +137,21 @@ export default { ...@@ -123,15 +137,21 @@ export default {
goodsList: [], goodsList: [],
storeUsageList: [], storeUsageList: [],
refByYqShopList: [], refByYqShopList: [],
goodsWarehousingList: [],
tableParams: { tableParams: {
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '入库数量', label: '入库数量/卷',
prop: 'increaseStockNum', prop: 'increaseStockNum',
addHtml: 'increaseStockNum' addHtml: 'increaseStockNum'
}, },
{ {
label: '膜卷号',
prop: 'filmRollList',
addHtml: 'film'
},
{
label: '入库仓库', label: '入库仓库',
prop: 'yqMerchantId', prop: 'yqMerchantId',
addHtml: 'yqMerchantId' addHtml: 'yqMerchantId'
...@@ -163,10 +183,19 @@ export default { ...@@ -163,10 +183,19 @@ export default {
} }
] ]
}, },
tableData: [] tableData: [],
filmVisible: false,
info: {},
filmTypeList: [1, 4, 6, 12, 14],
manageMode: false
} }
}, },
created() { }, components: {
filmDialog
},
created() {
this.getManageMode()
},
methods: { methods: {
lookNumber(data) { lookNumber(data) {
this.innerVisible = true this.innerVisible = true
...@@ -175,8 +204,10 @@ export default { ...@@ -175,8 +204,10 @@ export default {
}) })
}, },
handleCalculate(data, key, index) { handleCalculate(data, key, index) {
if (data[key] > this.detailInfo.deliveryDetailList[index].stockNum) { // 膜类商品判断发货数量;其他判断可用库存数量
data[key] = this.detailInfo.deliveryDetailList[index].stockNum let attr = this.filmTypeList.includes(this.detailInfo.goodsType) ? 'purchaseNumber' : 'stockNum'
if (data[key] > this.detailInfo.deliveryDetailList[index][attr]) {
data[key] = this.detailInfo.deliveryDetailList[index][attr]
return return
} }
data[key] = data[key] ? new BigNumber(data[key]).dp(2).toNumber() : '' data[key] = data[key] ? new BigNumber(data[key]).dp(2).toNumber() : ''
...@@ -187,6 +218,11 @@ export default { ...@@ -187,6 +218,11 @@ export default {
if (this.storeUsageList.length == 1) this.defaultSelect() if (this.storeUsageList.length == 1) this.defaultSelect()
}) })
}, },
getManageMode() {
this.$apis.purchaseShopping.getManageMode({}).then(res => {
this.manageMode = res
})
},
defaultSelect() { defaultSelect() {
let { let {
detailInfo: { deliveryDetailList }, detailInfo: { deliveryDetailList },
...@@ -225,6 +261,30 @@ export default { ...@@ -225,6 +261,30 @@ export default {
} }
}) })
}, },
filmIsVisible() {
this.filmVisible = !this.filmVisible
},
handleSelectFilm(row, pIdx, idx) {
if (!row.increaseStockNum) {
this.$message({
message: '请先完善采购数量',
type: 'error',
customClass: 'message-Z-zinde'
})
return
}
this.filmIsVisible()
this.filmIds = {
pIdx: pIdx,
idx: idx
}
this.info = row
this.info.stockAddNum = Math.ceil(row.increaseStockNum)
},
handleFilmConfirm(list) {
this.detailInfo.deliveryDetailList[this.filmIds.pIdx].goodsWarehousingList[this.filmIds.idx].filmRollList = list
this.filmIsVisible()
},
handleDetailClose() { handleDetailClose() {
this.dialogShow = false this.dialogShow = false
}, },
...@@ -301,9 +361,39 @@ export default { ...@@ -301,9 +361,39 @@ export default {
} }
}) })
let params = { let params = {
deliveryDetailList: deliveryDetailList deliveryDetailList: this.$common.utils.deepClone(deliveryDetailList)
}
// console.log(this.detailInfo, 'this.detailInfo---')
for (let i = 0; i < params.deliveryDetailList.length; i++) {
item = params.deliveryDetailList[i]
item.id = this.detailInfo.id
for (let j = 0; j < item.goodsWarehousingList.length; j++) {
let subItem = item.goodsWarehousingList[j]
if (this.manageMode) {
// 校验:膜卷号必填
if (!subItem.filmRollList || (subItem.filmRollList && subItem.filmRollList.length == 0)) {
this.$message({
message: item.upgradeGoodsName + '请选择膜卷号',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
// 校验:入库数量和膜卷号数量相等
if (subItem.filmRollList && subItem.filmRollList.length != Math.ceil(subItem.increaseStockNum)) {
this.$message({
message: item.upgradeGoodsName + '的入库数量和膜卷号数量不相等',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
}
subItem.increaseStockNum = subItem.increaseStockNum * (item.stockNum / item.purchaseNumber)
} }
params.id = this.detailInfo.orderDeliveryId params.id = this.detailInfo.orderDeliveryId
}
// console.log(params, 'params----')
this.$apis.delivery.addPurchaseOrder(params).then(res => { this.$apis.delivery.addPurchaseOrder(params).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$message({ this.$message({
...@@ -371,4 +461,16 @@ export default { ...@@ -371,4 +461,16 @@ export default {
text-align: center; text-align: center;
} }
} }
.film-txt {
box-sizing: border-box;
height: 32px;
line-height: 32px;
background: #f4f6fc;
border: 1px solid #eaeaec;
font-weight: 400;
font-size: 14px;
color: #666666;
padding: 6px;
margin-right: 6px;
}
</style> </style>
<template> <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 class="detail-info">
<div> <div>
发货单号: 发货单号:
...@@ -23,18 +24,26 @@ ...@@ -23,18 +24,26 @@
</div> </div>
<div> <div>
发货数量: 发货数量:
<span>{{ membraneTypeList.includes(detailInfo.goodsType) ? `${detailInfo.purchaseNumber}卷` : `${detailInfo.purchaseNumber}件` }}</span> <span>{{ membraneTypeList.includes(detailInfo.goodsType) ? `${detailInfo.purchaseNumber}卷` :
<span class="lookNumber" @click="lookNumber(detailInfo.deliveryCardList)" v-if="detailInfo.deliveryCardList && detailInfo.deliveryCardList.length > 0">查看卡号</span> `${detailInfo.purchaseNumber}件` }}</span>
<span class="lookNumber" @click="lookNumber(detailInfo.deliveryCardList)"
v-if="detailInfo.deliveryCardList && detailInfo.deliveryCardList.length > 0">查看卡号</span>
</div> </div>
<div> <div>
可用库存数量: 可用库存数量:
<span>{{ detailInfo.stockNum }}{{ membraneTypeList.includes(detailInfo.goodsType) ? `米` : `件` }}</span> <span>{{ detailInfo.stockNum }}{{ membraneTypeList.includes(detailInfo.goodsType) ? `米` : `件` }}</span>
</div> </div>
</div> </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"> 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"> <template slot="increaseStockNum" slot-scope="scope">
<span>{{ membraneTypeList.includes(scope.scope.goodsType) ? `${scope.scope.increaseStockNum}米` : `${scope.scope.increaseStockNum}件` }}</span> <!-- <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> </template>
</GLTable> </GLTable>
</el-form> </el-form>
...@@ -44,7 +53,8 @@ ...@@ -44,7 +53,8 @@
</div> </div>
<!-- </template> --> <!-- </template> -->
<el-dialog width="750px" title="查看发货卡号" :visible.sync="innerVisible" append-to-body> <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> </el-dialog>
</GLDialog> </GLDialog>
</template> </template>
...@@ -126,6 +136,12 @@ export default { ...@@ -126,6 +136,12 @@ export default {
this.$apis.delivery.getDeliveryDetail({ id: this.id }).then(res => { this.$apis.delivery.getDeliveryDetail({ id: this.id }).then(res => {
const { data } = res const { data } = res
if (res.code == 0) { if (res.code == 0) {
data.goodsWarehousingList.forEach(item => {
// 换算单位
// item.deliveryDetailList.forEach(info => {
item.alternateUnits = data?.stockNum / data?.purchaseNumber
// })
})
this.detailInfo = data this.detailInfo = data
} }
}) })
...@@ -148,42 +164,49 @@ export default { ...@@ -148,42 +164,49 @@ export default {
color: #666666ff; color: #666666ff;
font-size: 14px; font-size: 14px;
margin-bottom: 16px; margin-bottom: 16px;
span { span {
color: #333333ff; color: #333333ff;
} }
.add-btn { .add-btn {
font-size: 14px; font-size: 14px;
color: #5850ff; color: #5850ff;
cursor: pointer; cursor: pointer;
} }
} }
.table-wrap { .table-wrap {
border: 1px solid #e5e5e5; border: 1px solid #e5e5e5;
padding: 16px; padding: 16px;
box-sizing: border-box; box-sizing: border-box;
margin-top: 16px; margin-top: 16px;
/deep/ .el-form-item__error { /deep/ .el-form-item__error {
padding-top: 2px; padding-top: 2px;
z-index: 9999999; z-index: 9999999;
position: static; position: static;
} }
} }
.lookNumber { .lookNumber {
font-size: 14px; font-size: 14px;
color: #5850ff !important; color: #5850ff !important;
cursor: pointer; cursor: pointer;
margin-left: 8px; margin-left: 8px;
} }
.look-card-wrap { .look-card-wrap {
max-height: 600px; max-height: 600px;
overflow-y: scroll; overflow-y: scroll;
overflow-x: hidden; overflow-x: hidden;
/deep/.el-table th.el-table__cell > .cell {
/deep/.el-table th.el-table__cell>.cell {
padding: 0 16px; padding: 0 16px;
text-align: center; text-align: center;
} }
/deep/.el-table__body td.el-table__cell { /deep/.el-table__body td.el-table__cell {
text-align: center; text-align: center;
} }
} }</style>
</style>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<deliver-add :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>
</div> </div>
</template> </template>
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<filmDialog :visible.sync="filmVisible" :info="info" @handleConfirm="handleFilmConfirm"></filmDialog>
<rejectDialog v-if="rejectDialogVisible" :visible.sync="rejectDialogVisible" @handleRejectConfirm="handleRejectConfirm"></rejectDialog> <rejectDialog v-if="rejectDialogVisible" :visible.sync="rejectDialogVisible" @handleRejectConfirm="handleRejectConfirm"></rejectDialog>
</div> </div>
</template> </template>
...@@ -32,17 +33,19 @@ ...@@ -32,17 +33,19 @@
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import rejectDialog from './rejectDialog' import rejectDialog from './rejectDialog'
import filmDialog from '../purchaseOrder/components/FilmDialog'
import { groundingCheckStatusList, goodsSourceOptions } from '@/utils/constants.js' import { groundingCheckStatusList, goodsSourceOptions } from '@/utils/constants.js'
export default { export default {
name: 'purchaseCheck', name: 'purchaseCheck',
components: { components: {
rejectDialog rejectDialog,
filmDialog
}, },
data() { data() {
return { return {
size: 'small', size: 'small',
url: url, url: url,
Spot:['yellowSpot','greenSpot','ashSpot','redSpot'], Spot: ['yellowSpot', 'greenSpot', 'ashSpot', 'redSpot'],
searchForm: { searchForm: {
sortType: 2, sortType: 2,
orderTimeStr: [], orderTimeStr: [],
...@@ -299,13 +302,17 @@ export default { ...@@ -299,13 +302,17 @@ export default {
rejectDialogVisible: false, rejectDialogVisible: false,
rejectObj: {}, rejectObj: {},
tipsTitleStyle: 'style="font-size: 16px;color: #333333;"', tipsTitleStyle: 'style="font-size: 16px;color: #333333;"',
tipsContentStyle: 'style="font-size: 14px;color: #666666;"' tipsContentStyle: 'style="font-size: 14px;color: #666666;"',
filmVisible: false,
goodsTypeList: ['自建商品-太阳膜', '自建商品-车衣', '自建商品-改色膜'],
manageMode: false
} }
}, },
mounted() { mounted() {
// 获取所属分类 // 获取所属分类
this.getPurchaseGroundingSearchSelectData(1) this.getPurchaseGroundingSearchSelectData(1)
this.getManageMode()
}, },
methods: { methods: {
...@@ -325,6 +332,11 @@ export default { ...@@ -325,6 +332,11 @@ export default {
this.getOptionsList('showFormData') this.getOptionsList('showFormData')
}) })
}, },
getManageMode() {
this.$apis.purchaseShopping.getManageMode({}).then(res => {
this.manageMode = res
})
},
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams()
...@@ -357,11 +369,20 @@ export default { ...@@ -357,11 +369,20 @@ export default {
//审核 //审核
handleCheck(row) { handleCheck(row) {
if (row?.goodsSource == 1) { // 自营商品 if (row?.goodsSource == 1) { // 自营商品
if (this.manageMode && this.goodsTypeList.includes(row.goodsTypeName)) {
this.info = row
this.filmVisible = !this.filmVisible
} else {
this.secondConfirm('审核', `<p ${this.tipsTitleStyle}>是否确定审核?</p><p ${this.tipsContentStyle}>审核通过后,系统会自动创建自采采购订单并自动入库,且无法撤回</p>`, 'purchaseCheck', 'auditPurchaseCheck', { id: row.id }) this.secondConfirm('审核', `<p ${this.tipsTitleStyle}>是否确定审核?</p><p ${this.tipsContentStyle}>审核通过后,系统会自动创建自采采购订单并自动入库,且无法撤回</p>`, 'purchaseCheck', 'auditPurchaseCheck', { id: row.id })
}
} else if (row?.goodsSource == 0) { // 嘀加商品 } else if (row?.goodsSource == 0) { // 嘀加商品
this.secondConfirm('审核', `<p ${this.tipsTitleStyle}>是否确定审核?</p><p ${this.tipsContentStyle}>审核通过后,系统会自动创建商城采购订单,且无法撤回</p>`, 'purchaseCheck', 'auditPurchaseCheck', { id: row.id }) this.secondConfirm('审核', `<p ${this.tipsTitleStyle}>是否确定审核?</p><p ${this.tipsContentStyle}>审核通过后,系统会自动创建商城采购订单,且无法撤回</p>`, 'purchaseCheck', 'auditPurchaseCheck', { id: row.id })
} }
}, },
handleFilmConfirm(list) {
this.filmVisible = !this.filmVisible
this.secondConfirm('审核', `<p ${this.tipsTitleStyle}>是否确定审核?</p><p ${this.tipsContentStyle}>审核通过后,系统会自动创建自采采购订单并自动入库,且无法撤回</p>`, 'purchaseCheck', 'auditPurchaseCheck', { id: this.info.id, filmRollList: list })
},
//驳回 //驳回
handleReject(row) { handleReject(row) {
this.rejectObj = row this.rejectObj = row
......
<template>
<GLDialog v-if="dialogShow" bigTitle="选择膜卷号" mode="big" :visible.sync="dialogShow" :close-on-click-modal="false">
<div class="detail-info">
<div>
已添加数量:
<span>{{ filmRollList.length }}</span>
</div>
<div>
最大可添加数量:
<span>{{ detailInfo[maxAddNumAttr] }}</span>
</div>
<div class="add-btn" @click="addLineTable">
添加一行
</div>
</div>
<GLTable :tableData="filmRollList" :noDataImg="url" :tableParams="tableParams" :hasPage="false">
<template slot="filmNum" slot-scope="scope">
<el-form :ref="'addForm' + scope.index" :model="scope.scope" size="small" :rules="rules">
<el-form-item style="margin-bottom: 0px" prop="filmNum">
<el-input v-model="scope.scope.filmNum" placeholder="请输入" maxlength="50" @input="e => handleInputFilmNum(e, scope.index)"></el-input>
</el-form-item>
</el-form>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDelete(scope.index)">删除</el-button>
</div>
</GLTable>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogShow = false">取消</el-button>
<el-button type="primary" size="small" @click="handleSave">确定</el-button>
</span>
</GLDialog>
</template>
<script>
import BigNumber from 'bignumber.js'
import * as dayjs from 'dayjs'
export default {
name: 'FilmDialog',
props: {
visible: {
type: Boolean,
default: false
},
info: {
type: Object,
default: () => { }
},
maxAddNumAttr: {
type: String,
default: 'goodsNumber'
}
},
watch: {
visible(val) {
this.filmRollList = []
if (val) {
this.detailInfo = this.$common.utils.deepClone(this.info || {})
if (val) {
if (!this.info.filmRollList) {
this.filmRollList = [{ filmNum: '' }]
} else {
this.info?.filmRollList.forEach(item => {
this.filmRollList.push({
filmNum: item
})
})
}
}
}
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
},
data() {
return {
dayjs: dayjs,
filmRollList: [],
tableParams: {
tableOption: true,
tableColumns: [
{
label: '膜卷号',
prop: 'filmNum',
addHtml: 'filmNum'
}
]
},
rules: {
filmNum: [{ required: true, message: '请输入膜卷号', trigger: 'blur' }]
},
detailInfo: {},
tableData: []
}
},
methods: {
handleInputFilmNum(val, idx) {
const reg = /^[0-9a-zA-Z]*$/
if (!reg.test(val)) {
this.filmRollList[idx].filmNum = val.slice(0, val.length - 1)
}
},
handleDetailClose() {
this.dialogShow = false
},
handleDelete(idx) {
if (this.filmRollList.length > 1) {
this.filmRollList.splice(idx, 1)
}
},
addLineTable() {
if (this.filmRollList.length == this.detailInfo[this.maxAddNumAttr]) {
return true
}
this.filmRollList.push({
filmNum: ''
})
},
handleSave() {
let flag = true
for (let i = 0; i < this.filmRollList.length; i++) {
this.$refs['addForm' + i].validate(valid => {
flag = valid
})
if (!flag) {
return true
}
}
if (this.filmRollList.length != this.detailInfo[this.maxAddNumAttr]) {
this.$message({
message: '请添加满足最大可添加数量的膜卷号',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
let list = this.filmRollList.map(item => item.filmNum)
this.$emit('handleConfirm', list)
}
}
}
</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;
border: 1px solid #5850ff;
border-radius: 4px;
padding: 6px 16px;
}
}
.table-wrap {
box-sizing: border-box;
margin-top: 16px;
/deep/ .el-form-item__error {
padding-top: 2px;
z-index: 9999999;
position: static;
}
/deep/ td.el-table__cell {
height: 64px;
}
}
// .lookNumber {
// font-size: 14px;
// color: #5850ff !important;
// cursor: pointer;
// margin-left: 8px;
// }
.look-card-wrap {
/deep/.el-table th.el-table__cell > .cell {
padding: 0 16px;
text-align: center;
}
/deep/.el-table__body td.el-table__cell {
text-align: center;
}
}
</style>
...@@ -24,14 +24,26 @@ ...@@ -24,14 +24,26 @@
</span> </span>
</div> </div>
<div class="table-class"> <div class="table-class">
<GLTable ref="purchaseOrderDetailTable" :tableParams="tableParams" @refreshTable="refreshTable" :tableData="detailInfo.tableData" :pageConf="pageConf" :tableTotal="detailInfo.tableTotal"></GLTable> <GLTable ref="purchaseOrderDetailTable" :tableParams="tableParams" @refreshTable="refreshTable" :tableData="detailInfo.tableData" :pageConf="pageConf" :tableTotal="detailInfo.tableTotal">
<template slot="film" slot-scope="scope">
<el-tooltip v-if="scope.scope.filmRollList && scope.scope.filmRollList.length > 1" placement="top" effect="light">
<div class="film-txt">(...{{ scope.scope.filmRollList.length }})</div>
<div slot="content">
<div class="tool-title">膜卷号</div>
<div v-for="(item, index) in scope.scope.filmRollList" :key="index">{{ item }}</div>
</div>
</el-tooltip>
<div v-else-if="scope.scope.filmRollList && scope.scope.filmRollList.length == 1">{{ scope.scope.filmRollList[0] }}</div>
<div v-else>--</div>
</template>
</GLTable>
</div> </div>
</div> </div>
</GLDialog> </GLDialog>
</template> </template>
<script> <script>
import { membraneTypeList } from '@/utils/constants.js' import { membraneTypeList, goodsTypeList } from '@/utils/constants.js'
export default { export default {
name: 'OrderDetailDialog', name: 'OrderDetailDialog',
props: { props: {
...@@ -41,7 +53,7 @@ export default { ...@@ -41,7 +53,7 @@ export default {
}, },
paramsObj: { paramsObj: {
type: Object, type: Object,
default: () => {} default: () => { }
} }
}, },
computed: { computed: {
...@@ -84,25 +96,37 @@ export default { ...@@ -84,25 +96,37 @@ export default {
{ {
label: '所属分类', label: '所属分类',
prop: 'goodsTypeName', prop: 'goodsTypeName',
width: 100 width: 150
}, },
{ {
label: '采购数量', label: '采购数量',
prop: 'goodsNumber', prop: 'goodsNumber',
formatter: cellValue => { formatter: cellValue => {
let condition = membraneTypeList.includes(cellValue.goodsType) ? `${cellValue.goodsNumber}卷` : `${cellValue.goodsNumber}件` // 商品来源 1-商城采购 2-自采入库
let list = this.paramsObj.purchaseType == 1 ? membraneTypeList : goodsTypeList
return this.paramsObj.purchaseType == 1 ? condition : `${cellValue.goodsNumber}件` let attr = this.paramsObj.purchaseType == 1 ? 'goodsType' : 'goodsTypeName'
let condition = list.includes(cellValue[attr]) ? `${cellValue.goodsNumber}卷` : `${cellValue.goodsNumber}件`
return condition
}, },
width: 100 width: 100
}, },
{ {
label: '膜卷号',
prop: 'filmRollList',
addHtml: 'film',
width: 100
},
{
label: '库存总量', label: '库存总量',
prop: 'goodsTypeName', prop: 'goodsTypeName',
formatter: cellValue => { formatter: cellValue => {
let condition = membraneTypeList.includes(cellValue.goodsType) ? `${cellValue.conversionValue ? cellValue.goodsNumber * cellValue.conversionValue : '-'}米` : `${cellValue.goodsNumber}件` // 商品来源 1-商城采购 2-自采入库
let list = this.paramsObj.purchaseType == 1 ? membraneTypeList : goodsTypeList
return this.paramsObj.purchaseType == 1 ? condition : `${cellValue.goodsNumber}件` let attr = this.paramsObj.purchaseType == 1 ? 'goodsType' : 'goodsTypeName'
let unit = list.includes(cellValue[attr]) ? '米' : '件'
// let condition = list.includes(cellValue[attr]) ? `${cellValue.conversionValue ? cellValue.goodsNumber * cellValue.conversionValue : '-'}米` : `${cellValue.goodsNumber}件`
let condition = (cellValue.conversionValue ? cellValue.goodsNumber * cellValue.conversionValue : cellValue.goodsNumber) + unit
return condition
}, },
width: 100 width: 100
}, },
...@@ -125,6 +149,8 @@ export default { ...@@ -125,6 +149,8 @@ export default {
methods: { methods: {
dynamicParams() { dynamicParams() {
if (this.paramsObj.purchaseType == 1) { if (this.paramsObj.purchaseType == 1) {
let idx = this.tableParams.tableColumns.findIndex(item => item.label == '膜卷号')
this.tableParams.tableColumns.splice(idx, 1)
this.tableParams.tableColumns.push( this.tableParams.tableColumns.push(
{ {
label: '已发货数量', label: '已发货数量',
...@@ -224,4 +250,34 @@ export default { ...@@ -224,4 +250,34 @@ export default {
min-width: 500px; min-width: 500px;
} }
} }
.film-txt {
font-size: 14px;
color: #5850ff;
cursor: pointer;
}
.tool-title {
font-weight: 500 !important;
font-size: 12px;
color: #3a3a3a;
margin-bottom: 4px;
}
</style>
<style>
.el-tooltip__popper.is-light {
background: #ffffff;
border: 1px solid #e5e5e5 !important;
box-shadow: 0 8px 20px 0 #00000033;
width: 177px;
box-sizing: border-box;
font-size: 12px;
color: #666666;
line-height: 18px;
}
.el-tooltip__popper[x-placement^='top'] .popper__arrow {
border-color: #e4e7ed !important;
}
.el-tooltip__popper[x-placement^='top'] .popper__arrow:after {
border-bottom-color: #e4e7ed !important;
}
</style> </style>
...@@ -19,6 +19,16 @@ ...@@ -19,6 +19,16 @@
<el-input v-model="scope.scope.goodsNumber" placeholder="请输入" @blur="handleCalculate(scope.scope, 'goodsNumber')"></el-input> <el-input v-model="scope.scope.goodsNumber" placeholder="请输入" @blur="handleCalculate(scope.scope, 'goodsNumber')"></el-input>
</el-form-item> </el-form-item>
</template> </template>
<template slot="film" slot-scope="scope">
<div v-if="manageMode && goodsTypeList.includes(scope.scope.goodsTypeName)">
<el-button v-if="!scope.scope.filmRollList" type="text" @click="handleSelectFilm(scope.scope, scope.index)">请选择</el-button>
<div v-else>
<span class="film-txt">...({{ scope.scope.filmRollList.length }})</span>
<el-button type="text" @click="handleSelectFilm(scope.scope, scope.index)">重新选择</el-button>
</div>
</div>
<div v-else>--</div>
</template>
<template slot="upgradePurchasePrice" slot-scope="scope"> <template slot="upgradePurchasePrice" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'tableData.' + scope.index + '.upgradePurchasePrice'" :rules="rules.upgradePurchasePrice"> <el-form-item style="margin-bottom: 0px" :prop="'tableData.' + scope.index + '.upgradePurchasePrice'" :rules="rules.upgradePurchasePrice">
<el-input v-model="scope.scope.upgradePurchasePrice" placeholder="请输入" @blur="handleCalculate(scope.scope, 'upgradePurchasePrice')"></el-input> <el-input v-model="scope.scope.upgradePurchasePrice" placeholder="请输入" @blur="handleCalculate(scope.scope, 'upgradePurchasePrice')"></el-input>
...@@ -56,10 +66,12 @@ ...@@ -56,10 +66,12 @@
<el-button @click="handleSave(1)" type="primary" plain size="medium">保存</el-button> <el-button @click="handleSave(1)" type="primary" plain size="medium">保存</el-button>
<el-button type="primary" @click="handleSave(2)" size="medium">保存并入库</el-button> <el-button type="primary" @click="handleSave(2)" size="medium">保存并入库</el-button>
</GLFooter> </GLFooter>
<filmDialog :visible.sync="filmVisible" :info="info" @handleConfirm="handleFilmConfirm"></filmDialog>
</div> </div>
</template> </template>
<script> <script>
import BigNumber from 'bignumber.js' import BigNumber from 'bignumber.js'
import filmDialog from './components/FilmDialog'
export default { export default {
data() { data() {
var checkPrice = (rule, value, callback) => { var checkPrice = (rule, value, callback) => {
...@@ -84,7 +96,21 @@ export default { ...@@ -84,7 +96,21 @@ export default {
goodsNumber: [ goodsNumber: [
{ required: true, message: '请输入采购数量', trigger: 'blur' }, { required: true, message: '请输入采购数量', trigger: 'blur' },
{ validator: checkPrice, trigger: 'blur' } { validator: checkPrice, trigger: 'blur' },
{
validator: (rule, value, callback, source) => {
let idx = Object.keys(source)[0].split('.')[1]
let target = this.formdata.tableData[idx] || {}
if (!this.goodsTypeList.includes(target.goodsTypeName) || !this.manageMode) {
return callback()
}
if (!target.filmRollList) {
return callback(new Error('请选择膜卷号'))
}
return target.goodsNumber != target.filmRollList.length ? callback(new Error('采购数量与膜卷号数量不一致')) : callback()
},
trigger: 'blur'
}
], ],
upgradePurchasePrice: [ upgradePurchasePrice: [
{ required: true, message: '请输入采购单价', trigger: 'blur' }, { required: true, message: '请输入采购单价', trigger: 'blur' },
...@@ -94,7 +120,7 @@ export default { ...@@ -94,7 +120,7 @@ export default {
putMerchantId: [{ required: true, message: '请选择入库门店', trigger: 'change' }] putMerchantId: [{ required: true, message: '请选择入库门店', trigger: 'change' }]
}, },
formdata: { formdata: {
tableData: [{ upgradeGoodsId: '', type: '', goodsName: '', goodsNumber: '', upgradePurchasePrice: '', goodsTotalPrice: '', putYqMerchantId: '', putYqMerchantName: '', putMerchantId: '', putMerchantName: '' , refByYqShopList: []}] tableData: [{ upgradeGoodsId: '', type: '', goodsName: '', goodsTypeName: '', goodsNumber: '', upgradePurchasePrice: '', goodsTotalPrice: '', putYqMerchantId: '', putYqMerchantName: '', putMerchantId: '', putMerchantName: '', refByYqShopList: [] }]
}, },
tableParams: { tableParams: {
tableOption: true, tableOption: true,
...@@ -109,8 +135,8 @@ export default { ...@@ -109,8 +135,8 @@ export default {
prop: 'type' prop: 'type'
}, },
{ {
label: '所属系列', label: '所属分类',
prop: 'goodsName' prop: 'goodsTypeName'
}, },
{ {
label: '采购数量', label: '采购数量',
...@@ -118,12 +144,17 @@ export default { ...@@ -118,12 +144,17 @@ export default {
addHtml: 'goodsNumber' addHtml: 'goodsNumber'
}, },
{ {
label: '采购单价', label: '膜卷号',
prop: 'filmRollList',
addHtml: 'film'
},
{
label: '采购单价/元',
prop: 'upgradePurchasePrice', prop: 'upgradePurchasePrice',
addHtml: 'upgradePurchasePrice' addHtml: 'upgradePurchasePrice'
}, },
{ {
label: '采购总额/元', label: '采购总价/元',
prop: 'goodsTotalPrice', prop: 'goodsTotalPrice',
addHtml: 'goodsTotalPrice' addHtml: 'goodsTotalPrice'
}, },
...@@ -141,12 +172,20 @@ export default { ...@@ -141,12 +172,20 @@ export default {
}, },
goodsList: [], goodsList: [],
storeUsageList: [], storeUsageList: [],
refByYqShopList: [] refByYqShopList: [],
filmVisible: false,
info: {},
goodsTypeList: ['自建商品-太阳膜', '自建商品-车衣', '自建商品-改色膜'],
manageMode: false
} }
}, },
components: {
filmDialog
},
created() { created() {
this.getfwsGoodsList() this.getfwsGoodsList()
this.getMerchantList() this.getMerchantList()
this.getManageMode()
if (this.orderCode) this.getData() if (this.orderCode) this.getData()
}, },
methods: { methods: {
...@@ -156,6 +195,11 @@ export default { ...@@ -156,6 +195,11 @@ export default {
if (this.storeUsageList.length == 1) this.defaultSelect() if (this.storeUsageList.length == 1) this.defaultSelect()
}) })
}, },
getManageMode() {
this.$apis.purchaseShopping.getManageMode({}).then(res => {
this.manageMode = res
})
},
defaultSelect() { defaultSelect() {
let { let {
formdata: { tableData }, formdata: { tableData },
...@@ -178,6 +222,18 @@ export default { ...@@ -178,6 +222,18 @@ export default {
} }
}) })
}, },
addSelfOrder(params) {
this.$apis.product.addSelfOrder(params).then(res => {
let { code, data, message } = res
this.$notify({
type: code == 0 ? 'success' : 'error',
title: code == 0 ? '操作成功' : message
})
if (code == 0) {
this.goBack()
}
})
},
handleSave(saveOrWarehousing) { handleSave(saveOrWarehousing) {
this.$refs['addForm'].validate(valid => { this.$refs['addForm'].validate(valid => {
if (valid) { if (valid) {
...@@ -186,13 +242,15 @@ export default { ...@@ -186,13 +242,15 @@ export default {
purchaseOrderGoodsList.push({ purchaseOrderGoodsList.push({
upgradeGoodsId: item.upgradeGoodsId, upgradeGoodsId: item.upgradeGoodsId,
goodsName: item.goodsName, goodsName: item.goodsName,
goodsTypeName: item.goodsTypeName,
goodsNumber: item.goodsNumber, goodsNumber: item.goodsNumber,
upgradePurchasePrice: item.upgradePurchasePrice, upgradePurchasePrice: item.upgradePurchasePrice,
goodsTotalPrice: item.goodsTotalPrice, goodsTotalPrice: item.goodsTotalPrice,
putYqMerchantId: item.putYqMerchantId, putYqMerchantId: item.putYqMerchantId,
putYqMerchantName: item.putYqMerchantName, putYqMerchantName: item.putYqMerchantName,
putMerchantId: item.putMerchantId, putMerchantId: item.putMerchantId,
putMerchantName: item.putMerchantName putMerchantName: item.putMerchantName,
filmRollList: this.goodsTypeList.includes(item.goodsTypeName) ? item.filmRollList : ''
}) })
}) })
let params = { let params = {
...@@ -206,22 +264,10 @@ export default { ...@@ -206,22 +264,10 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$apis.product.addSelfOrder(params).then(res => { this.addSelfOrder(params)
this.$notify({
type: 'success',
title: '操作成功'
})
this.goBack()
})
}) })
} else { } else {
this.$apis.product.addSelfOrder(params).then(res => { this.addSelfOrder(params)
this.$notify({
type: 'success',
title: '操作成功'
})
this.goBack()
})
} }
} }
}) })
...@@ -252,6 +298,7 @@ export default { ...@@ -252,6 +298,7 @@ export default {
if (item.upgradeGoodsId == id) { if (item.upgradeGoodsId == id) {
data.type = item.type data.type = item.type
data.goodsName = item.goodsCodeName data.goodsName = item.goodsCodeName
data.goodsTypeName = item.goodsTypeName
} }
}) })
}, },
...@@ -272,6 +319,23 @@ export default { ...@@ -272,6 +319,23 @@ export default {
} }
}) })
}, },
filmIsVisible() {
this.filmVisible = !this.filmVisible
},
handleSelectFilm(row, idx) {
if (!row.goodsNumber) {
this.$message.error('请先完善采购数量')
return
}
this.filmIsVisible()
this.filmIdx = idx
this.info = row
},
handleFilmConfirm(list) {
this.formdata.tableData[this.filmIdx].filmRollList = list
this.filmIsVisible()
this.$refs['addForm'].validateField('tableData.' + this.filmIdx + '.goodsNumber')
},
handleCalculate(data, key) { handleCalculate(data, key) {
if (key == 'goodsNumber') { if (key == 'goodsNumber') {
data[key] = data[key] ? new BigNumber(data[key]).dp(0).toNumber() : '' data[key] = data[key] ? new BigNumber(data[key]).dp(0).toNumber() : ''
...@@ -318,6 +382,7 @@ export default { ...@@ -318,6 +382,7 @@ export default {
upgradeGoodsId: '', upgradeGoodsId: '',
type: '', type: '',
goodsName: '', goodsName: '',
goodsTypeName: '',
goodsNumber: '', goodsNumber: '',
upgradePurchasePrice: '', upgradePurchasePrice: '',
goodsTotalPrice: '', goodsTotalPrice: '',
...@@ -360,5 +425,17 @@ export default { ...@@ -360,5 +425,17 @@ export default {
/deep/ td.el-table__cell { /deep/ td.el-table__cell {
height: 64px; height: 64px;
} }
.film-txt {
box-sizing: border-box;
height: 32px;
line-height: 32px;
background: #f4f6fc;
border: 1px solid #eaeaec;
font-weight: 400;
font-size: 14px;
color: #666666;
padding: 6px;
margin-right: 6px;
}
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!