Commit 37bfd9e0 authored by xiangzj's avatar xiangzj

修复市场秩序

parent 19bb7335
...@@ -910,22 +910,22 @@ ...@@ -910,22 +910,22 @@
} }
} }
}, },
// { {
// "path": "pages/breakwords-clue/breakwords-clue", "path": "pages/breakwords-clue/breakwords-clue",
// "style": { "style": {
// "app-plus": { "app-plus": {
// "titleNView": { "titleNView": {
// "titleAlign": "left", "titleAlign": "left",
// "titleColor": "#333", "titleColor": "#333",
// "titleSize": "17px", "titleSize": "17px",
// "backgroundColor": "transparent", "backgroundColor": "transparent",
// "titleText": "提报市场违约线索", "titleText": "提报市场违约线索",
// "autoBackButton": true "autoBackButton": true
// }, },
// "bounce": "none" "bounce": "none"
// } }
// } }
// }, },
{ {
"path": "pages/breakwords-clue-detail/breakwords-clue-detail", "path": "pages/breakwords-clue-detail/breakwords-clue-detail",
"style": { "style": {
......
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
</view> </view>
</view> </view>
<view class="text-block"> <view class="text-block">
<text class="middle-date">收货地址</text> <text class="middle-date">{{isAreaCode ? '自提' : '收货地址'}}</text>
<view class="middle-date-des uni-list picker-year"> <view class="middle-date-des uni-list picker-year" v-if="!isAreaCode">
<view class="uni-list-cell"> <view class="uni-list-cell">
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<text class="uni-input-text">{{ contactLetterDetail.receiveAddress}}</text> <text class="uni-input-text">{{ contactLetterDetail.receiveAddress}}</text>
...@@ -81,12 +81,12 @@ ...@@ -81,12 +81,12 @@
</view> </view>
</view> </view>
</view> </view>
<view class="text-block text-block-last"> <view class="text-block text-block-last" disabled="">
<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="uni-input-text">{{ contactLetterDetail.expectLogistics}}</text> <text class="uni-input-text">{{ isAreaCode ? '自提' : contactLetterDetail.expectLogistics}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -190,6 +190,9 @@ ...@@ -190,6 +190,9 @@
export default { export default {
data() { data() {
return { return {
productDisSalesAreaId: '',
happenSalesAreaCode: '',
ticketId: '',
condition: { condition: {
taskAssignmentId: '', taskAssignmentId: '',
bundledProducts: 'false', bundledProducts: 'false',
...@@ -239,12 +242,15 @@ ...@@ -239,12 +242,15 @@
} }
} }
}, },
isAreaCode(){
return this.happenSalesAreaCode === this.productDisSalesAreaId
},
}, },
onLoad(option) { onLoad(option) {
if (option && option.pageType) { if (option && option.pageType) {
this.missionDetail = JSON.parse(option.info) this.missionDetail = JSON.parse(option.info)
this.condition.taskAssignmentId = this.missionDetail.ticketId this.condition.taskAssignmentId = this.missionDetail.ticketId
this.condition.contactLetterId = this.missionDetail.requestid
this.getContactLetterDetail() this.getContactLetterDetail()
} }
}, },
...@@ -290,6 +296,9 @@ ...@@ -290,6 +296,9 @@
const res = await apiGetContactLetterDetail({ const res = await apiGetContactLetterDetail({
taskAssignmentId: this.condition.taskAssignmentId taskAssignmentId: this.condition.taskAssignmentId
}) })
this.ticketId = res.data.contactLetterId
this.happenSalesAreaCode = res.data.happenSalesAreaCode
this.productDisSalesAreaId = res.data.productDisSalesAreaId
uni.hideLoading(); uni.hideLoading();
for (let key in res.data) { for (let key in res.data) {
this.$set(this.contactLetterDetail, key, res.data[key]) this.$set(this.contactLetterDetail, key, res.data[key])
...@@ -308,11 +317,11 @@ ...@@ -308,11 +317,11 @@
return return
} }
const params = { const params = {
'ticketId': this.condition.taskAssignmentId, 'ticketId': this.ticketId,
'remark': this.condition.remark, 'remark': this.condition.remark,
'userid': this.userInfo.code, 'userid': this.userInfo.code,
'distributer': true, 'distributer': true,
'processBusinessInstanceId': this.condition.taskAssignmentId, 'processBusinessInstanceId': this.condition.contactLetterId,
'distributerAttachment': '', 'distributerAttachment': '',
} }
uni.showLoading({ uni.showLoading({
...@@ -322,6 +331,14 @@ ...@@ -322,6 +331,14 @@
uni.hideLoading(); uni.hideLoading();
}, 2000); }, 2000);
const res = await apiDoReceiveApprovalInfo(params) const res = await apiDoReceiveApprovalInfo(params)
if(res.result === 'F'){
uni.showToast({
title: res.message,
duration: 2000,
icon: 'none'
});
return
}
uni.hideLoading(); uni.hideLoading();
uni.navigateBack() uni.navigateBack()
}, },
...@@ -599,4 +616,4 @@ ...@@ -599,4 +616,4 @@
width: 38rpx; width: 38rpx;
height: 40rpx; height: 40rpx;
} }
</style> </style>
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="text-block"> <view class="text-block" v-if="!isAreaCode">
<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">
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
<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="uni-input-text">{{ contactLetterDetail.shipLogistics}}</text> <text class="uni-input-text">{{ isAreaCode ? '自提' : contactLetterDetail.shipLogistics}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -240,6 +240,8 @@ ...@@ -240,6 +240,8 @@
export default { export default {
data() { data() {
return { return {
productDisSalesAreaId: '',
happenSalesAreaCode: '',
condition: { condition: {
taskAssignmentId: '', taskAssignmentId: '',
bundledProducts: 'false', bundledProducts: 'false',
...@@ -266,7 +268,9 @@ ...@@ -266,7 +268,9 @@
'height': `${this.sysinfo.safeArea.height - 44 }px`, 'height': `${this.sysinfo.safeArea.height - 44 }px`,
} }
}, },
isAreaCode(){
return this.happenSalesAreaCode === this.productDisSalesAreaId
},
}, },
onLoad(option) { onLoad(option) {
if (option && option.pageType) { if (option && option.pageType) {
...@@ -344,7 +348,8 @@ ...@@ -344,7 +348,8 @@
// this.contactLetterDetail[key] = res.data[key] // this.contactLetterDetail[key] = res.data[key]
} }
this.condition.entryDataList = res.data.entryDataList this.condition.entryDataList = res.data.entryDataList
this.happenSalesAreaCode = res.data.happenSalesAreaCode
this.productDisSalesAreaId = res.data.productDisSalesAreaId
}, },
async submit() { async submit() {
const params = { const params = {
...@@ -668,4 +673,4 @@ ...@@ -668,4 +673,4 @@
.steps__row-line--hide { .steps__row-line--hide {
background-color: transparent; background-color: transparent;
} }
</style> </style>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="text-block"> <view class="text-block" v-if="!isAreaCode">
<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">
...@@ -188,6 +188,8 @@ ...@@ -188,6 +188,8 @@
export default { export default {
data() { data() {
return { return {
productDisSalesAreaId: '',
happenSalesAreaCode: '',
condition: { condition: {
taskAssignmentId: '', taskAssignmentId: '',
bundledProducts: 'false', bundledProducts: 'false',
...@@ -214,7 +216,9 @@ ...@@ -214,7 +216,9 @@
'height': `${this.sysinfo.safeArea.height - 44 }px`, 'height': `${this.sysinfo.safeArea.height - 44 }px`,
} }
}, },
isAreaCode(){
return this.happenSalesAreaCode === this.productDisSalesAreaId
},
}, },
onLoad(option) { onLoad(option) {
if (option && option.pageType) { if (option && option.pageType) {
...@@ -292,7 +296,8 @@ ...@@ -292,7 +296,8 @@
// this.contactLetterDetail[key] = res.data[key] // this.contactLetterDetail[key] = res.data[key]
} }
this.condition.entryDataList = res.data.entryDataList this.condition.entryDataList = res.data.entryDataList
this.happenSalesAreaCode = res.data.happenSalesAreaCode
this.productDisSalesAreaId = res.data.productDisSalesAreaId
}, },
} }
} }
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
</view> </view>
</view> --> </view> -->
<view class="text-block"> <view class="text-block" v-if="isAreaCodeFlag">
<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">
...@@ -225,6 +225,9 @@ ...@@ -225,6 +225,9 @@
}, },
data() { data() {
return { return {
isAreaCodeFlag: true,
productDisSalesAreaId: '',
happenSalesAreaCode: '',
testObj: { testObj: {
sname: '', sname: '',
dname: '' dname: ''
...@@ -322,7 +325,9 @@ ...@@ -322,7 +325,9 @@
'height': `${this.sysinfo.safeArea.height - 44 }px`, 'height': `${this.sysinfo.safeArea.height - 44 }px`,
} }
}, },
isAreaCode(){
return this.happenSalesAreaCode === this.productDisSalesAreaId
},
}, },
onLoad(option) { onLoad(option) {
if (option && option.pageType) { if (option && option.pageType) {
...@@ -409,7 +414,14 @@ ...@@ -409,7 +414,14 @@
// this.contactLetterDetail[key] = res.data[key] // this.contactLetterDetail[key] = res.data[key]
} }
this.condition.entryDataList = res.data.entryDataList this.condition.entryDataList = res.data.entryDataList
this.happenSalesAreaCode = res.data.happenSalesAreaCode
this.productDisSalesAreaId = res.data.productDisSalesAreaId
if(this.happenSalesAreaCode === this.productDisSalesAreaId){
this.deliveryCompanyList.push({
'id': '自提',
'name': '自提'
})
}
}, },
bindPickerBundledProChange(e) { bindPickerBundledProChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value) console.log('picker发送选择改变,携带值为', e.detail.value)
...@@ -420,17 +432,54 @@ ...@@ -420,17 +432,54 @@
console.log('picker发送选择改变,携带值为', e.detail.value) console.log('picker发送选择改变,携带值为', e.detail.value)
this.deliveryCompanyIndex = e.detail.value this.deliveryCompanyIndex = e.detail.value
this.condition.deliveryCompany = this.deliveryCompanyList[e.detail.value].id this.condition.deliveryCompany = this.deliveryCompanyList[e.detail.value].id
this.isAreaCodeFlag = true
if(this.condition.deliveryCompany === '自提'){
this.isAreaCodeFlag = false
}
}, },
changeInputWay() { changeInputWay() {
this.deliveryCompanyPickerShow = !this.deliveryCompanyPickerShow this.deliveryCompanyPickerShow = !this.deliveryCompanyPickerShow
}, },
async submit() { async submit() {
if(!this.contactLetterDetail.receiveAddress){
uni.showToast({
title: '请先填写收货地址',
duration: 2000,
icon: 'none'
});
return
}
if(!this.contactLetterDetail.contactUser){
uni.showToast({
title: '请先填写联系人',
duration: 2000,
icon: 'none'
});
return
}
if(!this.contactLetterDetail.receiveContactPhone){
uni.showToast({
title: '请先填写联系电话',
duration: 2000,
icon: 'none'
});
return
}
if(!this.contactLetterDetail.expectInsuredValue){
uni.showToast({
title: '请先填写期望保价',
duration: 2000,
icon: 'none'
});
return
}
const expectInsuredNum =Number(this.contactLetterDetail.expectInsuredValue).toFixed(2)
const params = { const params = {
'taskAssignmentId': this.condition.taskAssignmentId, 'taskAssignmentId': this.condition.taskAssignmentId,
'receiveAddress': this.contactLetterDetail.receiveAddress, 'receiveAddress': this.contactLetterDetail.receiveAddress,
'contactUser': this.contactLetterDetail.contactUser, 'contactUser': this.contactLetterDetail.contactUser,
'contactPhone': this.contactLetterDetail.receiveContactPhone, 'contactPhone': this.contactLetterDetail.receiveContactPhone,
'expectInsuredValue': this.contactLetterDetail.expectInsuredValue, 'expectInsuredValue': expectInsuredNum,
'expectLogistics': this.deliveryCompanyPickerShow ? this.deliveryCompanyList[this.deliveryCompanyIndex].name : this.condition.expectLogistics, 'expectLogistics': this.deliveryCompanyPickerShow ? this.deliveryCompanyList[this.deliveryCompanyIndex].name : this.condition.expectLogistics,
'receiveRecorderId': this.userInfo.code, 'receiveRecorderId': this.userInfo.code,
'receiveRecorderName': this.userBpData.USER_NAME, 'receiveRecorderName': this.userBpData.USER_NAME,
...@@ -448,6 +497,14 @@ ...@@ -448,6 +497,14 @@
if(res.result === 'S'){ if(res.result === 'S'){
const address = uni.getStorageSync('wlyAddress') const address = uni.getStorageSync('wlyAddress')
if(address){ if(address){
// 里面有同样的地址就不加入了
for(var i=0; i<address.length; i++) {
if(address[i] === this.contactLetterDetail.receiveAddress) {
uni.hideLoading();
uni.navigateBack()
return
}
}
if(address.length === 5){ if(address.length === 5){
address.pop() address.pop()
} }
......
...@@ -408,7 +408,7 @@ ...@@ -408,7 +408,7 @@
}, },
goHandle(path){ goHandle(path){
uni.switchTab({ uni.switchTab({
url: `/pages/${path}/${path}` url: `/pages/${path}/${path}`
}) })
}, },
entryHandle(path) { entryHandle(path) {
...@@ -792,4 +792,4 @@ ...@@ -792,4 +792,4 @@
color: #999; color: #999;
font-size: 24rpx; font-size: 24rpx;
} }
</style> </style>
...@@ -3,15 +3,15 @@ ...@@ -3,15 +3,15 @@
<view class="status_bar" :style="navHeight"></view> <view class="status_bar" :style="navHeight"></view>
<view class="listview"> <view class="listview">
<view class="cell-list"> <view class="cell-list">
<!-- <view class="cell-list-block" @click="goOrder('breakwords-clue')"> <view class="cell-list-block" @click="goOrder('breakwords-clue')">
<image class="icon-address" src="@/static/image/home_report@3x.png" mode="aspectFit"></image> <image class="icon-address" src="@/static/image/home_report@3x.png" mode="aspectFit"></image>
<view class="cell-list-block__content"> <view class="cell-list-block__content">
<text class="cell-list-block__title">提报线索</text> <text class="cell-list-block__title">提报线索</text>
<text class="cell-list-block__desc">Account inquiry</text> <!-- <text class="cell-list-block__desc">Account inquiry</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>
上传图片功能不能使用,上传图片是上传什么格式?支持base64,16进制 <!-- 上传图片功能不能使用,上传图片是上传什么格式?支持base64,16进制 -->
</view> --> </view>
<view class="cell-list-block" @click="goOrder('breakwords-market')"> <view class="cell-list-block" @click="goOrder('breakwords-market')">
<image class="icon-address" src="@/static/image/home_marketclue@3x.png" mode="aspectFit"></image> <image class="icon-address" src="@/static/image/home_marketclue@3x.png" mode="aspectFit"></image>
<view class="cell-list-block__content"> <view class="cell-list-block__content">
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
<text class="cell-list-block__title">违约任务</text> <text class="cell-list-block__title">违约任务</text>
<!-- <text class="cell-list-block__desc">Market support fee inquiry</text> --> <!-- <text class="cell-list-block__desc">Market support fee inquiry</text> -->
</view> </view>
<text class="dot" v-if="unreadCount">{{unreadCount}}</text>
<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('breakwords-handle')"> <view class="cell-list-block" @click="goOrder('breakwords-handle')">
...@@ -42,6 +43,10 @@ ...@@ -42,6 +43,10 @@
</template> </template>
<script> <script>
import {
apiGetMissionList,
} from '@/servers/breakwords.js'
import { import {
mapState mapState
} from 'vuex' } from 'vuex'
...@@ -50,7 +55,14 @@ ...@@ -50,7 +55,14 @@
export default { export default {
data() { data() {
return { return {
condition: {
currentPage: 1,
pageSize: 100,
distributer: true,
userId: '',
type: 0, // 全部9 代办0 已办2
},
agentNum: 0,
} }
}, },
computed: { computed: {
...@@ -59,9 +71,38 @@ ...@@ -59,9 +71,38 @@
'height': `${this.sysinfo.safeArea.top + 44}px` 'height': `${this.sysinfo.safeArea.top + 44}px`
} }
}, },
...mapState(['sysinfo']) ...mapState(['sysinfo', 'userInfo']),
unreadCount() {
return this.agentNum - 0 > 0 ? this.agentNum - 99 > 0 ? '99+' : this.agentNum : ''
},
},
onShow() {
this.condition.userId = this.userInfo.code
this.apiGetMissionList()
}, },
methods: { methods: {
async apiGetMissionList(){
const params = {
...this.condition,
}
try{
const res = await apiGetMissionList(params)
this.agentNum = res && res.data && res.data.count || 0
if(res.result === "F"){
uni.showToast({
title: res.message,
icon: 'none',
duration: 1500
});
}
}catch(e){
uni.showToast({
title: '服务异常',
icon: 'none',
duration: 1500
});
}
},
goOrder(type) { goOrder(type) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/${type}/${type}` url: `/pages/${type}/${type}`
...@@ -147,4 +188,15 @@ ...@@ -147,4 +188,15 @@
padding: 0 36rpx 0 16rpx; padding: 0 36rpx 0 16rpx;
align-items: center; align-items: center;
} }
.dot {
width: 44rpx;
height: 36rpx;
line-height: 36rpx;
background: #ff0f00;
border-radius: 18rpx;
color: #fff;
font-size: 22rpx;
margin-right: 28rpx;
text-align: center;
}
</style> </style>
...@@ -64,6 +64,12 @@ ...@@ -64,6 +64,12 @@
<orderPage :ref="'page' + index" class="page-item" :nid="page.newsid" :conditions='condition'></orderPage> <orderPage :ref="'page' + index" class="page-item" :nid="page.newsid" :conditions='condition'></orderPage>
</swiper-item> </swiper-item>
</swiper> </swiper>
<!-- <swiper v-else ref="swiper2" class="tab-box" :current="tabIndex" :duration="300" @change="onswiperchange"
@transition="onswiperscroll" @animationfinish="animationfinish" @onAnimationEnd="animationfinish">
<swiper-item class="swiper-item" v-for="(page, index) in tabList" :key="index">
<savePage :ref="'page' + index" class="page-item" :nid="page.newsid" :conditions='condition'></savePage>
</swiper-item>
</swiper> -->
</view> </view>
</view> </view>
</template> </template>
...@@ -82,6 +88,7 @@ ...@@ -82,6 +88,7 @@
// #endif // #endif
import orderPage from './order-page.nvue'; import orderPage from './order-page.nvue';
import savePage from './save-page.nvue';
// 缓存每页最多 // 缓存每页最多
const MAX_CACHE_DATA = 100; const MAX_CACHE_DATA = 100;
...@@ -91,7 +98,8 @@ ...@@ -91,7 +98,8 @@
export default { export default {
components: { components: {
orderPage orderPage,
savePage
}, },
data() { data() {
return { return {
...@@ -107,6 +115,10 @@ ...@@ -107,6 +115,10 @@
id: "tab03", id: "tab03",
name: '已审批', name: '已审批',
newsid: 3 newsid: 3
}, {
id: "tab04",
name: '已保存',
newsid: 4,
}], }],
tabIndex: 0, tabIndex: 0,
cacheTab: [], cacheTab: [],
...@@ -129,7 +141,8 @@ ...@@ -129,7 +141,8 @@
"pagesize": 20, "pagesize": 20,
"startDate": "", "startDate": "",
"status": "0" "status": "0"
} },
savePageFlag: false
} }
}, },
computed: { computed: {
...@@ -188,8 +201,13 @@ ...@@ -188,8 +201,13 @@
this.updateIndicator(currentSize.left, currentSize.width); this.updateIndicator(currentSize.left, currentSize.width);
this._touchTabIndex = index; this._touchTabIndex = index;
// #endif // #endif
if(type - 4 === 0){
this.switchTab(index); this.savePageFlag = true
this.switchTab(index);
}else{
this.savePageFlag = false
this.switchTab(index);
}
}, },
onswiperchange(e) { onswiperchange(e) {
// 注意:百度小程序会触发2次 // 注意:百度小程序会触发2次
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
</div> </div>
</uni-refresh> </uni-refresh>
<uni-cell v-for="(item, index) in dataList" :key="item.id"> <uni-cell v-for="(item, index) in dataList" :key="item.id">
<order-item :newsItem="item" @click.native="goDetail(item)"></order-item> <order-item v-if="!saveItemFlag" :newsItem="item" @click.native="goDetail(item)"></order-item>
<saveItem v-else :newsItem="item" @click.native="goDetail(item,'saveItem')"></saveItem>
</uni-cell> </uni-cell>
<uni-cell v-if="isLoading || dataList.length > 4"> <uni-cell v-if="isLoading || dataList.length > 4">
<view class="loading-more"> <view class="loading-more">
...@@ -31,7 +32,8 @@ ...@@ -31,7 +32,8 @@
import uniLoadMore from '@/components/uni-load-more.vue'; import uniLoadMore from '@/components/uni-load-more.vue';
import noData from '@/components/nodata.nvue'; import noData from '@/components/nodata.nvue';
import orderItem from './order-item.nvue'; import orderItem from './order-item.nvue';
import { findAppGoodsSingle } from '@/servers/purchaseList.js' import saveItem from './save-item.nvue';
import { findAppGoodsSingle, findSavedApplyBill } from '@/servers/purchaseList.js'
export default { export default {
components: { components: {
uniList, uniList,
...@@ -39,7 +41,8 @@ ...@@ -39,7 +41,8 @@
uniRefresh, uniRefresh,
uniLoadMore, uniLoadMore,
noData, noData,
orderItem orderItem,
saveItem
}, },
props: { props: {
nid: { nid: {
...@@ -125,7 +128,13 @@ ...@@ -125,7 +128,13 @@
startDate: this.conditions.startDate, startDate: this.conditions.startDate,
status: this.conditions.status, status: this.conditions.status,
} }
const res = await findAppGoodsSingle(params) this.saveItemFlag = this.conditions.status - 4 === 0
let res = null
if(this.conditions.status - 4 === 0){
res = await findSavedApplyBill(params)
}else{
res = await findAppGoodsSingle(params)
}
if(res.status - 1 === 0){ if(res.status - 1 === 0){
this.isLoading = false; this.isLoading = false;
if (refresh) { if (refresh) {
...@@ -142,18 +151,27 @@ ...@@ -142,18 +151,27 @@
}else{ }else{
this.isNoData = true; this.isNoData = true;
} }
this.isNoData = (res.data.Rows.length <= 0); if(this.conditions.status - 4 === 0){
this.isNoData = (res.data.length <= 0);
this.loadParams.totalPage = Math.ceil(res.data.Total * 1 / this.condition.pagesize * 1) if (refresh) {
if (refresh) { this.dataList = res.data;
this.dataList = res.data.Rows; this.requestParams.minId = 0;
this.requestParams.minId = 0; } else {
} else { this.dataList = this.dataList.concat(res.data);
this.dataList = this.dataList.concat(res.data.Rows); }
} }else{
this.isNoData = (res.data.Rows.length <= 0);
if (this.dataList.length > 0 && this._isWidescreen && this.dataList.length <= 10) { this.loadParams.totalPage = Math.ceil(res.data.Total * 1 / this.condition.pagesize * 1)
this.goDetail(this.dataList[0]); if (refresh) {
this.dataList = res.data.Rows;
this.requestParams.minId = 0;
} else {
this.dataList = this.dataList.concat(res.data.Rows);
}
if (this.dataList.length > 0 && this._isWidescreen && this.dataList.length <= 10) {
this.goDetail(this.dataList[0]);
}
} }
}, },
loadMore(e) { loadMore(e) {
...@@ -168,8 +186,12 @@ ...@@ -168,8 +186,12 @@
this.dataList.length = 0; this.dataList.length = 0;
this.requestParams.minId = 0; this.requestParams.minId = 0;
}, },
goDetail(detail) { goDetail(detail, type=null) {
if(type){
uni.navigateTo({
url: `/pages/purchase/purchase-apply?id=${detail.id}&sourceType=myPurchase`
})
}
}, },
refreshData() { refreshData() {
if (this.isLoading) { if (this.isLoading) {
......
<template>
<view class="order view">
<view class="top">
<text class="title-no">要货单号:{{newsItem.wantCode}}</text>
</view>
<view class="middle view">
<view class="text-block">
<text class="middle-date-des">客户名称</text>
<text class="middle-date">{{newsItem.customerName}}</text>
</view>
<view class="text-block">
<text class="middle-date-des">产品</text>
<text class="middle-date">{{newsItem.productDesc}}</text>
</view>
<view class="text-block-box">
<view class="text-block text-block-last">
<text class="middle-date-des">过期时间</text>
<text class="middle-date">{{newsItem.expireDate}}</text>
</view>
</view>
</view>
</view>
</template>
<script>
// #ifdef APP-NVUE
const dom = weex.requireModule('dom')
// #endif
export default {
props: {
newsItem: {
type: Object,
default: function(e) {
return {}
}
}
},
data() {
return {
ishowDetail: true,
ishowReceiveDetail: false,
receiveInfoHeight: '132',
receiveInfoDetailSize: {},
}
},
// watch:{
// ishowReceiveDetail(val){
// if(val === true){
// this.receiveInfoHeight = `${this.$refs.receiveInfo.$el.clientHeight}px`
// }else{
// this.receiveInfoHeight = '24px'
// }
// }
// },
computed: {
receiveInfoHeightComputed() {
console.log(this.receiveInfoHeight - 0,'[][]')
if(this.receiveInfoHeight - 0 === 0){
return { "minHeight": "385px" }
}else{
return {
"height": `${this.receiveInfoHeight}px`
}
}
}
},
mounted() {
// setTimeout(() => {
// const result = dom.getComponentRect(this.$refs.receiveInfo, option => {
// console.log('getComponentRect:', option)
// this.receiveInfoDetailSize = option.size
// })
// console.log('return value2:', result)
// console.log('viewport:', dom.getComponentRect('viewport'))
// }, 100);
},
methods: {
click() {
this.$emit('click');
},
close(e) {
e.stopPropagation();
this.$emit('close');
},
handleShowDetail() {
this.ishowDetail = !this.ishowDetail
},
handleShowReceiveDetail() {
this.ishowReceiveDetail = !this.ishowReceiveDetail
if (this.ishowReceiveDetail === true) {
this.receiveInfoHeight = '0'
} else {
this.receiveInfoHeight = '132'
}
},
checkLogistics() {
const num = 'dfb0ebae8103034ccb863d3702e22eb6'
uni.navigateTo({
url: `/pages/logistics/logistics?logisticno=${num}`
})
}
}
}
</script>
<style lang="scss" scoped>
.view {
flex-direction: column;
}
.order {
flex: 1;
background: #ffffff;
border-radius: 16rpx 100rpx 16rpx 16rpx;
box-shadow: 0px 2px 4px 0px #dbe4ee;
margin-bottom: 60rpx;
margin-top: 28rpx;
padding-top: 30rpx;
}
.top {
height: 72rpx;
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
}
.title-no {
font-size: 24rpx;
color: #555555;
}
.title-info {
align-items: center;
margin-right: 26rpx;
}
.title-info__status {
width: 130rpx;
height: 48rpx;
line-height: 48rpx;
background: #f61d30;
border-radius: 80rpx 200rpx 200rpx 80rpx;
font-size: 12px;
color: #fff;
text-align: center;
}
.item-block-btn__text {
font-size: 12px;
color: #fff;
}
.middle {
// position: relative;
padding: 26rpx 32rpx;
}
.middle-title {
display: flex;
align-items: center;
margin-bottom: 32rpx;
}
.middle-title__text {
font-weight: 500;
font-size: 32rpx;
color: $text-base-color;
font-family: PingFangSC, PingFangSC-Medium;
}
.icon-car {
width: 13px;
height: 13px;
margin-left: 16rpx;
}
.text-block {
flex: 1;
flex-direction: column;
margin-bottom: 16rpx;
}
.text-block-last {
margin-bottom: 0;
}
.middle-date {
font-size: 28rpx;
color: $text-base-color;
margin-top: 8rpx;
}
.middle-date-des {
font-size: 24rpx;
color: #999;
}
.text-block-box {
display: flex;
// height: 120rpx;
margin-bottom: 16rpx;
justify-content: space-between;
}
.middle-date-right {
display: flex;
align-items: center;
justify-content: flex-end;
text-align: right;
}
.dot {
width: 5px;
height: 5px;
background: #3bdc88;
border-radius: 50%;
margin-top: -4px;
margin-right: 7px;
}
.bottom {
padding: 0 50rpx 48rpx;
}
.bottom-nav {
height: 40rpx;
justify-content: flex-end;
align-items: center;
}
.bottom-nav-arrow {
align-items: center;
}
.arrow-des {
font-size: 24rpx;
color: #999;
}
.icon-arrow {
width: 7px;
height: 4px;
margin-left: 16rpx;
margin-top: 2px;
transition-property: transform;
transition-duration: 0.15s;
transform: rotate(0deg);
}
.icon-arrow-rotate {
transform: rotate(180deg);
}
.bottom-content {
flex-direction: column;
margin-top: 24rpx;
}
.block-detal {
display: flex;
flex-direction: column;
background: #f8f8f8;
border-radius: 20rpx;
padding: 28rpx 32rpx;
margin-bottom: 16rpx;
}
.block-detal-last {
margin-bottom: 32rpx;
}
.block-detal-item {
display: flex;
margin-bottom: 32rpx;
justify-content: space-between;
}
.block-detal-item-last {
margin-bottom: 0;
}
.detal-item-label {
color: #999;
font-size: 24rpx;
}
.detal-item-value {
// flex: 1;
color: #333;
font-size: 28rpx;
}
.detal-item-value2 {
font-size: 24rpx;
// width: 200%;
// flex: 2;
// text-align: left;
}
.detal-item-value3{
padding-left: 60rpx;
font-size: 24rpx;
width: 300%;
flex: 2;
text-align: right;
}
.receive-info {
position: relative;
display: flex;
flex-direction: column;
margin-top: 40rpx;
height: 240rpx;
overflow: hidden;
// padding-bottom: 96rpx;
}
.receive-info-auto {
// height: auto;
}
.detal-item-title {
color: #333;
font-size: 28rpx;
font-weight: 600;
}
.attach-block {
flex-direction: column;
}
.attach-file {
width: 94px;
height: 94px;
margin: 20rpx 20rpx 0 0;
}
.float-btn-block {
position: absolute;
left: 0;
bottom: -2rpx;
z-index: 10;
width: 620rpx;
height: 120rpx;
background-color: #fff;
display: flex;
align-items: center;
justify-content: center;
}
.float-btn {
padding: 0 20px;
height: 60rpx;
border: 0.5px solid #d8d8d9;
border-radius: 32rpx;
display: flex;
align-items: center;
justify-content: center;
}
.float-btn__text {
font-size: 24rpx;
}
.cell-list {
flex-direction: column;
}
</style>
<template>
<view class="page-news">
<uni-list ref="list" class="listview" :enableBackToTop="true" :scroll-y="true" @scrolltolower="loadMore()">
<uni-refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown"
:display="refreshing ? 'show' : 'hide'">
<div class="refresh-view">
<image class="refresh-icon" :src="refreshIcon" :style="{width: (refreshing || pulling) ? 0: '32px'}"
:class="{'refresh-icon-active': refreshFlag}"></image>
<uni-load-more v-if="refreshing" class="loading-icon" status="loading"
:contentText="loadingMoreText"></uni-load-more>
<text class="loading-text">{{refreshText}}</text>
</div>
</uni-refresh>
<uni-cell v-for="(item, index) in dataList" :key="item.id">
<save-item :newsItem="item" @click.native="goDetail(item)"></save-item>
</uni-cell>
<uni-cell v-if="isLoading || dataList.length > 4">
<view class="loading-more">
<text class="loading-more-text">{{loadingText}}</text>
</view>
</uni-cell>
</uni-list>
<no-data class="no-data" v-if="isNoData" @retry="loadMore"></no-data>
</view>
</template>
<script>
import uniList from '@/components/uni-list.vue';
import uniCell from '@/components/uni-cell.vue';
import uniRefresh from '@/components/uni-refresh.vue';
import uniLoadMore from '@/components/uni-load-more.vue';
import noData from '@/components/nodata.nvue';
import saveItem from './save-item.nvue';
import { findSavedApplyBill } from '@/servers/purchaseList.js'
export default {
components: {
uniList,
uniCell,
uniRefresh,
uniLoadMore,
noData,
saveItem
},
props: {
nid: {
type: [Number, String],
default: ''
},
conditions: {
type: Object,
default: () => {}
}
},
data() {
return {
dataList: [],
navigateFlag: false,
pulling: false,
refreshing: false,
refreshFlag: false,
refreshText: "",
isLoading: false,
loadingText: '加载中...',
isNoData: false,
pulling: false,
angle: 0,
loadingMoreText: {
contentdown: '',
contentrefresh: '',
contentnomore: ''
},
refreshIcon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAB5QTFRFcHBw3Nzct7e39vb2ycnJioqK7e3tpqam29vb////D8oK7wAAAAp0Uk5T////////////ALLMLM8AAABxSURBVHja7JVBDoAgDASrjqj//7CJBi90iyYeOHTPMwmFZrHjYyyFYYUy1bwUZqtJIYVxhf1a6u0R7iUvWsCcrEtwJHp8MwMdvh2amHduiZD3rpWId9+BgPd7Cc2LIkPyqvlQvKxKBJ//Qwq/CacAAwDUv0a0YuKhzgAAAABJRU5ErkJggg==",
page: {
"page": "1",
"PAGESIZE": "10",
},
loadParams: {
total: 0,
totalPage: 1,
isDone: false,
isRefresh: false
},
condition: {
endDate: "",
page: 1,
pagesize: 20,
startDate: "",
status: "0",
}
}
},
created() {
this.pullTimer = null;
this.requestParams = {
columnId: this.nid,
minId: 0,
pageSize: 10,
column: 'id,post_id,title,author_name,cover,published_at,comments_count'
};
this._isWidescreen = false;
// #ifdef H5
var mediaQueryOb = uni.createMediaQueryObserver(this)
mediaQueryOb.observe({
minWidth: 768
}, matches => {
this._isWidescreen = matches;
})
// #endif
},
methods: {
async loadData(refresh) {
if (this.isLoading) {
return;
}
this.isLoading = true;
this.isNoData = false;
this.requestParams.time = new Date().getTime() + '';
var startTime = new Date();
const params = {
...this.condition,
endDate: this.conditions.endDate,
startDate: this.conditions.startDate,
status: this.conditions.status,
}
const res = await findSavedApplyBill(params)
if(res.status - 1 === 0){
this.isLoading = false;
if (refresh) {
this.refreshing = false;
this.refreshFlag = false;
this.refreshText = "已刷新";
if (this.pullTimer) {
clearTimeout(this.pullTimer);
}
this.pullTimer = setTimeout(() => {
this.pulling = false;
}, 1000);
}
}else{
this.isNoData = true;
}
this.isNoData = (res.data.length <= 0);
// this.loadParams.totalPage = Math.ceil(res.data.Total * 1 / this.condition.pagesize * 1)
if (refresh) {
this.dataList = res.data;
this.requestParams.minId = 0;
} else {
this.dataList = this.dataList.concat(res.data);
}
// if (this.dataList.length > 0 && this._isWidescreen && this.dataList.length <= 10) {
// this.goDetail(this.dataList[0]);
// }
},
loadMore(e) {
// if (this.condition.page < this.loadParams.totalPage) {
// this.condition.page++
// this.loadData(false);
// } else {
// this.loadingText = '--已到底--'
// }
},
clear() {
this.dataList.length = 0;
this.requestParams.minId = 0;
},
goDetail(detail) {
uni.navigateTo({
url: `/pages/purchase/purchase-apply?id=${detail.id}&sourceType=myPurchase`
})
},
refreshData() {
if (this.isLoading) {
return;
}
this.condition.page = 1
this.pulling = true;
this.refreshing = true;
this.refreshText = "正在刷新...";
this.loadData(true);
},
onrefresh(e) {
this.refreshData();
// #ifdef APP-NVUE
this.$refs.list.resetLoadmore();
// #endif
},
onpullingdown(e) {
if (this.refreshing) {
return;
}
// var angle = (e.pullingDistance) / e.viewHeight * 180;
// if (angle > 180) {
// angle = 180;
// }
// tab.angle = angle;
this.pulling = false;
if (Math.abs(e.pullingDistance) > Math.abs(e.viewHeight)) {
this.refreshFlag = true;
this.refreshText = "释放立即刷新";
} else {
this.refreshFlag = false;
this.refreshText = "下拉可以刷新";
}
},
newGuid() {
let s4 = function() {
return (65536 * (1 + Math.random()) | 0).toString(16).substring(1);
}
return (s4() + s4() + "-" + s4() + "-4" + s4().substr(0, 3) + "-" + s4() + "-" + s4() + s4() + s4())
.toUpperCase();
}
}
}
</script>
<style lang="scss" scoped>
.no-data {
flex: 1;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 10;
}
.page-news {
flex: 1;
flex-direction: column;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
.listview {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
/* #ifndef APP-NVUE */
display: flex;
flex-direction: column;
/* #endif */
/* #ifndef MP-ALIPAY */
flex-direction: column;
/* #endif */
}
.refresh {
justify-content: center;
}
.refresh-view {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
width: 750rpx;
height: 64px;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
}
.refresh-icon {
width: 32px;
height: 32px;
transition-duration: .5s;
transition-property: transform;
transform: rotate(0deg);
transform-origin: 15px 15px;
}
.refresh-icon-active {
transform: rotate(180deg);
}
.loading-icon {
width: 28px;
height: 28px;
margin-right: 5px;
color: gray;
}
.loading-text {
margin-left: 2px;
font-size: 16px;
color: #999999;
}
.loading-more {
align-items: center;
justify-content: center;
padding-top: 14px;
padding-bottom: 14px;
text-align: center;
}
.loading-more-text {
font-size: 12px;
color: #999;
}
</style>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<picker class="picker-block" @change="bindPickerChange($event,'significance')" :value="orderItem.value" <picker class="picker-block" @change="bindPickerChange($event,'significance')" :value="orderItem.value"
range-key='name' mode="selector" :range="significanceArr"> range-key='name' mode="selector" :range="significanceArr">
<text class="uni-input">{{significanceName}}</text> <text class="uni-input">{{orderItem.significanceTextView}}</text>
</picker> </picker>
</view> </view>
</view> </view>
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
// kaStoreArea: ' ', // kaStoreArea: ' ',
// quantity: '' // quantity: ''
// }, // },
significanceName: '正常', // significanceName: '正常',
marketPlaceVal: '', marketPlaceVal: '',
index: 0, index: 0,
scrollTop: 0, scrollTop: 0,
...@@ -291,7 +291,7 @@ ...@@ -291,7 +291,7 @@
break; break;
case 'significance': case 'significance':
this.orderItem.significance = this.significanceArr[index].value this.orderItem.significance = this.significanceArr[index].value
this.significanceName= this.significanceArr[index].name this.orderItem.significanceTextView= this.significanceArr[index].name
break; break;
case 'isPcj': case 'isPcj':
this.orderItem.isPcj = this.pcjArr[index].value this.orderItem.isPcj = this.pcjArr[index].value
......
...@@ -130,6 +130,9 @@ ...@@ -130,6 +130,9 @@
<button class="btn btn-l" type="default" @tap="preStep"> <button class="btn btn-l" type="default" @tap="preStep">
<text class="btn-text btn-text-l">上一步</text> <text class="btn-text btn-text-l">上一步</text>
</button> </button>
<button class="btn btn-l" type="default" @tap="preSave" v-if="!orderItem.saveTimes || orderItem.saveTimes - 1 !== 0">
<text class="btn-text btn-text-l">保存</text>
</button>
<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>
...@@ -142,7 +145,7 @@ ...@@ -142,7 +145,7 @@
</view> </view>
<view class="popup-content-content"> <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">单号:{{ objectId }}</text> <text class="popup-content-content__title2">要货单号:{{ objectId }}</text>
</view> </view>
<view class="popup-content-foot"> <view class="popup-content-foot">
<text class="popup-content-foot__btn" @click="fnBackHome()">回到首页</text> <text class="popup-content-foot__btn" @click="fnBackHome()">回到首页</text>
...@@ -165,7 +168,8 @@ ...@@ -165,7 +168,8 @@
getReceipt, getReceipt,
findByCustomer, findByCustomer,
startProcessInstanceByKey, startProcessInstanceByKey,
advance advance,
saveBizData
} from '@/servers/purchaseList.js' } from '@/servers/purchaseList.js'
export default { export default {
...@@ -342,6 +346,9 @@ ...@@ -342,6 +346,9 @@
const res = await getReceipt(params) const res = await getReceipt(params)
this.receiveUnitArr = res.DATA this.receiveUnitArr = res.DATA
if(flag)return if(flag)return
if(this.orderItem.saveTimes - 0 >= 0){
return
}
this.orderItem.receiveUnitName = this.receiveUnitArr[0].PARTNER_NAME this.orderItem.receiveUnitName = this.receiveUnitArr[0].PARTNER_NAME
this.orderItem.receiveUnitCode = this.receiveUnitArr[0].PARTNER this.orderItem.receiveUnitCode = this.receiveUnitArr[0].PARTNER
this.orderItem.spurtCodeUnitName = this.receiveUnitArr[0].PARTNER_NAME this.orderItem.spurtCodeUnitName = this.receiveUnitArr[0].PARTNER_NAME
...@@ -356,6 +363,10 @@ ...@@ -356,6 +363,10 @@
switch (dictcode){ switch (dictcode){
case 'B0099': case 'B0099':
this.shuntArr = res.data.Rows this.shuntArr = res.data.Rows
if(this.orderItem.saveTimes - 0 >= 0 && this.orderItem.isShunt - 1 === 0){
this.orderItem.shuntName = '是'
return
}
this.orderItem.isShunt = this.shuntArr[1].value this.orderItem.isShunt = this.shuntArr[1].value
this.orderItem.shuntName = this.shuntArr[1].name this.orderItem.shuntName = this.shuntArr[1].name
break; break;
...@@ -435,6 +446,53 @@ ...@@ -435,6 +446,53 @@
// }) // })
this.$emit('click', 'purchaseMain') this.$emit('click', 'purchaseMain')
}, },
async preSave(){
const that = this
try{
if(this.flag){
return
}
this.flag = true
for(let k in this.orderItem){
this.orderItem[k] = this.orderItem[k] === null ? '' : this.orderItem[k]
}
const params = JSON.parse(JSON.stringify(this.orderItem))
params.wantGoodsDetailList = JSON.stringify(params.wantGoodsDetailList)
let res = null
if(params.id){
// params.bizId = params.id
const paramss = {
bizId: params.id,
...params,
}
res = await saveBizData(paramss)
}else{
res = await startProcessInstanceByKey(params)
}
if (res.status == 1) {
uni.showToast({
title: '保存成功',
duration: 2000,
icon: 'none'
});
setTimeout(function() {
that.fnCheckOrderByNo()
}, 1000)
}else{
uni.showToast({
title: res.msg,
duration: 2000,
icon: 'none'
});
this.flag = false
}
}catch(e){
this.flag = false
//TODO handle the exception
}
},
async nextStep() { async nextStep() {
if(this.orderItem.isShunt - 1 === 0){ if(this.orderItem.isShunt - 1 === 0){
if (!this.orderItem.shuntDealerName) { if (!this.orderItem.shuntDealerName) {
...@@ -469,14 +527,33 @@ ...@@ -469,14 +527,33 @@
try { try {
const params = JSON.parse(JSON.stringify(this.orderItem)) const params = JSON.parse(JSON.stringify(this.orderItem))
params.wantGoodsDetailList = JSON.stringify(params.wantGoodsDetailList) params.wantGoodsDetailList = JSON.stringify(params.wantGoodsDetailList)
const { data, status } = await startProcessInstanceByKey(params) let flagStatus = false
if (status == 1) { let status = 0
Object.assign(params, data.bizData) let data = null
params.bizId = data.bizId if(params.id){
params.procInstId = data.procInstId flagStatus = true
params.taskId = data.taskId params.bizId = params.id
// 提交 }else{
params.wantGoodsDetailList = JSON.stringify(params.wantGoodsDetailList) try{
const res = await startProcessInstanceByKey(params)
status = res.status
data = res.data
}catch(e){
this.flag = false
}
}
if (status == 1 || flagStatus) {
if(!params.id){
Object.assign(params, data.bizData)
params.bizId = data.bizId
params.procInstId = data.procInstId
params.taskId = data.taskId
// 提交
params.wantGoodsDetailList = JSON.stringify(params.wantGoodsDetailList)
}
for(let k in params){
params[k] = params[k] === null ? '' : params[k]
}
const res = await advance(params) const res = await advance(params)
if (res.status == 1) { if (res.status == 1) {
this.objectId = res.data.bizData.wantCode this.objectId = res.data.bizData.wantCode
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
import { import {
mapState mapState
} from 'vuex' } from 'vuex'
import { initAppWantGoods, getChannelType } from '@/servers/purchaseList.js' import { initAppWantGoods, getChannelType, findById } 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,7 @@ ...@@ -26,6 +26,7 @@
}, },
data() { data() {
return { return {
sourceType: '',
channelTypeArr: [], channelTypeArr: [],
currentTabComponent: 'purchaseMain', currentTabComponent: 'purchaseMain',
topHeight: '', topHeight: '',
...@@ -110,15 +111,37 @@ ...@@ -110,15 +111,37 @@
return false return false
}, },
onLoad(option) { onLoad(option) {
this.orderItem = { this.sourceType = option.sourceType
// ...this.orderItem, if(option.sourceType === 'myPurchase'){
...JSON.parse(option.order) this.findById(option.id)
}else{
this.orderItem = {
// ...this.orderItem,
...JSON.parse(option.order)
}
} }
}, },
created() { created() {
this.getDetail() this.sourceType === 'purchase' && this.getDetail()
}, },
methods: { methods: {
async findById(id){
const res = await findById(id)
this.detail = {
procInstId: null,
procUnitId: "APPLY",
processAction: "save",
processDefinitionKey: "wantGoods",
'shuntTypeName': ' ',
'shuntName': ' ',
'channelTypeName': '',
isPcjName: res.data.isPcj - 0 ===0 ? '否': '是',
shuntTypeName: res.data.shuntChannelsTypeTextView,
...res.data,
shuntDealerName: res.data.shuntDealer,
}
this.getChannelType()
},
async getChannelType(){ async getChannelType(){
const res = await getChannelType({'salePlan': this.detail.planType}) const res = await getChannelType({'salePlan': this.detail.planType})
this.channelTypeArr = res.data this.channelTypeArr = res.data
...@@ -127,9 +150,13 @@ ...@@ -127,9 +150,13 @@
// } // }
if (this.detail.acceptUnitType =='v014'){ if (this.detail.acceptUnitType =='v014'){
this.channelTypeArr = [{ value: 'Z', name: '终端团购渠道' }] this.channelTypeArr = [{ value: 'Z', name: '终端团购渠道' }]
this.detail.channelsType = this.channelTypeArr[0].value
this.detail.channelTypeName = this.channelTypeArr[0].name
} }
if (!this.channelTypeArr.length) { if (!this.channelTypeArr.length) {
this.channelTypeArr = [{ value: 'S', name: '社会化渠道' }] this.channelTypeArr = [{ value: 'S', name: '社会化渠道' }]
this.detail.channelsType = this.channelTypeArr[0].value
this.detail.channelTypeName = this.channelTypeArr[0].name
} }
}, },
async getDetail(){ async getDetail(){
...@@ -144,6 +171,7 @@ ...@@ -144,6 +171,7 @@
isPcj:0, isPcj:0,
isPcjName:'否', isPcjName:'否',
significance: 'normal', significance: 'normal',
significanceTextView: '正常',
sourceType:1, sourceType:1,
billStatus: "E001", billStatus: "E001",
status: 0, status: 0,
......
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
methods: { methods: {
purchaseBtn(item) { purchaseBtn(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/purchase/purchase-apply?order=${JSON.stringify(item)}` url: `/pages/purchase/purchase-apply?order=${JSON.stringify(item)}&sourceType=purchase`
}) })
}, },
async getSalesPlan(isRefresh) { async getSalesPlan(isRefresh) {
......
...@@ -82,7 +82,10 @@ ...@@ -82,7 +82,10 @@
src="@/static/image/usercenter_billinginvoice@3x.png" mode=""> src="@/static/image/usercenter_billinginvoice@3x.png" mode="">
</image> </image>
</view> </view>
<text class="entry-bill-text">市场秩序</text> <!-- <uni-badge :text="num" absolute="rightTop" :offset="[0, 0]" size="small" :customStyle="{background: '#f43530'}">
</uni-badge> -->
<text class="dot" v-if="num">{{num}}</text>
<text class="entry-bill-text">市场秩序</text>
</view> </view>
<view class="entry-block" @click="goPage('order-trends')"> <view class="entry-block" @click="goPage('order-trends')">
<view class="entry-bill"> <view class="entry-bill">
...@@ -127,7 +130,9 @@ ...@@ -127,7 +130,9 @@
import { import {
apiGetBpPrice apiGetBpPrice
} from '@/servers/common.js' } from '@/servers/common.js'
import {
apiGetMissionList,
} from '@/servers/breakwords.js'
import { import {
apiLogOut apiLogOut
} from '@/servers/user.js' } from '@/servers/user.js'
...@@ -142,16 +147,54 @@ ...@@ -142,16 +147,54 @@
bpPrice: { bpPrice: {
ORDER_PRICE: '--', ORDER_PRICE: '--',
ZHIPIAO_PRICE: '--' ZHIPIAO_PRICE: '--'
} },
condition: {
currentPage: 1,
pageSize: 100,
distributer: true,
userId: '',
type: 0, // 全部9 代办0 已办2
},
agentNum: 0,
} }
}, },
computed: { computed: {
...mapState(['sysinfo', 'userInfo','userBpData']) ...mapState(['sysinfo', 'userInfo','userBpData']),
num() {
return this.agentNum - 0 > 0 ? this.agentNum - 99 > 0 ? '99+' : this.agentNum.toString() : ''
},
}, },
async created() { async created() {
this.getBpPrice() this.getBpPrice()
}, },
onShow() {
this.condition.userId = this.userInfo.code
this.apiGetMissionList()
},
methods: { methods: {
async apiGetMissionList(){
const params = {
...this.condition,
}
try{
const res = await apiGetMissionList(params)
this.agentNum = res && res.data && res.data.count || 0
if(res.result === "F"){
uni.showToast({
title: res.message,
icon: 'none',
duration: 1500
});
}
}catch(e){
uni.showToast({
title: '服务异常',
icon: 'none',
duration: 1500
});
}
},
async getBpPrice() { async getBpPrice() {
const res = await apiGetBpPrice({ const res = await apiGetBpPrice({
PARTNER: this.userInfo.code PARTNER: this.userInfo.code
...@@ -383,4 +426,19 @@ ...@@ -383,4 +426,19 @@
width: 18rpx; width: 18rpx;
height: 32rpx; height: 32rpx;
} }
/deep/ .uni-badge{
position: relative;
}
.dot {
width: 36rpx;
height: 36rpx;
line-height: 36rpx;
background: #ff0f00;
border-radius: 18rpx;
color: #fff;
font-size: 22rpx;
margin-right: -76rpx;
text-align: center;
position: absolute;
}
</style> </style>
...@@ -106,6 +106,8 @@ export async function apiGetSalesAreaAccountList(params) { ...@@ -106,6 +106,8 @@ export async function apiGetSalesAreaAccountList(params) {
* @returns {Promise<AxiosResponse<T>>} * @returns {Promise<AxiosResponse<T>>}
*/ */
export async function apiGetMissionList(params) { export async function apiGetMissionList(params) {
// const res = await apiHelper.post('/wmdpwebservices/contactletter/page/query', params)
const res = await apiHelper.post('/wmdpwebservices/backlog/search/distributer', params) const res = await apiHelper.post('/wmdpwebservices/backlog/search/distributer', params)
return res return res
} }
......
...@@ -34,6 +34,16 @@ export async function findAppGoodsSingle(params) { ...@@ -34,6 +34,16 @@ export async function findAppGoodsSingle(params) {
const res = await apiHelper.post('/crm-app/wantgoods/findAppGoodsSingle', params) const res = await apiHelper.post('/crm-app/wantgoods/findAppGoodsSingle', params)
return res return res
} }
//查询待保存的申请单
export async function findSavedApplyBill(params) {
const res = await apiHelper.get('/crm-app/wantgoods/findSavedApplyBill')
return res
}
//查询待保存的申请单详情
export async function findById(params) {
const res = await apiHelper.post('/crm-app/wantgoods/findById?id=' + params, )
return res
}
export async function queryLogistics(params) { export async function queryLogistics(params) {
const res = await apiHelper.post('/crm-app/logistics/queryLogistics', params, {'Content-Type': 'application/x-www-form-urlencoded'}) const res = await apiHelper.post('/crm-app/logistics/queryLogistics', params, {'Content-Type': 'application/x-www-form-urlencoded'})
return res return res
...@@ -62,6 +72,11 @@ export async function advance(params) { ...@@ -62,6 +72,11 @@ export async function advance(params) {
const res = await apiHelper.post('/crm-app/workflow/advance', params, {'Content-Type': 'application/x-www-form-urlencoded'}) const res = await apiHelper.post('/crm-app/workflow/advance', params, {'Content-Type': 'application/x-www-form-urlencoded'})
return res return res
} }
// 保存要货单
export async function saveBizData(params) {
const res = await apiHelper.post('/crm-app/workflow/saveBizData', params, {'Content-Type': 'application/x-www-form-urlencoded'})
return res
}
export async function getCtrbase(params) { export async function getCtrbase(params) {
const res = await apiHelper.post('/sap/bc/ztpm/to_new_crm/transdata/get_ctrbase', params) const res = await apiHelper.post('/sap/bc/ztpm/to_new_crm/transdata/get_ctrbase', params)
return res 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