Commit 421dd34e authored by chuan.liu's avatar chuan.liu

配额订单 新增初始化接口联调

parent 1bfc2e7f
...@@ -102,6 +102,10 @@ ...@@ -102,6 +102,10 @@
"/sap": { "/sap": {
"target": "http://10.0.134.45:8000", "target": "http://10.0.134.45:8000",
"changeOrigin": true "changeOrigin": true
},
"/crm-app": {
"target": "http://10.0.135.139:8080",
"changeOrigin": true
} }
} }
} }
......
...@@ -48,11 +48,6 @@ ...@@ -48,11 +48,6 @@
apiUpdateGroupOrder apiUpdateGroupOrder
} from '@/servers/groupOrder.js' } from '@/servers/groupOrder.js'
import {
mapMutations,
mapState
} from 'vuex'
export default { export default {
data() { data() {
return { return {
...@@ -62,7 +57,7 @@ ...@@ -62,7 +57,7 @@
} }
}, },
computed: { computed: {
...mapState(['groupOrder']), ...mapState(['noQuotaOrder']),
imageStyles() { imageStyles() {
return { return {
width: 64, width: 64,
......
...@@ -49,13 +49,17 @@ ...@@ -49,13 +49,17 @@
mapState mapState
} from 'vuex' } from 'vuex'
import {
apiLogin
} from '@/servers/user.js'
export default { export default {
data() { data() {
return { return {
account: '', account: '',
password: '', password: '',
phone: '', phone: '',
code: '', code: '',
loginType: 'password', loginType: 'password',
passwordVisible: false, passwordVisible: false,
...@@ -89,14 +93,17 @@ ...@@ -89,14 +93,17 @@
}, },
onLoad(option) { onLoad(option) {
console.log('login-option', option) console.log('login-option', option)
this.loginType = this.option?.loginType || 'password' this.loginType = this.option?.loginType || 'password'
if(this.loginType === 'password'){ if (this.loginType === 'password') {
const {account,password} = this.userInfo const {
this.account = account account,
this.password = password password
// this.goLogin() } = this.userInfo
}else{ this.account = account
this.code = this.option.code this.password = password
// this.goLogin()
} else {
this.code = this.option.code
} }
}, },
methods: { methods: {
...@@ -113,9 +120,27 @@ ...@@ -113,9 +120,27 @@
} else { } else {
const ispass = await this.validate(); const ispass = await this.validate();
if (!ispass) return; if (!ispass) return;
uni.switchTab({ const parmas = {
url: '/pages/home/home' username: '0050000215',
}); password: 'DO1tjHPW0Z',
loginType: 'App'
}
// const res = await apiLogin(parmas)
const res = {
status: 1
}
if (res) {
this.$uStore({
name: 'userInfo',
value: {
customerCode: '0050000215'
}
});
uni.switchTab({
url: '/pages/home/home'
});
}
} }
}, },
fnChangeLogin() { fnChangeLogin() {
...@@ -150,7 +175,8 @@ ...@@ -150,7 +175,8 @@
resolve(flag); resolve(flag);
}) })
} },
...mapMutations(["$uStore"]),
} }
} }
</script> </script>
......
...@@ -10,14 +10,16 @@ ...@@ -10,14 +10,16 @@
</view> </view>
</view> </view>
<view class="middle upload summary"> <view class="middle summary upload salescenter">
<text class="middle-date">营销中心</text> <text class="middle-date">营销中心</text>
<view class="middle-date-des uni-list picker-year"> <view class="middle-date-des uni-list picker-year">
<view class="uni-list-cell"> <view class="uni-list-cell">
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<picker class="picker-block" @change="bindPickerTypesChange" range-key='VALUE' mode="selector" <picker class="picker-block" @change="bindPickerSalesCenterChange" mode="selector"
:value="typesIndex" :range="selectedSalePlanTypes"> :value="salesCenterIndex" range-key='VALUE' :range="selectedSalesCenterArr">
<view class="uni-input">{{selectedSalePlanTypes[typesIndex].VALUE}}</view> <view class="uni-input">
{{selectedSalesCenterArr[salesCenterIndex] && selectedSalesCenterArr[salesCenterIndex].VALUE || '请选择'}}
</view>
</picker> </picker>
</view> </view>
</view> </view>
...@@ -38,34 +40,36 @@ ...@@ -38,34 +40,36 @@
<view class="text-block title-first"> <view class="text-block title-first">
<text class="middle-date title-first__text">{{index+1}}</text> <text class="middle-date title-first__text">{{index+1}}</text>
</view> </view>
<view class="text-block" @click="selectProduct(index,'inner')"> <view class="text-block" @click="selectPlanOrder(item,index)">
<text class="middle-date">产品</text> <text class="middle-date">计划编号</text>
<view class="middle-date-des uni-list picker-year"> <view class="middle-date-des uni-list picker-year">
<view class="uni-list-cell"> <view class="uni-list-cell">
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<text class="middle-date-des">{{item.SHORT_TEXT}}</text> <text class="middle-date-des">{{item.ZZFLD000005}}</text>
</view> </view>
</view> </view>
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit"> <image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit">
</image> </image>
</view> </view>
</view> </view>
<view class="text-block" @click="selectPlanOrder(item,index)"> <view class="text-block" @click="selectProduct(index,'inner')">
<text class="middle-date">计划编号</text> <text class="middle-date">产品</text>
<view class="middle-date-des uni-list picker-year"> <view class="middle-date-des uni-list picker-year">
<view class="uni-list-cell"> <view class="uni-list-cell">
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<text class="middle-date-des">{{item.ZZFLD000005}}</text> <text class="middle-date-des">{{item.DESCRIPTION}}</text>
</view> </view>
</view> </view>
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit"> <image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit">
</image> </image>
</view> </view>
</view> </view>
<view class="text-block"> <view class="text-block">
<text class="middle-date">数量(件)</text> <text class="middle-date">数量(件)</text>
<input class="middle-date-des" type="number" :value="item.quantity" <input class="middle-date-des" type="number" :value="item.quantity"
@input="calcInnerTotal($event,item,index)" placeholder="请填写" /> @input="calcInnerTotal($event,item,index)"
@blur="updateQuotaData(index,'inner',item)" placeholder="请填写" />
</view> </view>
<view class="text-block"> <view class="text-block">
<text class="middle-date">单价</text> <text class="middle-date">单价</text>
...@@ -115,7 +119,8 @@ ...@@ -115,7 +119,8 @@
<view class="text-block"> <view class="text-block">
<text class="middle-date">数量(件)</text> <text class="middle-date">数量(件)</text>
<input class="middle-date-des" type="number" :value="item.quantity" <input class="middle-date-des" type="number" :value="item.quantity"
@input="calcOuterTotal($event,item,index)" placeholder="请填写" /> @input="calcOuterTotal($event,item,index)"
@blur="updateQuotaData(index,'outer',item)" placeholder="请填写" />
</view> </view>
<view class="text-block"> <view class="text-block">
<text class="middle-date">单价</text> <text class="middle-date">单价</text>
...@@ -123,7 +128,7 @@ ...@@ -123,7 +128,7 @@
</view> </view>
<view class="text-block text-block-last"> <view class="text-block text-block-last">
<text class="middle-date">小计</text> <text class="middle-date">小计</text>
<text class="middle-date-des">{{item.total}}</text> <text class="middle-date-des">{{item.NET_VALUE}}</text>
</view> </view>
</view> </view>
<template v-slot:right> <template v-slot:right>
...@@ -187,6 +192,7 @@ ...@@ -187,6 +192,7 @@
<script> <script>
import { import {
apiInitQuotaData,
apiUpdateQuotaData apiUpdateQuotaData
} from '@/servers/quotaOrder.js' } from '@/servers/quotaOrder.js'
...@@ -200,29 +206,26 @@ ...@@ -200,29 +206,26 @@
return { return {
scrollTop: 0, scrollTop: 0,
mode: 'inner', mode: 'inner',
selectedSalePlanTypes: [{ selectedSalesCenterArr: [{
KEY: '22', KEY: -1,
VALUE: 'dasd' VALUE: ''
}], }],
typesIndex: 0, selectedSalesCenter: {},
salesCenterIndex: -1,
planoutLists: [], planoutLists: [],
planinnerLists: [{ planinnerLists: [{
checked: false, checked: false,
"PRODUCT_ID": "",
"ORDERED_PROD": "",
"DESCRIPTION": "",
"SHORT_TEXT": "",
'NET_PRICE': '',
'NET_VALUE': '',
'quantity': 0, 'quantity': 0,
'total': 0, 'total': 0,
'product_info': {}, 'product_info': {},
'salesplan_info': {} 'salesplan_info': {}
}] }],
HEADINFO: {},
productInitInfo: {}
} }
}, },
computed: { computed: {
...mapState(['quotaOrder']), ...mapState(['quotaOrder', 'userInfo']),
intotalComputed() { intotalComputed() {
let money = 0 let money = 0
this.planinnerLists.forEach((item) => { this.planinnerLists.forEach((item) => {
...@@ -234,11 +237,14 @@ ...@@ -234,11 +237,14 @@
return money return money
} }
}, },
created() {
this.initQuotaData()
},
mounted() { mounted() {
console.log('监听到事件来自 onShow'); console.log('监听到事件来自 onShow');
let _this = this let _this = this
uni.$on('selectedSalePlan', function(data) { uni.$on('selectedSalePlan', function(data) {
console.log('监听到事件来自 selectedSalePlan ,携带参数 msg 为:', data); console.log('监听到事件来自 selectedSalePlan ,携带参数 msg 为:', data, _this.planinnerLists);
const fromIndex = data.index * 1 const fromIndex = data.index * 1
let selectedSalePlan = data.selectedSalePlan let selectedSalePlan = data.selectedSalePlan
let selectedProductSalePlan = {} let selectedProductSalePlan = {}
...@@ -247,6 +253,7 @@ ...@@ -247,6 +253,7 @@
item.salesplan_info = { item.salesplan_info = {
...selectedSalePlan ...selectedSalePlan
} }
item.ZZFLD000005 = selectedSalePlan.PLAN_NUMBER
selectedProductSalePlan = { selectedProductSalePlan = {
...item ...item
} }
...@@ -262,7 +269,20 @@ ...@@ -262,7 +269,20 @@
const selectedProduct = data.selectedProduct const selectedProduct = data.selectedProduct
_this.mode = data.mode _this.mode = data.mode
_this.updateQuotaData(fromIndex, data.mode, selectedProduct); let product = {}
_this.planinnerLists = _this.planinnerLists.map((item, i) => {
if (i === fromIndex) {
item.product_info = {
...selectedProduct
}
product = {
...item
}
}
return item
})
_this.updateQuotaData(fromIndex, data.mode, product);
}) })
}, },
...@@ -271,146 +291,57 @@ ...@@ -271,146 +291,57 @@
uni.$off('selectedProduct') uni.$off('selectedProduct')
}, },
methods: { methods: {
// 初始化订单数据
async initQuotaData() {
const params = {
'PARTNER': this.userInfo.customerCode
}
const res = await apiInitQuotaData(params)
const {
HEAD,
YXDY,
ITEM_INNER
} = res
this.selectedSalesCenterArr = YXDY
this.planinnerLists[0] = {
...this.planinnerLists[0],
...ITEM_INNER[0]
}
this.HEADINFO = HEAD
this.productInitInfo = ITEM_INNER[0]
},
// 更新行项目信息
async updateQuotaData(productIndex, mode, product) { async updateQuotaData(productIndex, mode, product) {
console.log('updateQuotaData---entry', productIndex, mode, product) console.log('updateQuotaData---entry', productIndex, mode, product)
let productId = '' let productId = ''
let item_type = '' let item_type = ''
let item_inner = [] let item_inner = []
let item_outer = [] let item_outer = []
let productAfterInit = this.updateProductByInit(productIndex, mode, product)
console.log('2222', productAfterInit)
// 销售计划编号、产品编号和件数 都有才请求
if (!(productAfterInit?.product_info?.PRODUCT_ID && productAfterInit?.salesplan_info?.PLAN_NUMBER &&
productAfterInit?.ZZFLD000009)) {
return
}
if (mode === 'inner') { if (mode === 'inner') {
productId = product.PRODUCT_ID
item_type = "ITEM_INNER" item_type = "ITEM_INNER"
item_outer = [] item_outer = []
item_inner = [{ item_inner = [productAfterInit]
"GUID": "00000000000000000000000000000000",
"HEADER": "00000000000000000000000000000000",
"NUMBER_INT": "0000000010",
"ITM_TYPE": "",
"ZZFLD000029": "V001",
"ZZFLD000005": product?.ZZFLD000005 ? product?.ZZFLD000005 : '',
"ZZFLD000005_Z1": "",
"ZZFLD000006": "20220322",
"ZZFLD00002Q": "V001",
"ZZFLD00002Q_Z1": "",
"ORDERED_PROD": productId,
"DESCRIPTION": product.SHORT_TEXT,
"ZZFLD00002S": product.NORMS,
"UNIT": "",
"ZZFLD00002T": "盒",
"QUANTITY": "",
"ZZFLD00002U": "",
"ZZFLD00002W": "",
"ZZFLD000009": "1.00",
"INVENTORY": "",
"ZZFLD00002E": "",
"NET_PRICE": "",
"ZZFLD00002X": "",
"NET_VALUE": "",
"ZZFLD00002Z": "",
"ZZFLD00002A": "",
"ZZFLD00002F": "",
"ZZFLD00002G": "",
"ZZFLD00002I": "",
"ZZFLD000007": "",
"ZZFLD000032": "",
"ZZFLD00002O": "",
"ZZFLD000035": "",
"ZZFLD00002B": "",
"ZZFLD000008": "",
"ZZFLD00002P": "",
"CURRENCY": "",
"MODE": "",
"WAREHOUSE": "",
"PRDTYPE": "",
"YEAR": "",
"ZZFLD00002Q_D": ""
}]
} else { } else {
productId = product.PRODUCT_ID
item_type = "ITEM_OUTER" item_type = "ITEM_OUTER"
item_inner = [] item_inner = []
item_outer = [{ item_outer = []
"GUID": "00000000000000000000000000000000",
"HEADER": "00000000000000000000000000000000",
"NUMBER_INT": "0000000010",
"ITM_TYPE": "",
"ZZFLD000029": "V001",
"ZZFLD000005": "3800000826",
"ZZFLD000005_Z1": "",
"ZZFLD000006": "20220322",
"ZZFLD00002Q": "V001",
"ZZFLD00002Q_Z1": "",
"ORDERED_PROD": productId,
"DESCRIPTION": "五粮液.1618(131) 52%618mL×6",
"ZZFLD00002S": "52%618ML×6",
"UNIT": "",
"ZZFLD00002T": "盒",
"QUANTITY": "",
"ZZFLD00002U": "",
"ZZFLD00002W": "",
"ZZFLD000009": "1.00",
"INVENTORY": "",
"ZZFLD00002E": "",
"NET_PRICE": "",
"ZZFLD00002X": "",
"NET_VALUE": "",
"ZZFLD00002Z": "",
"ZZFLD00002A": "",
"ZZFLD00002F": "",
"ZZFLD00002G": "",
"ZZFLD00002I": "",
"ZZFLD000007": "",
"ZZFLD000032": "",
"ZZFLD00002O": "",
"ZZFLD000035": "",
"ZZFLD00002B": "",
"ZZFLD000008": "",
"ZZFLD00002P": "",
"CURRENCY": "",
"MODE": "",
"WAREHOUSE": "",
"PRDTYPE": "",
"YEAR": "",
"ZZFLD00002Q_D": ""
}]
} }
const params = { const params = {
"item_type": item_type, "item_type": item_type,
"info": { "info": this.HEADINFO,
"GUID": "00000000000000000000000000000000",
"OBJECT_ID": "",
"PROCESS_TYPE": "ZS01",
"CUSTOMER": "0050000215",
"CUST_NAME": "崇州顺辰商贸有限公司",
"CUSTOMER_TYPE": "V003",
"ZZFLD000000": "",
"ZZFLD000028": "",
"ZZFLD00002D": "81000010",
"ZZFLD00002D_DSCR": "董平",
"POSTING_DATE": "20220321",
"STATUS": "E0001",
"ZZFLD000001": "0005000006",
"ZZFLD00003E": "",
"ZZFLD000002": "230",
"ZZFLD000003": "000000510100",
"ZZFLD000004": "",
"ZZFLD000004_DSCR": "",
"ZZFLD00002J": "",
"ZZFLD00002K": "",
"ZZFLD00002L": "",
"ZZFLD00002M": "",
"ZZFLD00002N": "",
"SALES_ORG": "",
"CHANNEL": "",
"DIVISION": "",
"CUST_PRIC_PROC": "",
"TAX_GROUP_BP_01": "",
"ZZFLD00003C": "",
"ZZFLD00009O": 0.00,
"ZZFLD00009Q": 0.00,
"ZHKYE": 0.00
},
"item_inner": item_inner, "item_inner": item_inner,
"item_outer": item_outer "item_outer": item_outer
} }
...@@ -433,6 +364,7 @@ ...@@ -433,6 +364,7 @@
return item return item
}) })
// 1对1
if (ITEM_OUTER && ITEM_OUTER[0] && product && product.salesplan_info) { if (ITEM_OUTER && ITEM_OUTER[0] && product && product.salesplan_info) {
if (this.planoutLists.length > 0) { if (this.planoutLists.length > 0) {
let isHasOutTargetIndex = this.planoutLists.findIndex((out) => { let isHasOutTargetIndex = this.planoutLists.findIndex((out) => {
...@@ -471,6 +403,37 @@ ...@@ -471,6 +403,37 @@
} }
}, },
// 更新选中的产品
updateProductByInit(productIndex, mode, product) {
const {
PRODUCT_ID,
SHORT_TEXT
} = product.product_info
let obj = {}
if (mode === 'inner') {
this.planinnerLists = this.planinnerLists.map((item, i) => {
if (i === productIndex) {
item.ORDERED_PROD = PRODUCT_ID
item.DESCRIPTION = SHORT_TEXT
item.ZZFLD000009 = item.quantity
obj = item
}
return item
})
} else if (mode === 'outer') {
this.planoutLists = this.planoutLists.map((item, i) => {
if (i === productIndex) {
item.ORDERED_PROD = PRODUCT_ID
item.DESCRIPTION = SHORT_TEXT
item.ZZFLD000009 = item.quantity
obj = item
}
return item
})
}
return obj
},
// 计算小计
calcInnerTotal(e, item, i) { calcInnerTotal(e, item, i) {
console.log('sss', item, e) console.log('sss', item, e)
let value = e.target.value let value = e.target.value
...@@ -483,17 +446,21 @@ ...@@ -483,17 +446,21 @@
}) })
// value = `${value}`.replace(/[^0-9]/g, '') // 正则判断只能输入数字 // value = `${value}`.replace(/[^0-9]/g, '') // 正则判断只能输入数字
}, },
// 计算小计
calcOuterTotal(e, item, i) { calcOuterTotal(e, item, i) {
console.log('sss', item, e) console.log('sss', item, e)
let value = e.target.value let value = e.target.value
e.target.value = value * 1 e.target.value = value * 1
this.planoutLists.forEach((product, index) => { this.planoutLists.forEach((product, index) => {
if (i === index) { if (i === index && item.NET_VALUE) {
// TODO 可优化接口处理 目前暂时前端处理
product.ZZFLD000009 = value * 1
product.quantity = value * 1 product.quantity = value * 1
product.total = value * item.NET_VALUE * 1 || 0 product.total = value * item.NET_VALUE * 1 || 0
} }
}) })
}, },
// 移除某个产品
handleDel(index, mode = 'inner') { handleDel(index, mode = 'inner') {
if (mode === 'inner') { if (mode === 'inner') {
this.planinnerLists.splice(index, 1) this.planinnerLists.splice(index, 1)
...@@ -501,10 +468,11 @@ ...@@ -501,10 +468,11 @@
this.planoutLists.splice(index, 1) this.planoutLists.splice(index, 1)
} }
}, },
// 选择销售计划
selectPlanOrder(product, index, mode = 'inner') { selectPlanOrder(product, index, mode = 'inner') {
if (this.planinnerLists && this.planinnerLists.length > 0) { if (this.planinnerLists && this.planinnerLists[0] && this.planinnerLists[0].ORDERED_PROD) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/select-sale-plan/select-sale-plan?from=quotaOrder&product=${JSON.stringify((product))}&index=${index}` url: `/pages/select-sale-plan/select-sale-plan?from=quotaOrder&product=${JSON.stringify((product))}&index=${index}&head=${JSON.stringify(this.HEADINFO)}`
}); });
} else { } else {
uni.showToast({ uni.showToast({
...@@ -514,12 +482,22 @@ ...@@ -514,12 +482,22 @@
}); });
} }
}, },
// 选择产品
selectProduct(index, mode = 'inner') { selectProduct(index, mode = 'inner') {
this.mode = mode this.mode = mode
uni.navigateTo({ if (this.salesCenterIndex !== -1) {
url: `/pages/select-product/select-product?from='quotaOrder'&mode=${mode}&index=${index}` uni.navigateTo({
}); url: `/pages/select-product/select-product?from=quotaOrder&mode=${mode}&index=${index*1}&head=${JSON.stringify(this.HEADINFO)}`
});
} else {
uni.showToast({
title: '请先选择营销中心',
duration: 2000,
icon: 'none'
});
}
}, },
// 新增产品
addPlanout() { addPlanout() {
let product = { let product = {
checked: false, checked: false,
...@@ -536,9 +514,12 @@ ...@@ -536,9 +514,12 @@
} }
this.planinnerLists.unshift(product) this.planinnerLists.unshift(product)
}, },
bindPickerTypesChange(e) { // 选择营销中心
bindPickerSalesCenterChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value) console.log('picker发送选择改变,携带值为', e.detail.value)
this.typesIndex = e.detail.value this.salesCenterIndex = e.detail.value
this.selectedSalesCenter = this.selectedSalesCenterArr[this.salesCenterIndex]
this.HEADINFO.ZZFLD000001 = this.selectedSalesCenter.KEY
}, },
nextStep() { nextStep() {
let quotaOrder = { let quotaOrder = {
...@@ -676,6 +657,10 @@ ...@@ -676,6 +657,10 @@
justify-content: space-between; justify-content: space-between;
} }
.salescenter {
height: 100rpx;
}
.icon_plan { .icon_plan {
width: 36rpx; width: 36rpx;
height: 36rpx; height: 36rpx;
......
...@@ -6,19 +6,12 @@ ...@@ -6,19 +6,12 @@
<view class="middle view"> <view class="middle view">
<view class="text-block "> <view class="text-block ">
<text class="middle-date">产品名称</text> <text class="middle-date">产品名称</text>
<input class="middle-date-des" type="text" v-model="condition.product" placeholder="请填写" /> <input class="middle-date-des" type="text" v-model="condition.product" placeholder="模糊查询,请手动加*" />
</view>
<view class="text-block text-block-last">
<text class="middle-date">产品编码</text>
<input class="middle-date-des" type="text" v-model="condition.code" placeholder="请输入" />
</view> </view>
<!-- <view class="text-block text-block-last">
<text class="middle-date">计划类型</text>
<view class="middle-date-des uni-list picker-year">
<view class="uni-list-cell">
<view class="uni-list-cell-db">
<text class="middle-date-des">请选择</text>
</view>
</view>
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit"></image>
</view>
</view> -->
</view> </view>
<view class="planout-block"> <view class="planout-block">
...@@ -83,7 +76,12 @@ ...@@ -83,7 +76,12 @@
array: ['2021', '2020', '2019', '2018'], array: ['2021', '2020', '2019', '2018'],
index: 0, index: 0,
condition: { condition: {
product: '' product: '',
code: '',
},
page: {
"PAGE": "1",
"PAGESIZE": "10",
}, },
lists: [{ lists: [{
checked: false, checked: false,
...@@ -100,7 +98,8 @@ ...@@ -100,7 +98,8 @@
toPageParams: { toPageParams: {
page: '', page: '',
mode: '', mode: '',
index: 0 index: 0,
head: {}
} }
} }
}, },
...@@ -147,35 +146,34 @@ ...@@ -147,35 +146,34 @@
const { const {
from, from,
mode, mode,
index index,
head
} = option } = option
this.toPageParams.index = index this.toPageParams.index = index
this.toPageParams.mode = mode this.toPageParams.mode = mode
this.toPageParams.page = from this.toPageParams.page = from
this.toPageParams.head = JSON.parse(head)
}, },
created() { created() {
this.getProduct(); this.getProduct();
}, },
methods: { methods: {
search() { search() {
this.page.PAGE = 1
this.getProduct()
}, },
async getProduct() { async getProduct() {
const params = { const params = {
"PAGE": "1", ...this.page,
"PAGESIZE": "10",
"MODE": modeMap[this.toPageParams.page], "MODE": modeMap[this.toPageParams.page],
"INFO": { "INFO": this.toPageParams.head,
"PROCESS_TYPE": "ZS02",
"CUSTOMER": "0050000215",
"ZZFLD00002J": "V013"
},
"input": { "input": {
"SHORT_TEXT": this.condition.product "SHORT_TEXT": this.condition.product,
"PRODUCT_ID": this.condition.code,
}, },
} }
const res = await apiProductSelect(params) const res = await apiProductSelect(params)
console.log('ddd2', res)
this.lists = res && res.DATA.map((item) => { this.lists = res && res.DATA.map((item) => {
item.checked = false item.checked = false
return item return item
......
...@@ -39,7 +39,9 @@ ...@@ -39,7 +39,9 @@
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<picker class="picker-block" @change="bindPickerTypesChange" range-key='VALUE' <picker class="picker-block" @change="bindPickerTypesChange" range-key='VALUE'
mode="selector" :value="typesIndex" :range="selectedSalePlanTypes"> mode="selector" :value="typesIndex" :range="selectedSalePlanTypes">
<view class="uni-input">{{selectedSalePlanTypes[typesIndex].VALUE}}</view> <view class="uni-input">
{{selectedSalePlanTypes[typesIndex] && selectedSalePlanTypes[typesIndex].VALUE || '请选择'}}
</view>
</picker> </picker>
</view> </view>
</view> </view>
...@@ -107,6 +109,10 @@ ...@@ -107,6 +109,10 @@
MONAT: '', MONAT: '',
PLAN_TYPE: '' PLAN_TYPE: ''
}, },
page: {
"PAGE": "1",
"PAGESIZE": "10",
},
lists: [{ lists: [{
checked: false, checked: false,
"REPORT_TYPE": "正式提报", "REPORT_TYPE": "正式提报",
...@@ -123,11 +129,12 @@ ...@@ -123,11 +129,12 @@
}, ], }, ],
selectedSalePlan: {}, selectedSalePlan: {},
selectedSalePlanTypes: [], selectedSalePlanTypes: [],
typesIndex: 0, typesIndex: -1,
toPageParams: { toPageParams: {
page: '', page: '',
index: 0, index: 0,
product: {} product: {},
head: {}
} }
} }
}, },
...@@ -173,10 +180,12 @@ ...@@ -173,10 +180,12 @@
if (option && option.from) { if (option && option.from) {
const { const {
from, from,
product product,
head
} = option } = option
this.toPageParams.product = JSON.parse(product) this.toPageParams.product = JSON.parse(product)
this.toPageParams.page = from this.toPageParams.page = from
this.toPageParams.head = JSON.parse(head)
} }
}, },
created() { created() {
...@@ -192,89 +201,10 @@ ...@@ -192,89 +201,10 @@
PLAN_TYPE PLAN_TYPE
} = this.condition } = this.condition
const params = { const params = {
'page': 1, ...this.page,
'pagesize': '10', "INFO": this.toPageParams.head,
"info": { "ITEM": this.toPageParams.product,
"GUID": "00000000000000000000000000000000", "INPUT": {},
"OBJECT_ID": "",
"PROCESS_TYPE": "ZS01",
"CUSTOMER": "0050000215",
"CUST_NAME": "崇州顺辰商贸有限公司",
"CUSTOMER_TYPE": "V003",
"ZZFLD000000": "",
"ZZFLD000028": "",
"ZZFLD00002D": "81000010",
"ZZFLD00002D_DSCR": "董平",
"POSTING_DATE": "20220321",
"STATUS": "E0001",
"ZZFLD000001": "0005000006",
"ZZFLD00003E": "",
"ZZFLD000002": "230",
"ZZFLD000003": "000000510100",
"ZZFLD000004": "",
"ZZFLD000004_DSCR": "",
"ZZFLD00002J": "",
"ZZFLD00002K": "",
"ZZFLD00002L": "",
"ZZFLD00002M": "",
"ZZFLD00002N": "",
"SALES_ORG": "0 50000025",
"CHANNEL": "",
"DIVISION": "",
"CUST_PRIC_PROC": "1",
"TAX_GROUP_BP_01": "FULL",
"ZZFLD00003C": "",
"ZZFLD00009O": "0.00",
"ZZFLD00009Q": "0.00",
"ZHKYE": "0.00"
},
"item": {
"GUID": "",
"HEADER": "",
"NUMBER_INT": "0000000010",
"ITM_TYPE": "",
"ZZFLD000029": "V001",
"ZZFLD000005": "",
"ZZFLD000005_Z1": "",
"ZZFLD000006": "20220322",
"ZZFLD00002Q": "",
"ZZFLD00002Q_Z1": "",
"ORDERED_PROD": this.toPageParams.product.PRODUCT_ID,
"DESCRIPTION": "五粮液.1618(131) 52%618mL×6",
"ZZFLD00002S": "52%618ML×6",
"UNIT": "KAR",
"ZZFLD00002T": "盒",
"QUANTITY": "",
"ZZFLD00002U": "",
"ZZFLD00002W": "",
"ZZFLD000009": "",
"INVENTORY": "",
"ZZFLD00002E": "13.00%",
"NET_PRICE": "",
"ZZFLD00002X": "",
"NET_VALUE": "",
"ZZFLD00002Z": "100%",
"ZZFLD00002A": "",
"ZZFLD00002F": "",
"ZZFLD00002G": "",
"ZZFLD00002I": "",
"ZZFLD000007": "",
"ZZFLD000032": "",
"ZZFLD00002O": "",
"ZZFLD000035": "",
"ZZFLD00002B": "",
"ZZFLD000008": "",
"ZZFLD00002P": "",
"CURRENCY": "",
"MODE": "",
"WAREHOUSE": "",
"PRDTYPE": "",
"YEAR": "",
"ZZFLD00002Q_D": ""
},
"input": {
},
"INPUT_APP": { "INPUT_APP": {
GJAHR, GJAHR,
MONAT, MONAT,
...@@ -286,12 +216,10 @@ ...@@ -286,12 +216,10 @@
item.checked = false item.checked = false
return item return item
}) })
console.log('ddd2', res)
}, },
async getSalesPlanTypes() { async getSalesPlanTypes() {
const res = await apiSalesPlanTypesSelect() const res = await apiSalesPlanTypesSelect()
this.selectedSalePlanTypes = res.DATA this.selectedSalePlanTypes = res.DATA
console.log('getSalesPlanTypes', res)
}, },
search() { search() {
this.getSalesPlan(); this.getSalesPlan();
......
import apiHelper from './api.helper.js' import apiHelper from './api.helper.js'
/**
* 配额酒销售订单初始化数据
* @param
* @returns {Promise<AxiosResponse<T>>}
*/
export async function apiInitQuotaData(params) {
const res = await apiHelper.post('/sap/bc/ztpm/to_new_crm/transdata/so_quota_init', params)
return res
}
/** /**
* 销售订单行项目选择或修改后进行页面数据更新 * 销售订单行项目选择或修改后进行页面数据更新
* @param * @param
...@@ -21,6 +31,7 @@ export async function apiUpdateQuotaOrder(params) { ...@@ -21,6 +31,7 @@ export async function apiUpdateQuotaOrder(params) {
} }
export default { export default {
apiInitQuotaData,
apiUpdateQuotaData, apiUpdateQuotaData,
apiUpdateQuotaOrder apiUpdateQuotaOrder
} }
import { LOGIN } from './base.api.js' import apiHelper from './api.helper.js'
import apiHelper from './api.helper.js'
/**
/** * 登录服务
* 登录服务 * @param
* @param name 账户名 * @returns {Promise<AxiosResponse<T>>}
* @param password 账户密码 */
* @param captcha 验证码 export async function apiLogin(params) {
* @returns {Promise<AxiosResponse<T>>} const res = await apiHelper.post('/crm-app/login', params)
*/ return res
export async function login(params) { }
const { status, data } = await apiHelper.get(LOGIN, params, false)
return data export default {
apiLogin
} }
export default { login }
...@@ -39,8 +39,9 @@ const store = new Vuex.Store({ ...@@ -39,8 +39,9 @@ const store = new Vuex.Store({
vuex_version: '1.0.1', vuex_version: '1.0.1',
vuex_demo: '绛紫', vuex_demo: '绛紫',
userInfo: { userInfo: {
account: '', username: '',
password: '' password: '',
customerCode: '' || '0050000215'
}, },
quotaOrder: { quotaOrder: {
'ITEM_INNER': [], 'ITEM_INNER': [],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment