Commit 5385314a authored by chuan.liu's avatar chuan.liu

配额订单 下单 mock数据下单联调

parent 86b26abd
// #ifndef VUE3
import Vue from 'vue'
import App from './App'
import uView from 'uview-ui';
import App from './App'
import uView from 'uview-ui';
Vue.use(uView);
Vue.config.productionTip = false
App.mpType = 'app'
App.mpType = 'app'
import store from '@/store';
const app = new Vue({
// 引入uView提供的对vuex的简写法文件
// let vuexStore = require('@/store/$u.mixin.js');
// Vue.mixin(vuexStore);
Vue.prototype.$store = store
const app = new Vue({
store,
...App
})
...App
})
// http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
import httpInterceptor from '@/servers/http.interceptor.js';
Vue.use(httpInterceptor, app);
Vue.use(httpInterceptor, app);
app.$mount()
// #endif
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
import {
createSSRApp
} from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
// #endif
\ No newline at end of file
// #endif
......@@ -44,14 +44,25 @@
</template>
<script>
import {
apiUpdateQuotaOrder
} from '@/servers/quotaOrder.js'
import {
mapMutations,
mapState
} from 'vuex'
export default {
data() {
return {
orderNo: '',
orderInfo: {},
fileList: [],
}
},
computed: {
...mapState(['quotaOrder']),
imageStyles() {
return {
width: 64,
......@@ -63,6 +74,141 @@
},
},
methods: {
async updateQuotaOrder() {
const params = {
"USER_BP": "81000010",
"MODE": "SAVE",
"info": {
"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": "0 50000025",
"CHANNEL": "",
"DIVISION": "",
"CUST_PRIC_PROC": "1",
"TAX_GROUP_BP_01": "FULL",
"ZZFLD00003C": "",
"ZZFLD00009O": "0.00",
"ZZFLD00009Q": "0.00",
"ZHKYE": "0.00"
},
'ITEM_INNER': [{
"GUID": "00000000000000000000000000000000",
"HEADER": "00000000000000000000000000000000",
"NUMBER_INT": "0000000010",
"ITM_TYPE": "",
"ZZFLD000029": "V001",
"ZZFLD000005": "3800000826",
"ZZFLD000005_Z1": "",
"ZZFLD000006": "20220322",
"ZZFLD00002Q": "V001",
"ZZFLD00002Q_Z1": "",
"ORDERED_PROD": "040001005280115668",
"DESCRIPTION": "五粮液.1618(131) 52%618mL×6",
"ZZFLD00002S": "52%618ML×6",
"UNIT": "KAR",
"ZZFLD00002T": "盒",
"QUANTITY": 6.000,
"ZZFLD00002U": 6.00,
"ZZFLD00002W": 6.00,
"ZZFLD000009": 1.00,
"INVENTORY": 0.00,
"ZZFLD00002E": " 13.00%",
"NET_PRICE": 769.00,
"ZZFLD00002X": 769.00,
"NET_VALUE": 4614.00,
"ZZFLD00002Z": 4614.00,
"ZZFLD00002A": "",
"ZZFLD00002F": " 100.00%",
"ZZFLD00002G": 769.00,
"ZZFLD00002I": 0.00,
"ZZFLD000007": 0.00,
"ZZFLD000032": 0.00,
"ZZFLD00002O": 0.00,
"ZZFLD000035": 0.00,
"ZZFLD00002B": "",
"ZZFLD000008": "",
"ZZFLD00002P": "0000000000",
"CURRENCY": "",
"MODE": "",
"WAREHOUSE": "",
"PRDTYPE": "",
"YEAR": "0000",
"ZZFLD00002Q_D": ""
}],
"item_outer": [],
"item_d": [],
"USE": [{
"CLIENT": "",
"RECORD_ID": "00000000000000000000000000000000",
"PARENT_ID": "00000000000000000000000000000000",
"OBJECT_ID": "00000000000000000000000000000000",
"ZZFLD00000C": "3800000826",
"ZZFLD00000D": "V001",
"ZZFLD00000E": "0102",
"ZZFLD00000F": "2022",
"ZZFLD00000G": "04",
"ZZFLD00000H": 10.00,
"ZZFLD00000I": "",
"ZZFLD00000J": 10.00,
"ZZFLD00000K": "",
"ZZFLD00000L": 1.00,
"ZZFLD00000M": "",
"ZZFLD00000N": 0.00,
"ZZFLD00000O": "",
"ZZFLD00000P": 9.00,
"ZZFLD00000Q": "",
"ZZFLD00000R": 1.00,
"ZZFLD00000S": ""
}],
"attachment": []
}
const res = await apiUpdateQuotaOrder(params)
const {
ATTACHMENT,
HISTORY,
INFO,
ITEM_INNER,
ITEM_OUTER,
USE
} = res.DATA
const params2 = {
"USER_BP": "81000010",
"MODE": "SUBMIT",
"info": INFO,
'ITEM_INNER': ITEM_INNER,
"item_outer": ITEM_OUTER,
"item_d": [],
"USE": USE,
"attachment": ATTACHMENT
}
const res2 = await apiUpdateQuotaOrder(params2)
console.log('ddd2', res2)
this.orderInfo = res2
this.$refs.popup.open('center')
},
change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show);
},
......@@ -72,7 +218,7 @@
},
// 选择文件
select(e) {
console.log('选择文件:', e)
console.log('选择文件:', e, this.fileList)
},
// 上传成功
success(e) {
......@@ -94,12 +240,14 @@
this.$refs.popup.close()
},
submit() {
this.$refs.popup.open('center')
this.$refs.files.upload()
this.updateQuotaOrder()
// this.$refs.files.upload()
},
preStep() {
this.$emit('click', 'quotaOrder')
},
...mapMutations(["$uStore"]),
}
}
</script>
......@@ -296,4 +444,4 @@
background: #ff1d32;
border: 1px solid #ff1d32;
}
</style>
</style>
......@@ -10,6 +10,21 @@
</view>
</view>
<view class="middle upload summary">
<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">
<picker class="picker-block" @change="bindPickerTypesChange" range-key='VALUE' mode="selector"
:value="typesIndex" :range="selectedSalePlanTypes">
<view class="uni-input">{{selectedSalePlanTypes[typesIndex].VALUE}}</view>
</picker>
</view>
</view>
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit"></image>
</view>
</view>
<scroll-view class="scroll-area view" :scroll-top="scrollTop" scroll-y="true">
<view class="view">
<view class="planout-block">
......@@ -175,11 +190,21 @@
apiUpdateQuotaData
} from '@/servers/quotaOrder.js'
import {
mapMutations,
mapState
} from 'vuex'
export default {
data() {
return {
scrollTop: 0,
mode: 'inner',
selectedSalePlanTypes: [{
KEY: '22',
VALUE: 'dasd'
}],
typesIndex: 0,
planoutLists: [],
planinnerLists: [{
checked: false,
......@@ -197,6 +222,7 @@
}
},
computed: {
...mapState(['quotaOrder']),
intotalComputed() {
let money = 0
this.planinnerLists.forEach((item) => {
......@@ -510,7 +536,21 @@
}
this.planinnerLists.unshift(product)
},
bindPickerTypesChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.typesIndex = e.detail.value
},
nextStep() {
let quotaOrder = {
'ITEM_INNER': this.planinnerLists,
'item_outer': this.planoutLists,
'item_d': [],
'attachment': []
}
this.$uStore({
name: 'quotaOrder',
value: quotaOrder
});
this.$emit('click', 'orderUpload')
},
preStep() {
......@@ -518,6 +558,7 @@
url: `/pages/go-order/go-order`
})
},
...mapMutations(["$uStore"]),
}
}
</script>
......
......@@ -41,8 +41,6 @@
mode="selector" :value="typesIndex" :range="selectedSalePlanTypes">
<view class="uni-input">{{selectedSalePlanTypes[typesIndex].VALUE}}</view>
</picker>
</uni-data-select>
</view>
</view>
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit"></image>
......
......@@ -42,7 +42,14 @@ const install = (Vue, vm) => {
if (res.MSGTYPE === 'S') {
// 如果把originalData设置为了true,这里return回什么,this.$u.post的then回调中就会得到什么
return res;
} else return false;
} else {
uni.showToast({
title: res.MESSAGE,
duration: 2000,
icon: 'none'
});
return false
};
}
}
......
......@@ -10,6 +10,17 @@ export async function apiUpdateQuotaData(params) {
return res
}
/**
* 针对配额产品经销商保存、提交、取消、审核配额订单
* @param
* @returns {Promise<AxiosResponse<T>>}
*/
export async function apiUpdateQuotaOrder(params) {
const res = await apiHelper.post('/sap/bc/ztpm/to_new_crm/transdata/so_quota', params)
return res
}
export default {
apiUpdateQuotaData
apiUpdateQuotaData,
apiUpdateQuotaOrder
}
import {
mapState
} from 'vuex'
import store from "@/store"
// 尝试将用户在根目录中的store/index.js的vuex的state变量,全部加载到全局变量中
let $uStoreKey = [];
try {
$uStoreKey = store.state ? Object.keys(store.state) : [];
} catch (e) {
}
module.exports = {
beforeCreate() {
// 将vuex方法挂在到$u中
// 使用方法为:如果要修改vuex的state中的user.name变量为"史诗" => this.$u.vuex('user.name', '史诗')
// 如果要修改vuex的state的version变量为1.0.1 => this.$u.vuex('version', '1.0.1')
this.$u.vuex = (name, value) => {
this.$store.commit('$uStore', {
name,
value
})
}
},
computed: {
// 将vuex的state中的所有变量,解构到全局混入的mixin中
...mapState($uStoreKey)
}
}
......@@ -4,20 +4,20 @@ Vue.use(Vuex)
let lifeData = {};
try{
try {
// 尝试获取本地是否存在lifeData变量,第一次启动APP时是不存在的
lifeData = uni.getStorageSync('lifeData');
}catch(e){
} catch (e) {
}
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
let saveStateKeys = ['vuex_user', 'vuex_token'];
// 保存变量到本地存储中
const saveLifeData = function(key, value){
const saveLifeData = function(key, value) {
// 判断变量名是否在需要存储的数组中
if(saveStateKeys.indexOf(key) != -1) {
if (saveStateKeys.indexOf(key) != -1) {
// 获取本地存储的lifeData对象,将变量添加到对象中
let tmp = uni.getStorageSync('lifeData');
// 第一次打开APP,不存在lifeData变量,故放一个{}空对象
......@@ -31,14 +31,22 @@ const store = new Vuex.Store({
state: {
// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {name: '明月'},
vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {
name: '明月'
},
vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
vuex_version: '1.0.1',
vuex_demo: '绛紫',
userInfo:{
account:'',
password:''
vuex_demo: '绛紫',
userInfo: {
account: '',
password: ''
},
quotaOrder: {
'ITEM_INNER': [],
'item_outer': [],
'item_d': [],
'attachment': []
}
},
mutations: {
......@@ -47,9 +55,9 @@ const store = new Vuex.Store({
let nameArr = payload.name.split('.');
let saveKey = '';
let len = nameArr.length;
if(len >= 2) {
if (len >= 2) {
let obj = state[nameArr[0]];
for(let i = 1; i < len - 1; i ++) {
for (let i = 1; i < len - 1; i++) {
obj = obj[nameArr[i]];
}
obj[nameArr[len - 1]] = payload.value;
......@@ -65,4 +73,4 @@ const store = new Vuex.Store({
}
})
export default store
export default store
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