Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
wly-APP
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘川
wly-APP
Commits
f9e98733
Commit
f9e98733
authored
May 19, 2022
by
chuan.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
非配额订单下单 mock数据联调
parent
5385314a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
433 additions
and
64 deletions
+433
-64
order-upload.nvue
pages/no-quota/order-upload.nvue
+136
-15
quota-order.nvue
pages/no-quota/quota-order.nvue
+257
-46
quota-order.nvue
pages/quota/quota-order.nvue
+1
-1
select-product.vue
pages/select-product/select-product.vue
+7
-2
noQuotaOrder.js
servers/noQuotaOrder.js
+26
-0
index.js
store/index.js
+6
-0
No files found.
pages/no-quota/order-upload.nvue
View file @
f9e98733
...
...
@@ -6,7 +6,8 @@
<text class="upload-text">附件上传</text>
</view>
<view class="upload-block">
<uni-file-picker ref='files' :auto-upload='false' v-model="fileList" file-mediatype="image" :imageStyles="imageStyles" @select="select" @progress="progress" @success="success" @fail='fail'>
<uni-file-picker ref='files' :auto-upload='false' v-model="fileList" file-mediatype="image"
:imageStyles="imageStyles" @select="select" @progress="progress" @success="success" @fail='fail'>
<text>+</text>
</uni-file-picker>
</view>
...
...
@@ -29,7 +30,7 @@
<image class="popup-content-head__icon" src="@/static/image/icon_plan@3x.png" mode=""></image>
</view>
<view class="popup-content-content">
<text class="popup-content-content__title">
支付
成功</text>
<text class="popup-content-content__title">
提交
成功</text>
<text class="popup-content-content__title2">订单号:{{ orderNo }}</text>
</view>
<view class="popup-content-foot">
...
...
@@ -43,15 +44,26 @@
</template>
<script>
import {
apiUpdateNoQuotaOrder
} from '@/servers/noQuotaOrder.js'
import {
mapMutations,
mapState
} from 'vuex'
export default {
data() {
return {
orderNo: '',
orderInfo: {},
fileList: [],
}
},
computed:{
imageStyles(){
computed: {
...mapState(['noQuotaOrder']),
imageStyles() {
return {
width: 64,
height: 64,
...
...
@@ -62,6 +74,113 @@
},
},
methods: {
async updateQuotaOrder() {
const params = {
"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': [{
"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_d": [],
"USE": [],
"attachment": []
}
const res = await apiUpdateNoQuotaOrder(params)
const {
ATTACHMENT,
HISTORY,
INFO,
ITEM
} = res.DATA
const params2 = {
"USER_BP": "81000010",
"MODE": "SUBMIT",
"info": INFO,
'ITEM': ITEM,
"item_d": [],
"attachment": ATTACHMENT
}
const res2 = await apiUpdateNoQuotaOrder(params2)
console.log('ddd2', res2)
this.orderInfo = res2
this.$refs.popup.open('center')
},
change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show);
},
...
...
@@ -71,11 +190,11 @@
},
// 选择文件
select(e) {
console.log('选择文件:', e)
console.log('选择文件:', e
, this.fileList
)
},
// 上传成功
success(e) {
console.log('上传成功',e)
console.log('上传成功',
e)
},
// 上传失败
fail(e) {
...
...
@@ -93,12 +212,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>
...
...
@@ -181,12 +302,12 @@
margin-top: 90rpx;
}
.uni-file-picker{
.uni-file-picker
{
width: 100%;
height: 100%;
}
/deep/ .uni-file-picker__container{
/deep/ .uni-file-picker__container
{
width: 100%;
height: 100%;
}
...
...
@@ -243,7 +364,7 @@
width: 580rpx;
height: 408rpx;
background: #ffffff;
border-radius: 2
0
rpx;
border-radius: 2
4
rpx;
}
.popup-content-head {
...
...
@@ -280,13 +401,13 @@
.popup-content-foot__btn {
width: 152rpx;
height: 60rpx;
font-size: 22rpx;
line-height: 60rpx;
background: #ffedee;
text-align: center;
color: #ff0f00;
font-weight: 500;
border-radius: 32rpx;
font-size: 22rpx;
}
.popup-content-foot__sure {
...
...
pages/no-quota/quota-order.nvue
View file @
f9e98733
...
...
@@ -6,55 +6,59 @@
<text class="upload-text">合计金额</text>
</view>
<view>
<text class="summary-num">
789*6*4
</text>
<text class="summary-num">
{{intotalComputed}}
</text>
</view>
</view>
<scroll-view class="scroll-area view" :scroll-top="scrollTop" scroll-y="true">
<view class="view">
<view class="planout-block">
<text class="planout-block-title">订购产品</text>
<image class="planout-block-icon" src="@/static/image/shop_more@3x.png" @click="addPlanout
"
<image class="planout-block-icon" src="@/static/image/shop_more@3x.png" @click="addPlanout()
"
mode="aspectFit"></image>
</view>
<uni-swipe-action class="planout-block-lists">
<uni-swipe-action-item v-for="item in planoutLists" :key='item
'>
<uni-swipe-action-item v-for="(item,index) in planinnerLists" :key='index
'>
<view class="middle view planout-block-item">
<view class="text-block title-first">
<text class="middle-date title-first__text">1
</text>
<text class="middle-date title-first__text">{{index+1}}
</text>
</view>
<view class="text-block
">
<view class="text-block" @click="selectProduct(index,'inner')
">
<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>
<text class="middle-date-des">{{item.SHORT_TEXT}}
</text>
</view>
</view>
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit"></image>
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit">
</image>
</view>
</view>
<view class="text-block">
<text class="middle-date">数量(件)</text>
<input class="middle-date-des" type="text" value="" placeholder="请填写" />
<input class="middle-date-des" type="number" :value="item.quantity"
@input="calcInnerTotal($event,item,index)" placeholder="请填写" />
</view>
<view class="text-block">
<text class="middle-date">单价</text>
<text class="middle-date-des">789
</text>
<text class="middle-date-des">{{item.NET_PRICE}}
</text>
</view>
<view class="text-block text-block-last">
<text class="middle-date">小计</text>
<text class="middle-date-des">789*6*4
</text>
<text class="middle-date-des">{{item.total}}
</text>
</view>
</view>
<template v-slot:right>
<view class="swipe-right-block" @click="handleDel"><text
class="swipe-right-block__text">删除</text>
<view class="swipe-right-block" @click="handleDel(index,'inner')">
<text
class="swipe-right-block__text">删除</text>
</view>
</template>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<view class="bottom-area"></view>
<view class="bottom">
...
...
@@ -65,27 +69,234 @@
<text class="btn-text">下一步</text>
</button>
</view>
</scroll-view>
</view>
</template>
<script>
import {
apiUpdateNoQuotaData
} from '@/servers/noQuotaOrder.js'
import {
mapMutations,
mapState
} from 'vuex'
export default {
data() {
return {
scrollTop: 0,
planoutLists: 2
mode: 'inner',
typesIndex: 0,
planinnerLists: [{
checked: false,
"PRODUCT_ID": "",
"ORDERED_PROD": "",
"DESCRIPTION": "",
"SHORT_TEXT": "",
'NET_PRICE': '',
'NET_VALUE': '',
'quantity': 0,
'total': 0,
'product_info': {}
}]
}
},
computed: {
...mapState(['quotaOrder']),
intotalComputed() {
let money = 0
this.planinnerLists.forEach((item) => {
money += item.total
})
return money
}
},
mounted() {
console.log('监听到事件来自 onShow');
let _this = this
uni.$on('selectedProduct', function(data) {
console.log('监听到事件来自 selectedProduct ,携带参数 msg 为:', data);
const fromIndex = data.index * 1
const selectedProduct = data.selectedProduct
_this.mode = data.mode
_this.updateQuotaData(fromIndex, data.mode, selectedProduct);
})
},
onUnload() {
uni.$off('selectedSalePlan')
uni.$off('selectedProduct')
},
methods: {
handleDel() {
this.planoutLists--
async updateQuotaData(productIndex, mode, product) {
console.log('updateQuotaData---entry', productIndex, mode, product)
let productId = ''
let item_inner = []
if (mode === 'inner') {
productId = product.PRODUCT_ID
item_inner = [{
"GUID": "00000000000000000000000000000000",
"HEADER": "00000000000000000000000000000000",
"NUMBER_INT": "0000000010",
"ITM_TYPE": "",
"ZZFLD000029": "",
"ZZFLD000005": '',
"ZZFLD000005_Z1": "",
"ZZFLD000006": "",
"ZZFLD00002Q": "",
"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": "100%",
"ZZFLD00002G": "",
"ZZFLD00002I": "",
"ZZFLD000007": "",
"ZZFLD000032": "",
"ZZFLD00002O": "",
"ZZFLD000035": "",
"ZZFLD00002B": "",
"ZZFLD000008": "",
"ZZFLD00002P": "",
"CURRENCY": "",
"MODE": "",
"WAREHOUSE": "",
"PRDTYPE": "",
"YEAR": "",
"ZZFLD00002Q_D": ""
}]
}
const params = {
"info": {
"GUID": "00000000000000000000000000000000",
"OBJECT_ID": "",
"PROCESS_TYPE": "ZS02",
"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": item_inner,
}
const res = await apiUpdateNoQuotaData(params)
console.log('updateQuotaData', res)
const {
ITEM
} = res.DATA
if (mode === 'inner') {
this.planinnerLists = this.planinnerLists.map((item, i) => {
if (i === productIndex) {
item = {
...item,
...product,
...ITEM[0]
}
item.product_info = ITEM[0]
}
return item
})
console.log('planinnerLists', this.planinnerLists)
}
},
calcInnerTotal(e, item, i) {
console.log('sss', item, e)
let value = e.target.value
e.target.value = value * 1
this.planinnerLists.forEach((product, index) => {
if (i === index) {
product.quantity = value * 1
product.total = value * item.NET_VALUE * 1 || 0
}
})
// value = `${value}`.replace(/[^0-9]/g, '') // 正则判断只能输入数字
},
handleDel(index, mode = 'inner') {
if (mode === 'inner') {
this.planinnerLists.splice(index, 1)
}
},
selectProduct(index, mode = 'inner') {
this.mode = mode
uni.navigateTo({
url: `/pages/select-product/select-product?from=noQuotaOrder&mode=${mode}&index=${index}`
});
},
addPlanout() {
this.planoutLists++
let product = {
checked: false,
"PRODUCT_ID": "",
"ORDERED_PROD": "",
"DESCRIPTION": "",
"SHORT_TEXT": "",
'NET_PRICE': '',
'NET_VALUE': '',
'quantity': 0,
'total': 0,
'product_info': {},
'salesplan_info': {}
}
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': [],
'item_d': [],
'attachment': []
}
this.$uStore({
name: 'noQuotaOrder',
value: quotaOrder
});
this.$emit('click', 'orderUpload')
},
preStep() {
...
...
@@ -93,6 +304,7 @@
url: `/pages/go-order/go-order`
})
},
...mapMutations(["$uStore"]),
}
}
</script>
...
...
@@ -253,7 +465,6 @@
width: 152rpx;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 34rpx;
font-weight: 500;
...
...
pages/quota/quota-order.nvue
View file @
f9e98733
...
...
@@ -504,7 +504,7 @@
selectPlanOrder(product, index, mode = 'inner') {
if (this.planinnerLists && this.planinnerLists.length > 0) {
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}`
});
} else {
uni.showToast({
...
...
pages/select-product/select-product.vue
View file @
f9e98733
...
...
@@ -70,6 +70,11 @@
apiProductSelect
}
from
'@/servers/common.js'
const
modeMap
=
{
'quotaOrder'
:
'QUOTA'
,
'noQuotaOrder'
:
'NO_QUOTA'
,
}
export
default
{
data
()
{
return
{
...
...
@@ -104,7 +109,7 @@
return
{
'height'
:
`
${
this
.
sysinfo
.
safeArea
.
top
+
44
}
px`
}
}
,
}
},
onNavigationBarButtonTap
(
e
)
{
// console.log('onNavigationBarButtonTap:', e, this.isOpened, this.selectedProduct);
...
...
@@ -158,7 +163,7 @@
const
params
=
{
'page'
:
1
,
'pagesize'
:
'10'
,
"MODE"
:
"QUOTA"
,
"MODE"
:
modeMap
[
this
.
toPageParams
.
page
]
,
"INFO"
:
{
"PROCESS_TYPE"
:
"ZS01"
,
"CUSTOMER"
:
"0050000215"
...
...
servers/noQuotaOrder.js
0 → 100644
View file @
f9e98733
import
apiHelper
from
'./api.helper.js'
/**
* 销售订单行项目选择或修改后进行页面数据更新
* @param
* @returns {Promise<AxiosResponse<T>>}
*/
export
async
function
apiUpdateNoQuotaData
(
params
)
{
const
res
=
await
apiHelper
.
post
(
'/sap/bc/ztpm/to_new_crm/transdata/so_u_data_other'
,
params
)
return
res
}
/**
* 针对配额产品经销商保存、提交、取消、审核配额订单
* @param
* @returns {Promise<AxiosResponse<T>>}
*/
export
async
function
apiUpdateNoQuotaOrder
(
params
)
{
const
res
=
await
apiHelper
.
post
(
'/sap/bc/ztpm/to_new_crm/transdata/so_no_quota'
,
params
)
return
res
}
export
default
{
apiUpdateNoQuotaData
,
apiUpdateNoQuotaOrder
}
store/index.js
View file @
f9e98733
...
...
@@ -47,6 +47,12 @@ const store = new Vuex.Store({
'item_outer'
:
[],
'item_d'
:
[],
'attachment'
:
[]
},
noQuotaOrder
:
{
'ITEM_INNER'
:
[],
'item_outer'
:
[],
'item_d'
:
[],
'attachment'
:
[]
}
},
mutations
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment