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'
const path = 'dj.api.'
const path2 = 'dj.smartcarlife.api.'
// 获取素材详情
const getProductInfo = (params) => {
const getProductInfo = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}goodsinfo.get.byId`
return http({
......@@ -15,7 +15,7 @@ const getProductInfo = (params) => {
}
// 获取场景下类目
const getProductTypeBySceneId = (params) => {
const getProductTypeBySceneId = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}goodsCategoryConfiguration.queryGoodsCategoryBySceneId`
return http({
......@@ -27,7 +27,7 @@ const getProductTypeBySceneId = (params) => {
}
// 查询产品列表
const getGoodsList = (params) => {
const getGoodsList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}goodsinfo.list`
return http({
......@@ -38,7 +38,7 @@ const getGoodsList = (params) => {
})
}
//查询服务商所有商品列表
const getfwsGoodsList = (params) => {
const getfwsGoodsList = params => {
params.method = `scrm.api.partner.goods.list`
return http({
url: 'rop-scrm-partner/router',
......@@ -50,17 +50,16 @@ const getfwsGoodsList = (params) => {
// 添加自采订单
const addSelfOrder = (params) => {
const addSelfOrder = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseOrder.selfAddOrEdit`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
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.'
const path2 = 'dj.api.goodsInfo.'
const path3 = 'dj.api.smartcarlife.'
// 分页查询采购订单
const getPurchaseOrderList = (params) => {
const getPurchaseOrderList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.page`
return http({
......@@ -15,7 +15,7 @@ const getPurchaseOrderList = (params) => {
})
}
// 采购订单取消/审核
const purchaseOrderCancelOrCheck = (params) => {
const purchaseOrderCancelOrCheck = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.cancelOrCheck`
return http({
......@@ -26,7 +26,7 @@ const purchaseOrderCancelOrCheck = (params) => {
returnAll: true
})
}
const purchaseOrderDelete = (params) => {
const purchaseOrderDelete = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseOrder.deleteByOrderCode`
return http({
......@@ -37,8 +37,20 @@ const purchaseOrderDelete = (params) => {
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.routerMethod = `${path}purchaseOrder.view`
return http({
......@@ -49,7 +61,7 @@ const purchaseOrderDetail = (params) => {
})
}
// 分页查询采购商城素材信息
const listWithPagePurchaseInfo = (params) => {
const listWithPagePurchaseInfo = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path2}listWithPage.purchaseInfo`
return http({
......@@ -72,9 +84,8 @@ const addressGet = (params = {}) => {
})
}
// 保存园区店商户收货地址
const addressSave = (params) => {
const addressSave = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}yqMerchantDeliveryAddress.save`
return http({
......@@ -86,7 +97,7 @@ const addressSave = (params) => {
}
// 按商品类目分组获取购物车列表
const listGroupByGoodsType = (params) => {
const listGroupByGoodsType = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.listGroupByGoodsType`
return http({
......@@ -97,9 +108,8 @@ const listGroupByGoodsType = (params) => {
})
}
// 更新购物车商品选中标识
const updateSelectedFlag = (params) => {
const updateSelectedFlag = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.updateSelectedFlag`
return http({
......@@ -110,7 +120,7 @@ const updateSelectedFlag = (params) => {
})
}
// 移除购物车商品
const shoppingCarRemove = (params) => {
const shoppingCarRemove = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.remove`
return http({
......@@ -122,7 +132,7 @@ const shoppingCarRemove = (params) => {
}
// 添加到购物车
const shoppingCarAdd = (params) => {
const shoppingCarAdd = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.add`
return http({
......@@ -133,8 +143,6 @@ const shoppingCarAdd = (params) => {
})
}
// 修改购物车商品数量
export function shoppingCarUpdateNumber(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
......@@ -146,12 +154,6 @@ export function shoppingCarUpdateNumber(params) {
})
}
// 添加采购订单
export function purchaseOrderAdd(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
......@@ -164,8 +166,6 @@ export function purchaseOrderAdd(params) {
})
}
export function exportExcel(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseOrder.export`
......@@ -200,7 +200,7 @@ export function getMerchantList(params) {
})
}
//查询园区店关联的4s店列表 -入库门店
const get4SRefByYqShopList = (params) => {
const get4SRefByYqShopList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.scenemerchantref.query4SRefByYqShop`
return http({
......@@ -231,7 +231,7 @@ export function checkShipper(params) {
method: 'POST',
data: params,
sign: true,
returnAll:true
returnAll: true
})
}
// 确认发货
......@@ -241,4 +241,4 @@ export function checkShipper(params) {
// 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
export default { checkShipper, get4SRefByYqShopList, selectByOrderCode, purchaseOrderDelete, getManageMode, getMerchantList, purchaseOrderPutIn, exportExcel, shoppingCarUpdateNumber, purchaseOrderAdd, shoppingCarAdd, shoppingCarRemove, updateSelectedFlag, listGroupByGoodsType, getPurchaseOrderList, purchaseOrderCancelOrCheck, purchaseOrderDetail, listWithPagePurchaseInfo, addressGet, addressSave }
......@@ -5,24 +5,24 @@ html {
margin: 0;
padding: 0;
overflow: hidden;
background-color: #F4F5FA;
background-color: #f4f5fa;
}
.purchase .container {
.purchase .container {
background: #ffffff;
// box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.purchase .m-b-20 {
.purchase .m-b-20 {
margin-bottom: 20px;
}
.purchase .p-t-20 {
padding-top: 20px;
}
.pointer{
cursor: pointer;
.pointer {
cursor: pointer;
}
.carIcon {
display: inline-block;
......@@ -32,6 +32,10 @@ cursor: pointer;
background-size: 100% 100%;
margin-right: 4px;
}
.el-cascader-menu__wrap{
height: 204px!important;
}
\ No newline at end of file
.el-cascader-menu__wrap {
height: 204px !important;
}
.message-Z-zinde {
z-index: 9999 !important;
}
......@@ -86,6 +86,7 @@ export const purchaseTypeList = [
}
]
export const membraneTypeList = [1, 4, 6, 12, 14]
export const goodsTypeList = ['自建商品-太阳膜', '自建商品-车衣', '自建商品-改色膜']
// 采购上架状态
export const purchaseGroundingStatusList = [
......
<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>
发货单号:
......@@ -23,18 +24,26 @@
</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>
<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">
<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>{{ 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>
......@@ -44,7 +53,8 @@
</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>
......@@ -124,8 +134,14 @@ export default {
},
getDetail() {
this.$apis.delivery.getDeliveryDetail({ id: this.id }).then(res => {
const { data } = 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
}
})
......@@ -148,42 +164,49 @@ export default {
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;
/deep/ .el-form-item__error {
padding-top: 2px;
z-index: 9999999;
position: static;
}
}
.lookNumber {
font-size: 14px;
color: #5850ff !important;
cursor: pointer;
margin-left: 8px;
}
.look-card-wrap {
max-height: 600px;
overflow-y: scroll;
overflow-x: hidden;
/deep/.el-table th.el-table__cell > .cell {
/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>
}</style>
......@@ -24,7 +24,7 @@
</GLTable>
<!-- 表格区域 end -->
</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>
</div>
</template>
......
......@@ -24,6 +24,7 @@
</GLTable>
<!-- 表格区域 end -->
</div>
<filmDialog :visible.sync="filmVisible" :info="info" @handleConfirm="handleFilmConfirm"></filmDialog>
<rejectDialog v-if="rejectDialogVisible" :visible.sync="rejectDialogVisible" @handleRejectConfirm="handleRejectConfirm"></rejectDialog>
</div>
</template>
......@@ -32,17 +33,19 @@
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import rejectDialog from './rejectDialog'
import filmDialog from '../purchaseOrder/components/FilmDialog'
import { groundingCheckStatusList, goodsSourceOptions } from '@/utils/constants.js'
export default {
name: 'purchaseCheck',
components: {
rejectDialog
rejectDialog,
filmDialog
},
data() {
return {
size: 'small',
url: url,
Spot:['yellowSpot','greenSpot','ashSpot','redSpot'],
Spot: ['yellowSpot', 'greenSpot', 'ashSpot', 'redSpot'],
searchForm: {
sortType: 2,
orderTimeStr: [],
......@@ -61,7 +64,7 @@ export default {
// 查看门店
detailVisible: false,
showFormData: [
{
{
label: '下单时间',
name: 'placeOrderTimeStr',
type: 'datePicker',
......@@ -100,7 +103,7 @@ export default {
optionList: [],
optionId: 'goodsType',
optionLabel: 'goodsTypeName',
optionsName: 'classificationOptions'
optionsName: 'classificationOptions'
},
{
label: '商品来源',
......@@ -299,13 +302,17 @@ export default {
rejectDialogVisible: false,
rejectObj: {},
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() {
// 获取所属分类
this.getPurchaseGroundingSearchSelectData(1)
this.getManageMode()
},
methods: {
......@@ -325,6 +332,11 @@ export default {
this.getOptionsList('showFormData')
})
},
getManageMode() {
this.$apis.purchaseShopping.getManageMode({}).then(res => {
this.manageMode = res
})
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
......@@ -357,11 +369,20 @@ export default {
//审核
handleCheck(row) {
if (row?.goodsSource == 1) { // 自营商品
this.secondConfirm('审核', `<p ${this.tipsTitleStyle}>是否确定审核?</p><p ${this.tipsContentStyle}>审核通过后,系统会自动创建自采采购订单并自动入库,且无法撤回</p>`, 'purchaseCheck', 'auditPurchaseCheck', { id: row.id })
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 })
}
} else if (row?.goodsSource == 0) { // 嘀加商品
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) {
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 @@
</span>
</div>
<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>
</GLDialog>
</template>
<script>
import { membraneTypeList } from '@/utils/constants.js'
import { membraneTypeList, goodsTypeList } from '@/utils/constants.js'
export default {
name: 'OrderDetailDialog',
props: {
......@@ -41,7 +53,7 @@ export default {
},
paramsObj: {
type: Object,
default: () => {}
default: () => { }
}
},
computed: {
......@@ -84,25 +96,37 @@ export default {
{
label: '所属分类',
prop: 'goodsTypeName',
width: 100
width: 150
},
{
label: '采购数量',
prop: 'goodsNumber',
formatter: cellValue => {
let condition = membraneTypeList.includes(cellValue.goodsType) ? `${cellValue.goodsNumber}卷` : `${cellValue.goodsNumber}件`
return this.paramsObj.purchaseType == 1 ? condition : `${cellValue.goodsNumber}件`
// 商品来源 1-商城采购 2-自采入库
let list = this.paramsObj.purchaseType == 1 ? membraneTypeList : goodsTypeList
let attr = this.paramsObj.purchaseType == 1 ? 'goodsType' : 'goodsTypeName'
let condition = list.includes(cellValue[attr]) ? `${cellValue.goodsNumber}卷` : `${cellValue.goodsNumber}件`
return condition
},
width: 100
},
{
label: '膜卷号',
prop: 'filmRollList',
addHtml: 'film',
width: 100
},
{
label: '库存总量',
prop: 'goodsTypeName',
formatter: cellValue => {
let condition = membraneTypeList.includes(cellValue.goodsType) ? `${cellValue.conversionValue ? cellValue.goodsNumber * cellValue.conversionValue : '-'}米` : `${cellValue.goodsNumber}件`
return this.paramsObj.purchaseType == 1 ? condition : `${cellValue.goodsNumber}件`
// 商品来源 1-商城采购 2-自采入库
let list = this.paramsObj.purchaseType == 1 ? membraneTypeList : goodsTypeList
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
},
......@@ -125,6 +149,8 @@ export default {
methods: {
dynamicParams() {
if (this.paramsObj.purchaseType == 1) {
let idx = this.tableParams.tableColumns.findIndex(item => item.label == '膜卷号')
this.tableParams.tableColumns.splice(idx, 1)
this.tableParams.tableColumns.push(
{
label: '已发货数量',
......@@ -224,4 +250,34 @@ export default {
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>
......@@ -19,6 +19,16 @@
<el-input v-model="scope.scope.goodsNumber" placeholder="请输入" @blur="handleCalculate(scope.scope, 'goodsNumber')"></el-input>
</el-form-item>
</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">
<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>
......@@ -56,10 +66,12 @@
<el-button @click="handleSave(1)" type="primary" plain size="medium">保存</el-button>
<el-button type="primary" @click="handleSave(2)" size="medium">保存并入库</el-button>
</GLFooter>
<filmDialog :visible.sync="filmVisible" :info="info" @handleConfirm="handleFilmConfirm"></filmDialog>
</div>
</template>
<script>
import BigNumber from 'bignumber.js'
import filmDialog from './components/FilmDialog'
export default {
data() {
var checkPrice = (rule, value, callback) => {
......@@ -84,7 +96,21 @@ export default {
goodsNumber: [
{ 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: [
{ required: true, message: '请输入采购单价', trigger: 'blur' },
......@@ -94,7 +120,7 @@ export default {
putMerchantId: [{ required: true, message: '请选择入库门店', trigger: 'change' }]
},
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: {
tableOption: true,
......@@ -109,8 +135,8 @@ export default {
prop: 'type'
},
{
label: '所属系列',
prop: 'goodsName'
label: '所属分类',
prop: 'goodsTypeName'
},
{
label: '采购数量',
......@@ -118,12 +144,17 @@ export default {
addHtml: 'goodsNumber'
},
{
label: '采购单价',
label: '膜卷号',
prop: 'filmRollList',
addHtml: 'film'
},
{
label: '采购单价/元',
prop: 'upgradePurchasePrice',
addHtml: 'upgradePurchasePrice'
},
{
label: '采购总额/元',
label: '采购总价/元',
prop: 'goodsTotalPrice',
addHtml: 'goodsTotalPrice'
},
......@@ -141,12 +172,20 @@ export default {
},
goodsList: [],
storeUsageList: [],
refByYqShopList: []
refByYqShopList: [],
filmVisible: false,
info: {},
goodsTypeList: ['自建商品-太阳膜', '自建商品-车衣', '自建商品-改色膜'],
manageMode: false
}
},
components: {
filmDialog
},
created() {
this.getfwsGoodsList()
this.getMerchantList()
this.getManageMode()
if (this.orderCode) this.getData()
},
methods: {
......@@ -156,6 +195,11 @@ export default {
if (this.storeUsageList.length == 1) this.defaultSelect()
})
},
getManageMode() {
this.$apis.purchaseShopping.getManageMode({}).then(res => {
this.manageMode = res
})
},
defaultSelect() {
let {
formdata: { tableData },
......@@ -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) {
this.$refs['addForm'].validate(valid => {
if (valid) {
......@@ -186,13 +242,15 @@ export default {
purchaseOrderGoodsList.push({
upgradeGoodsId: item.upgradeGoodsId,
goodsName: item.goodsName,
goodsTypeName: item.goodsTypeName,
goodsNumber: item.goodsNumber,
upgradePurchasePrice: item.upgradePurchasePrice,
goodsTotalPrice: item.goodsTotalPrice,
putYqMerchantId: item.putYqMerchantId,
putYqMerchantName: item.putYqMerchantName,
putMerchantId: item.putMerchantId,
putMerchantName: item.putMerchantName
putMerchantName: item.putMerchantName,
filmRollList: this.goodsTypeList.includes(item.goodsTypeName) ? item.filmRollList : ''
})
})
let params = {
......@@ -206,22 +264,10 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$apis.product.addSelfOrder(params).then(res => {
this.$notify({
type: 'success',
title: '操作成功'
})
this.goBack()
})
this.addSelfOrder(params)
})
} else {
this.$apis.product.addSelfOrder(params).then(res => {
this.$notify({
type: 'success',
title: '操作成功'
})
this.goBack()
})
this.addSelfOrder(params)
}
}
})
......@@ -252,6 +298,7 @@ export default {
if (item.upgradeGoodsId == id) {
data.type = item.type
data.goodsName = item.goodsCodeName
data.goodsTypeName = item.goodsTypeName
}
})
},
......@@ -272,15 +319,32 @@ 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) {
if (key == 'goodsNumber') {
data[key] = data[key] ? new BigNumber(data[key]).dp(0).toNumber() : ''
data.goodsTotalPrice =
data.upgradePurchasePrice && data.goodsNumber
? new BigNumber(data.upgradePurchasePrice)
.times(data.goodsNumber)
.dp(2)
.toNumber()
.times(data.goodsNumber)
.dp(2)
.toNumber()
: ''
return
}
......@@ -291,17 +355,17 @@ export default {
upgradePurchasePrice: data => {
data.goodsTotalPrice = data.upgradePurchasePrice
? new BigNumber(data.upgradePurchasePrice)
.times(data.goodsNumber)
.dp(2)
.toNumber()
.times(data.goodsNumber)
.dp(2)
.toNumber()
: ''
},
goodsTotalPrice: data => {
data.upgradePurchasePrice = data.goodsTotalPrice
? new BigNumber(data.goodsTotalPrice)
.div(data.goodsNumber)
.dp(2)
.toNumber()
.div(data.goodsNumber)
.dp(2)
.toNumber()
: ''
}
}
......@@ -318,6 +382,7 @@ export default {
upgradeGoodsId: '',
type: '',
goodsName: '',
goodsTypeName: '',
goodsNumber: '',
upgradePurchasePrice: '',
goodsTotalPrice: '',
......@@ -360,5 +425,17 @@ export default {
/deep/ td.el-table__cell {
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>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!