Commit dca93195 authored by xiangzj's avatar xiangzj

终端发货

parent 62c141ca
...@@ -92,6 +92,34 @@ ...@@ -92,6 +92,34 @@
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode=""></image> <image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode=""></image>
</view> </view>
</view> </view>
<view class="text-block" v-if="orderItem.demandType=='ZDZG'">
<text class="middle-date">要货单类型</text>
<view class="middle-date-address uni-list picker-year">
<view class="uni-list-cell">
<view class="uni-list-cell-db">
<picker disabled class="picker-block" @change="bindPickerChange($event,'manifest')" :value="orderItem.demandType"
range-key='name' mode="selector" :range="manifestArr">
<text class="uni-input">{{orderItem.demandTypeTextView}}</text>
</picker>
</view>
</view>
<!-- <image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode=""></image> -->
</view>
</view>
<view class="text-block" v-if="orderItem.demandType=='ZDZG'">
<text class="middle-date">绑定终端</text>
<view class="middle-date-address uni-list picker-year">
<view class="uni-list-cell">
<view class="uni-list-cell-db">
<picker class="picker-block" @change="bindPickerChange($event,'terminalRobot')" :value="orderItem.terminalId"
range-key='storeName' mode="selector" :range="terminalRobotArrs">
<text class="uni-input">{{orderItem.terminalName}}</text>
</picker>
</view>
</view>
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode=""></image>
</view>
</view>
</view> </view>
<uni-cell class="cell-list" v-for="(ele, index) in orderItem.wantGoodsDetailList" :key="ele.id"> <uni-cell class="cell-list" v-for="(ele, index) in orderItem.wantGoodsDetailList" :key="ele.id">
...@@ -167,7 +195,7 @@ ...@@ -167,7 +195,7 @@
import { import {
querySysDictionaryDetailsByCode, querySysDictionaryDetailsByCode,
getProdDeliveryPlan, getProdDeliveryPlan,
getChannelType getChannelType,
} from '@/servers/purchaseList.js' } from '@/servers/purchaseList.js'
export default { export default {
...@@ -191,6 +219,7 @@ ...@@ -191,6 +219,7 @@
ticketTypeArr : [], ticketTypeArr : [],
significanceArr : [], significanceArr : [],
marketPlaceArr : [], marketPlaceArr : [],
manifestArr : [],
pcjArr: [{value:'0',name: '否'}, {value:'1',name: '是'}] pcjArr: [{value:'0',name: '否'}, {value:'1',name: '是'}]
} }
}, },
...@@ -204,6 +233,10 @@ ...@@ -204,6 +233,10 @@
channelTypeArr: { channelTypeArr: {
type: Array, type: Array,
default: () => [] default: () => []
},
terminalRobotArrs: {
type: Array,
default: () => []
} }
}, },
computed: { computed: {
...@@ -242,6 +275,7 @@ ...@@ -242,6 +275,7 @@
this.getSelectDictDataOrigin('A0022') this.getSelectDictDataOrigin('A0022')
// this.getSelectDictDataOrigin('A0054') // this.getSelectDictDataOrigin('A0054')
this.getSelectDictDataOrigin('A0052') this.getSelectDictDataOrigin('A0052')
this.getSelectDictDataOrigin('A0081')
this.getSelectDictDataOrigin('Significance') this.getSelectDictDataOrigin('Significance')
// this.getProdDeliveryPlan() // this.getProdDeliveryPlan()
}, },
...@@ -281,6 +315,7 @@ ...@@ -281,6 +315,7 @@
url: `/pages/select-client/select-client` url: `/pages/select-client/select-client`
}); });
}, },
bindPickerChange(e,type) { bindPickerChange(e,type) {
console.log('picker发送选择改变,携带值为', e.detail.value) console.log('picker发送选择改变,携带值为', e.detail.value)
const index = e.detail.value || 0 const index = e.detail.value || 0
...@@ -304,6 +339,13 @@ ...@@ -304,6 +339,13 @@
case 'date': case 'date':
this.orderItem.saveEnddate = e.detail.value this.orderItem.saveEnddate = e.detail.value
break; break;
case 'manifest':
this.orderItem.demandType = this.manifestArr[index].value
this.orderItem.demandTypeTextView= this.manifestArr[index].name
case 'terminalRobot':
this.orderItem.terminalId = this.terminalRobotArrs[index].storeId
this.orderItem.terminalName= this.terminalRobotArrs[index].storeName
break;
// case 'marketPlace': // case 'marketPlace':
// this.marketPlaceVal = this.marketPlaceArr[index].value // this.marketPlaceVal = this.marketPlaceArr[index].value
// this.orderItem.kaStoreArea = this.marketPlaceArr[index].name // this.orderItem.kaStoreArea = this.marketPlaceArr[index].name
...@@ -327,6 +369,14 @@ ...@@ -327,6 +369,14 @@
}); });
return return
} }
if(this.orderItem.demandType == 'ZDZG' && !this.orderItem.terminalName){
uni.showToast({
title: '请先选择绑定终端',
duration: 2000,
icon: 'none'
});
return
}
const numFlag = this.orderItem.wantGoodsDetailList.every(function(item){ const numFlag = this.orderItem.wantGoodsDetailList.every(function(item){
return item.wantQuantity return item.wantQuantity
}); });
...@@ -365,6 +415,9 @@ ...@@ -365,6 +415,9 @@
case 'Significance': case 'Significance':
this.significanceArr = res.data.Rows this.significanceArr = res.data.Rows
break; break;
case 'A0081':
this.manifestArr = res.data.Rows
break;
// case 'A0054': // case 'A0054':
// this.channelTypeArr = res.data.Rows // this.channelTypeArr = res.data.Rows
// break; // break;
......
...@@ -91,6 +91,52 @@ ...@@ -91,6 +91,52 @@
</view> </view>
</view> </view>
<view class="middle view"> <view class="middle view">
<view class="text-block" v-if="isTerminalType">
<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="changeArea($event,'city')" :value="orderItem.REGION"
range-key='BEZEI' mode="selector" :range="selectDataOptions['regionList']">
<text class="uni-input">{{terminalAdd.REGION_TEXT}}</text>
</picker>
</view>
</view>
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode=""></image>
</view>
</view>
<view class="text-block" v-if="isTerminalType">
<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="changeArea($event,'street')" :value="orderItem.CITY_CODE"
range-key='CITY_NAME' mode="selector" :range="selectDataOptions['cityList']">
<text class="uni-input">{{terminalAdd.CITY_TEXT}}</text>
</picker>
</view>
</view>
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode=""></image>
</view>
</view>
<view class="text-block" v-if="isTerminalType">
<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="changeArea($event,'q')" :value="orderItem.STREET_CODE"
range-key='MC_STREET' mode="selector" :range="selectDataOptions['streetList']">
<text class="uni-input">{{terminalAdd.STREET_TEXT}}</text>
</picker>
</view>
</view>
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode=""></image>
</view>
</view>
<view class="text-block" v-if="isTerminalType">
<text class="middle-date">详细地址</text>
<input class="middle-date-des" type="text" v-model="terminalAdd.STREET" @blur="changeStreet($event)" placeholder="请输入" />
</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="orderItem.contactNumber" placeholder="请输入" /> <input class="middle-date-des" type="text" v-model="orderItem.contactNumber" placeholder="请输入" />
...@@ -185,12 +231,28 @@ ...@@ -185,12 +231,28 @@
doDeleteFile, doDeleteFile,
doQuery, doQuery,
attachmentDownFile, attachmentDownFile,
findShuntAnyByDealer findShuntAnyByDealer,
findFirstByTerminalId
} from '@/servers/purchaseList.js' } from '@/servers/purchaseList.js'
import { getArea } from '@/servers/address.js'
import { pathToBase64, base64ToPath } from 'image-tools' import { pathToBase64, base64ToPath } from 'image-tools'
export default { export default {
data() { data() {
return { return {
selectDataOptions: {
cityList: [],
streetList: [],
regionList: []
},
terminalAdd: {
REGION: '',
REGION_TEXT: '',
CITY_CODE: '',
CITY_TEXT: '',
STREET_CODE: '',
STREET_TEXT: '',
STREET: ''
},
isRadio: false, isRadio: false,
receiveUnitArr: [], receiveUnitArr: [],
shuntArr: [], shuntArr: [],
...@@ -236,6 +298,9 @@ ...@@ -236,6 +298,9 @@
} }
}, },
computed: { computed: {
isTerminalType() {
return this.orderItem.demandType == 'ZDZG'
},
imageStyles() { imageStyles() {
return { return {
width: 64, width: 64,
...@@ -309,6 +374,10 @@ ...@@ -309,6 +374,10 @@
if(this.sourceType === 'myPurchase'){ if(this.sourceType === 'myPurchase'){
this.getFiles(this.orderItem.id) this.getFiles(this.orderItem.id)
} }
if(this.isTerminalType){
this.changeTerminal()
this.getAreaArr()
}
}, },
onUnload() { onUnload() {
uni.$off('selectShuntAccountInfo') uni.$off('selectShuntAccountInfo')
...@@ -331,6 +400,57 @@ ...@@ -331,6 +400,57 @@
// this.queryData() // this.queryData()
}, },
methods: { methods: {
async changeArea(e, type) {
if (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
const index = e.detail.value || 0
if (type === 'city') {
const code = this.selectDataOptions['regionList'][index].BLAND
const { DATA } = await getArea(code, type,"ZDZG")
this.selectDataOptions.cityList = DATA
this.terminalAdd.REGION_TEXT = this.selectDataOptions['regionList'].find(v => v.BLAND === code)?.BEZEI
this.orderItem.receiveAddress = this.terminalAdd.REGION_TEXT
this.terminalAdd.CITY_CODE = ''
this.terminalAdd.STREET_CODE = ''
this.terminalAdd.CITY_TEXT = ''
this.terminalAdd.STREET_TEXT = ''
this.terminalAdd.STREET = ''
this.selectDataOptions.streetList = []
console.log(this.selectDataOptions.cityList,this.terminalAdd.REGION_TEXT, this.orderItem.receiveAddress)
} else if (type === 'street') {
const code = this.selectDataOptions['cityList'][index].CITY_CODE
const { DATA } = await getArea(code, type)
this.selectDataOptions.streetList = DATA
this.terminalAdd.STREET_CODE = ''
this.terminalAdd.STREET_TEXT = ''
this.terminalAdd.STREET = ''
this.terminalAdd.CITY_TEXT = this.selectDataOptions['cityList'].find(v => v.CITY_CODE === code)?.CITY_NAME
this.orderItem.receiveAddress = this.terminalAdd.REGION_TEXT + this.terminalAdd.CITY_TEXT
} else {
const code = this.selectDataOptions['streetList'][index].STRT_CODE
this.terminalAdd.STREET_TEXT = this.selectDataOptions['streetList'].find(v => v.STRT_CODE === code)?.MC_STREET
this.orderItem.receiveAddress = this.terminalAdd.REGION_TEXT + this.terminalAdd.CITY_TEXT + this.terminalAdd.STREET_TEXT + this.terminalAdd.STREET
}
}
},
async changeStreet(e){
const obj = this.terminalAdd
this.orderItem.receiveAddress = obj.REGION_TEXT + obj.CITY_TEXT + obj.STREET_TEXT + e.detail.value
},
// 请求历史收货地址
async changeTerminal(){
await findFirstByTerminalId({terminalId: this.orderItem.terminalId}).then(res => {
this.orderItem.receiveAddress = res.data.receiveAddress
this.orderItem.contactNumber = res.data.contactNumber
this.orderItem.contacPerson = res.data.contacPerson
})
},
// 省
async getAreaArr(){
await getArea('','region',"ZDZG").then(res => {
this.selectDataOptions['regionList'] = res.DATA
})
},
async getShuntAnyByDealer(){ async getShuntAnyByDealer(){
const res = await findShuntAnyByDealer({customerCode: this.userInfo.code}) const res = await findShuntAnyByDealer({customerCode: this.userInfo.code})
this.isRadio = res.data - 0 === 1 this.isRadio = res.data - 0 === 1
...@@ -447,6 +567,11 @@ ...@@ -447,6 +567,11 @@
this.orderItem.contactNumber = this.receiveUnitArr[0].TEL_NUMBER this.orderItem.contactNumber = this.receiveUnitArr[0].TEL_NUMBER
this.orderItem.contacPerson = this.receiveUnitArr[0].C_O_NAME this.orderItem.contacPerson = this.receiveUnitArr[0].C_O_NAME
this.orderItem.receiveAddress = this.receiveUnitArr[0].STREET this.orderItem.receiveAddress = this.receiveUnitArr[0].STREET
if(this.isTerminalType){
this.orderItem.contactNumber = ''
this.orderItem.contacPerson = ''
this.orderItem.receiveAddress = ''
}
}, },
getSelectDictDataOrigin(dictcode) { getSelectDictDataOrigin(dictcode) {
querySysDictionaryDetailsByCode({'code': dictcode}) querySysDictionaryDetailsByCode({'code': dictcode})
...@@ -491,7 +616,11 @@ ...@@ -491,7 +616,11 @@
this.orderItem.contactNumber = this.receiveUnitArr[index].TEL_NUMBER this.orderItem.contactNumber = this.receiveUnitArr[index].TEL_NUMBER
this.orderItem.receiveAddress = this.receiveUnitArr[index].STREET this.orderItem.receiveAddress = this.receiveUnitArr[index].STREET
this.orderItem.contacPerson = this.receiveUnitArr[index].C_O_NAME this.orderItem.contacPerson = this.receiveUnitArr[index].C_O_NAME
if(this.isTerminalType){
this.orderItem.contactNumber = ''
this.orderItem.contacPerson = ''
this.orderItem.receiveAddress = ''
}
} }
}, },
...@@ -594,9 +723,16 @@ ...@@ -594,9 +723,16 @@
for(let k in this.orderItem){ for(let k in this.orderItem){
this.orderItem[k] = this.orderItem[k] === null ? '' : this.orderItem[k] this.orderItem[k] = this.orderItem[k] === null ? '' : this.orderItem[k]
} }
const params = JSON.parse(JSON.stringify(this.orderItem)) const obj = {
...this.orderItem
}
if(this.isTerminalType){
obj.province = this.terminalAdd.REGION_TEXT || this.orderItem.province
obj.city = this.terminalAdd.CITY_TEXT || this.orderItem.city
obj.district = this.terminalAdd.STREET_TEXT || this.orderItem.district
}
const params = JSON.parse(JSON.stringify(obj))
params.wantGoodsDetailList = JSON.stringify(params.wantGoodsDetailList) params.wantGoodsDetailList = JSON.stringify(params.wantGoodsDetailList)
let res = null let res = null
if(params.id){ if(params.id){
// params.bizId = params.id // params.bizId = params.id
...@@ -663,7 +799,15 @@ ...@@ -663,7 +799,15 @@
} }
this.flag = true this.flag = true
try { try {
const params = JSON.parse(JSON.stringify(this.orderItem)) const obj = {
...this.orderItem
}
if(this.isTerminalType){
obj.province = this.terminalAdd.REGION_TEXT || this.orderItem.province
obj.city = this.terminalAdd.CITY_TEXT || this.orderItem.city
obj.district = this.terminalAdd.STREET_TEXT || this.orderItem.district
}
const params = JSON.parse(JSON.stringify(obj))
params.wantGoodsDetailList = JSON.stringify(params.wantGoodsDetailList) params.wantGoodsDetailList = JSON.stringify(params.wantGoodsDetailList)
let flagStatus = false let flagStatus = false
let status = 0 let status = 0
...@@ -842,6 +986,8 @@ ...@@ -842,6 +986,8 @@
} }
.uni-input { .uni-input {
line-height: 100%;
height: 100%;
font-size: 14px; font-size: 14px;
color: $text-base-color; color: $text-base-color;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="apply-history view" :style="winHeight"> <view class="apply-history view" :style="winHeight">
<view class="status_bar" :style="navHeight"></view> <view class="status_bar" :style="navHeight"></view>
<view class="apply-history-wrapper view"> <view class="apply-history-wrapper view">
<component :style="componentHeight" :sourceType='sourceType' :orderItem='detail' :channelTypeArr='channelTypeArr' :is="currentTabComponent" @click="changeComponent" @submit="submit" ></component> <component :style="componentHeight" :sourceType='sourceType' :orderItem='detail' :channelTypeArr='channelTypeArr' :terminalRobotArrs=terminalRobotArrs :is="currentTabComponent" @click="changeComponent" @submit="submit" ></component>
</view> </view>
</view> </view>
</template> </template>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
import { import {
mapState mapState
} from 'vuex' } from 'vuex'
import { initAppWantGoods, getChannelType, findById, generateUUID } from '@/servers/purchaseList.js' import { initAppWantGoods, getChannelType, findById, generateUUID, queryDirectStore } from '@/servers/purchaseList.js'
import purchaseMain from '../purchase-main/purchase-main' import purchaseMain from '../purchase-main/purchase-main'
import purchaseReceive from '../purchase-receive/purchase-receive' import purchaseReceive from '../purchase-receive/purchase-receive'
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
}, },
data() { data() {
return { return {
terminalRobotArrs: [],
demandType: '1',
sourceType: '', sourceType: '',
channelTypeArr: [], channelTypeArr: [],
currentTabComponent: 'purchaseMain', currentTabComponent: 'purchaseMain',
...@@ -55,7 +57,7 @@ ...@@ -55,7 +57,7 @@
}, },
computed: { computed: {
componentHeight(){ componentHeight(){
console.log('componentHeight',`${this.sysinfo.safeArea.height - 44 - this.topHeight}px`,this.sysinfo); // console.log('componentHeight',`${this.sysinfo.safeArea.height - 44 - this.topHeight}px`,this.sysinfo);
return { return {
'height':`${this.sysinfo.safeArea.height - 44 - this.topHeight}px` 'height':`${this.sysinfo.safeArea.height - 44 - this.topHeight}px`
} }
...@@ -119,6 +121,7 @@ ...@@ -119,6 +121,7 @@
// ...this.orderItem, // ...this.orderItem,
...JSON.parse(option.order) ...JSON.parse(option.order)
} }
this.demandType = this.orderItem.demandType
} }
}, },
created() { created() {
...@@ -152,7 +155,8 @@ ...@@ -152,7 +155,8 @@
...res.data, ...res.data,
shuntDealerName: res.data.shuntDealer, shuntDealerName: res.data.shuntDealer,
fileBizId: res.data.id, fileBizId: res.data.id,
bizCode: 'wantGoods' bizCode: 'wantGoods',
demandTypeTextView: res.data.demandType == 'ZDZG' ? '终端直配' : '',
} }
this.getChannelType() this.getChannelType()
}, },
...@@ -191,10 +195,26 @@ ...@@ -191,10 +195,26 @@
status: 0, status: 0,
isShunt: '0', isShunt: '0',
fileBizId: null, fileBizId: null,
bizCode: 'wantGoods' bizCode: 'wantGoods',
demandType: this.demandType ==1 ? '' : 'ZDZG',
demandTypeTextView: this.demandType ==1 ? '' : '终端直配',
terminalId: '',
terminalIdTextView: '',
} }
this.getChannelType() this.getChannelType()
this.sourceType === 'purchase' && this.generateUUID() this.sourceType === 'purchase' && this.generateUUID()
this.demandType == 2 && this.getTerminalRobot()
},
// 绑定终端
getTerminalRobot(){
const params = {
dealerId: this.detail.customerCode,
inventoryCode: this.detail.brand,
}
queryDirectStore(params).then(res => {
this.terminalRobotArrs = res.data.data
})
}, },
changeComponent(com) { changeComponent(com) {
this.currentTabComponent = com; this.currentTabComponent = com;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="header-bg"> <view class="header-bg">
<image class="header-bg-img" src="@/static/image/nav_bg@3x.png" mode="scaleToFill"></image> <image class="header-bg-img" src="@/static/image/nav_bg@3x.png" mode="scaleToFill"></image>
</view> </view>
<view class="main" :class="{'source-main':sourceType ==='wine'}" :style="mainHeight"> <view class="main" :class="{'source-main':isWine}" :style="mainHeight">
<list ref="list" class="scroll-area view" loadmoreoffset='100' @loadmore="scrolltolower" <list ref="list" class="scroll-area view" loadmoreoffset='100' @loadmore="scrolltolower"
:show-scrollbar='false'> :show-scrollbar='false'>
<refresh @refresh="refresh" :display="refreshing ? 'show' : 'hide'"> <refresh @refresh="refresh" :display="refreshing ? 'show' : 'hide'">
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</refresh> </refresh>
<cell v-for="(item,index) in lists" :key="item.plan_number"> <cell v-for="(item,index) in lists" :key="item.plan_number">
<view class="scroll-item"> <view class="scroll-item">
<view class="checkBox" v-if="sourceType ==='wine'"> <view class="checkBox" v-if="isWine">
<checkbox-group @change="handleCheck(index,item)"> <checkbox-group @change="handleCheck(index,item)">
<label> <label>
<checkbox :disabled='item.disabled' value="cb" :checked="item.checked" /> <checkbox :disabled='item.disabled' value="cb" :checked="item.checked" />
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<text class="item-block-label">开票总量</text> <text class="item-block-label">开票总量</text>
<text class="item-block-value">{{item.invoiceQty}}件</text> <text class="item-block-value">{{item.invoiceQty}}件</text>
</view> </view>
<view class="item-block item-block-code" v-if="sourceType ==='wine'"> <view class="item-block item-block-code" v-if="isWine">
<text class="item-block-label">开票总量</text> <text class="item-block-label">开票总量</text>
<text class="item-block-value">{{item.useBot}}瓶</text> <text class="item-block-value">{{item.useBot}}瓶</text>
</view> </view>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<text class="item-block-label">已发数量</text> <text class="item-block-label">已发数量</text>
<text class="item-block-value">{{item.deliveryQty}}件</text> <text class="item-block-value">{{item.deliveryQty}}件</text>
</view> </view>
<view class="item-block item-block-code" v-if="sourceType ==='wine'"> <view class="item-block item-block-code" v-if="isWine">
<text class="item-block-label">已发数量</text> <text class="item-block-label">已发数量</text>
<text class="item-block-value">{{item.deliverBot}}瓶</text> <text class="item-block-value">{{item.deliverBot}}瓶</text>
</view> </view>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<text class="item-block-label">剩余数量</text> <text class="item-block-label">剩余数量</text>
<text class="item-block-value">{{handleNum(item)}}</text> <text class="item-block-value">{{handleNum(item)}}</text>
</view> </view>
<view class="bottom" v-if="sourceType ==='common'"> <view class="bottom" v-if="!isWine">
<view class="bottom-btn"> <view class="bottom-btn">
<button class="btn btn-l" type="default" @tap="purchaseBtn(item)"> <button class="btn btn-l" type="default" @tap="purchaseBtn(item)">
<text class="btn-text btn-text-l">立即要货</text> <text class="btn-text btn-text-l">立即要货</text>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</cell> </cell>
<!-- <view class="planout-block-item__last"> </view> --> <!-- <view class="planout-block-item__last"> </view> -->
</list> </list>
<view class="bottom-box" v-if="sourceType ==='wine'"> <view class="bottom-box" v-if="isWine">
<button class="btn" type="default" @tap="nextStep"> <button class="btn" type="default" @tap="nextStep">
<text class="btn-text">立即要货</text> <text class="btn-text">立即要货</text>
</button> </button>
...@@ -149,6 +149,9 @@ ...@@ -149,6 +149,9 @@
'height': `${this.sysinfo.safeArea.height - 44 - 156 }px` 'height': `${this.sysinfo.safeArea.height - 44 - 156 }px`
} }
}, },
isWine(){
return this.sourceType ==='wine' || this.sourceType ==='wineTerminal'
}
}, },
onShow() { onShow() {
}, },
...@@ -159,7 +162,7 @@ ...@@ -159,7 +162,7 @@
onLoad(option) { onLoad(option) {
this.sourceType = option.type this.sourceType = option.type
this.lists = [] this.lists = []
if(this.sourceType ==='wine'){ if(this.isWine){
this.getWineList() this.getWineList()
this.reset() this.reset()
return return
...@@ -201,8 +204,12 @@ ...@@ -201,8 +204,12 @@
}); });
return return
} }
const params = {
...row,
demandType: this.sourceType ==='wine' ? '1' : '2'
}
uni.navigateTo({ uni.navigateTo({
url: `/pages/purchase/purchase-apply?order=${JSON.stringify(row)}&sourceType=purchase` url: `/pages/purchase/purchase-apply?order=${JSON.stringify(params)}&sourceType=purchase`
}) })
}, },
handleCheck(idx,row){ handleCheck(idx,row){
...@@ -239,15 +246,20 @@ ...@@ -239,15 +246,20 @@
return qty + bot return qty + bot
}, },
purchaseBtn(item) { purchaseBtn(item) {
const params = {
...item,
demandType: this.sourceType ==='common' ? '1' : '2'
}
uni.navigateTo({ uni.navigateTo({
url: `/pages/purchase/purchase-apply?order=${JSON.stringify(item)}&sourceType=purchase` url: `/pages/purchase/purchase-apply?order=${JSON.stringify(params)}&sourceType=purchase`
}) })
}, },
async getSalesPlan(isRefresh) { async getSalesPlan(isRefresh) {
// const params = { // const params = {
// ...this.page, // ...this.page,
// } // }
const params = `?page=${this.page.page}&pagesize=${this.page.pagesize}` const demandType = this.sourceType ==='common' ? '1' : '2'
const params = `?page=${this.page.page}&pagesize=${this.page.pagesize}&demandType=${demandType}`
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
}); });
...@@ -283,7 +295,8 @@ ...@@ -283,7 +295,8 @@
}, },
async getWineList(isRefresh){ async getWineList(isRefresh){
const params = `?page=${this.page.page}&pagesize=${this.page.pagesize}` const demandType = this.sourceType ==='wine' ? '1' : '2'
const params = `?page=${this.page.page}&pagesize=${this.page.pagesize}&demandType=${demandType}`
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
}); });
...@@ -355,7 +368,7 @@ ...@@ -355,7 +368,7 @@
this.loadingText = '加载中' this.loadingText = '加载中'
}, },
getSalesPlanTypes(type=null) { getSalesPlanTypes(type=null) {
if(this.sourceType ==='wine'){ if(this.isWine){
this.getWineList(type) this.getWineList(type)
return return
} }
......
...@@ -17,6 +17,20 @@ ...@@ -17,6 +17,20 @@
</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="cell-list-block" @click="goOrder('purchase-list','wineTerminal')">
<image class="icon-address" src="@/static/image/order_noquota@3x.png" mode="aspectFit"></image>
<view class="cell-list-block__content">
<text class="cell-list-block__title">终端直配以酒促酒要货</text>
</view>
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit"></image>
</view>
<view class="cell-list-block" @click="goOrder('purchase-list','terminal')">
<image class="icon-address" src="@/static/image/order_noquota@3x.png" mode="aspectFit"></image>
<view class="cell-list-block__content">
<text class="cell-list-block__title">终端直配发货</text>
</view>
<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit"></image>
</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -39,4 +39,13 @@ export async function inboundsById(params) { ...@@ -39,4 +39,13 @@ export async function inboundsById(params) {
export async function getClientByApp(params) { export async function getClientByApp(params) {
const res = await apiHelper.get('/crm-app/platform/getClientByApp', params) const res = await apiHelper.get('/crm-app/platform/getClientByApp', params)
return res return res
}
export const getArea = (code, type = 'region', mode) => {
if (type === 'region') {
return regionOvs({mode})
} else if (type === 'city') {
return cityOvs({ REGION: code, mode })
} else {
return streetOvs({ CITY_CODE: code, mode })
}
} }
\ No newline at end of file
...@@ -124,4 +124,14 @@ export async function attachmentDownFile(params) { ...@@ -124,4 +124,14 @@ export async function attachmentDownFile(params) {
export async function findShuntAnyByDealer(params) { export async function findShuntAnyByDealer(params) {
const res = await apiHelper.get('/crm-app/setShunting/findShuntAnyByDealer', params) const res = await apiHelper.get('/crm-app/setShunting/findShuntAnyByDealer', params)
return res return res
} }
\ No newline at end of file // 查询终端
export async function queryDirectStore(params) {
const res = await apiHelper.post('/crm-app/wmdp-storecomponent/storeDealer/queryDirectStore', params)
return res
}
// 查询终端要货 历史地址
export async function findFirstByTerminalId(params) {
const res = await apiHelper.post('/crm-app/wantgoods/findFirstByTerminalId', params, {'Content-Type': 'application/x-www-form-urlencoded'})
return res
}
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