Commit e52be289 by chenwq

bug修复

1 parent e981fc4d
......@@ -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 }
......@@ -86,6 +86,7 @@ export const purchaseTypeList = [
}
]
export const membraneTypeList = [1, 4, 6, 12, 14]
export const goodsTypeList = ['自建商品-太阳膜', '自建商品-车衣', '自建商品-改色膜']
// 采购上架状态
export const purchaseGroundingStatusList = [
......
......@@ -137,6 +137,7 @@ export default {
goodsList: [],
storeUsageList: [],
refByYqShopList: [],
goodsWarehousingList: [],
tableParams: {
tableOption: true,
tableColumns: [
......@@ -362,15 +363,35 @@ export default {
let params = {
deliveryDetailList: this.$common.utils.deepClone(deliveryDetailList)
}
console.log(this.detailInfo, 'this.detailInfo---')
console.log(params, 'params----')
params.deliveryDetailList.forEach(item => {
// console.log(this.detailInfo, 'this.detailInfo---')
for (let i = 0; i < params.deliveryDetailList.length; i++) {
item = params.deliveryDetailList[i]
item.id = this.detailInfo.id
item.goodsWarehousingList.forEach(subItem => {
for (let j = 0; j < item.goodsWarehousingList.length; j++) {
let subItem = item.goodsWarehousingList[j]
// 校验:膜卷号必填
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
})
}
// console.log(params, 'params----')
this.$apis.delivery.addPurchaseOrder(params).then(res => {
if (res.code == 0) {
this.$message({
......
......@@ -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>
......
......@@ -26,8 +26,8 @@
</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>
<el-button size="small" @click="dialogShow = false">取消</el-button>
<el-button type="primary" size="small" @click="handleSave">确定</el-button>
</span>
</GLDialog>
</template>
......
......@@ -26,13 +26,14 @@
<div class="table-class">
<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" content="fjdksl" placement="top" effect="light">
<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>
......@@ -42,7 +43,7 @@
</template>
<script>
import { membraneTypeList } from '@/utils/constants.js'
import { membraneTypeList, goodsTypeList } from '@/utils/constants.js'
export default {
name: 'OrderDetailDialog',
props: {
......@@ -101,9 +102,11 @@ export default {
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
},
......@@ -117,9 +120,11 @@ export default {
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 condition = list.includes(cellValue[attr]) ? `${cellValue.conversionValue ? cellValue.goodsNumber * cellValue.conversionValue : '-'}米` : `${cellValue.goodsNumber}件`
return condition
},
width: 100
},
......
......@@ -96,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)) {
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' },
......@@ -208,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) {
......@@ -224,7 +250,7 @@ export default {
putYqMerchantName: item.putYqMerchantName,
putMerchantId: item.putMerchantId,
putMerchantName: item.putMerchantName,
filmRollList: item.filmRollList
filmRollList: this.goodsTypeList.includes(item.goodsTypeName) ? item.filmRollList : ''
})
})
let params = {
......@@ -238,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)
}
}
})
......@@ -320,6 +334,7 @@ export default {
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') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!