Commit e43a80ed by 杨北旺

订单补录模块

1 parent fe3cf981
...@@ -108,6 +108,18 @@ module.exports = { ...@@ -108,6 +108,18 @@ module.exports = {
orderStatistics(data) { orderStatistics(data) {
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.order.status.statistics', data) return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.order.status.statistics', data)
}, },
/** 报价单订单分状态统计信息 */
orderStatistics(data) {
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.order.status.statistics', data)
},
/**报价单-撤销工单 */
cancelOrderById(data){
return api.post('dj.api.smartcarlife.quotation.cancel', data)
},
/** 标记错误订单 */
errorOrderById(data){
return api.post('dj.api.smartcarlife.quotation.correct', data)
},
/** 校验员工绩效密码 */ /** 校验员工绩效密码 */
performancePasswordCheck(data) { performancePasswordCheck(data) {
......
...@@ -25,7 +25,8 @@ Component({ ...@@ -25,7 +25,8 @@ Component({
itemFormObj: [ itemFormObj: [
{ {
label: '交易参考号', label: '交易参考号',
prop: 'outTradeNo' prop: 'outTradeNo',
copy:true
}, },
{ {
label: '支付时间', label: '支付时间',
...@@ -136,6 +137,16 @@ Component({ ...@@ -136,6 +137,16 @@ Component({
thisPage.setData({ thisPage.setData({
orderNoPopup: false orderNoPopup: false
}) })
},
// 复制交易参考号
toCopyNumber(e){
const {ordernum} = e.currentTarget.dataset
wx.setClipboardData({
data: ordernum.toString(),
success (res) {
wx.$util.showToast('已复制')
}
})
} }
} }
}) })
...@@ -15,13 +15,16 @@ ...@@ -15,13 +15,16 @@
refresher-threshold="104" refresher-threshold="104"
refresher-triggered="{{triggered}}"> refresher-triggered="{{triggered}}">
<block wx:for="{{orderNoList}}" wx:key="index"> <block wx:for="{{orderNoList}}" wx:key="index">
<view class="order_no_item {{item.active?'active':''}}" bindtap="changeOrderNo" data-target="{{item}}"> <view class="order_no_item {{item.active?'active':''}}" catch:tap="changeOrderNo" data-target="{{item}}">
<view class="message"> <view class="message">
<block wx:for="{{itemFormObj}}" wx:for-item="subItem" wx:key="idx"> <block wx:for="{{itemFormObj}}" wx:for-item="subItem" wx:key="idx">
<view class="item" wx:if="{{item[subItem.prop]}}"> <view class="item" wx:if="{{item[subItem.prop]}}">
<view class="label">{{subItem.label}}</view> <view class="label">{{subItem.label}}</view>
<view class="value price_value" wx:if="{{subItem.type == 'price'}}">¥{{filter.priceFilter(item[subItem.prop])}}</view> <view class="value price_value" wx:if="{{subItem.type == 'price'}}">¥{{filter.priceFilter(item[subItem.prop])}}</view>
<view class="value" wx:else>{{item[subItem.prop]}}</view> <view class="value" wx:else>
{{item[subItem.prop]}}
<image wx:if="{{subItem.copy}}" catch:tap="toCopyNumber" data-ordernum="{{item[subItem.prop]}}" class="copy_icon" src="../../images/copy_name.png" />
</view>
</view> </view>
</block> </block>
</view> </view>
......
...@@ -87,3 +87,7 @@ ...@@ -87,3 +87,7 @@
.item .price_value{ .item .price_value{
font-weight: 600; font-weight: 600;
} }
.order_no_item .item .copy_icon{
width: 28rpx;
height: 28rpx;
}
...@@ -60,14 +60,17 @@ Component({ ...@@ -60,14 +60,17 @@ Component({
customer: true, customer: true,
product: true, product: true,
info: true, info: true,
store: true store: true,
retrofit:true
}, },
codeToAttr: { codeToAttr: {
YB0001: 'invoice', YB0001: 'invoice',
YB0003: 'driveFront', YB0003: 'driveFront',
YB0004: 'driveBack', YB0004: 'driveBack',
YB0002: 'contract', YB0002: 'contract',
YB0005: 'other' YB0005: 'other',
QS0001:'retrofitInvoice',
QS0002:'retrofit'
}, },
imgToInfo: { imgToInfo: {
invoice: { invoice: {
...@@ -88,6 +91,14 @@ Component({ ...@@ -88,6 +91,14 @@ Component({
}, },
other: { other: {
code: 'YB0005' code: 'YB0005'
},
retrofitInvoice:{
code:'QS0001',
label: '发票或收据'
},
retrofit:{
code:'QS0002',
label: '加改装部位'
} }
}, },
imgObj: { imgObj: {
...@@ -95,12 +106,17 @@ Component({ ...@@ -95,12 +106,17 @@ Component({
driveFront: [], driveFront: [],
driveBack: [], driveBack: [],
contract: [], contract: [],
other: [] other: [],
retrofitInvoice:[],
retrofit:[]
}, },
popObj: { popObj: {
popValue: '' popValue: ''
}, },
tireObjList: constantData.tireObjList tireObjList: constantData.tireObjList,
retrofitInfo:{
inclueType:1
}
}, },
lifetimes: { lifetimes: {
...@@ -113,6 +129,15 @@ Component({ ...@@ -113,6 +129,15 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
changeInclueType(e){
const {types} = e.target.dataset
let formData = this.getPageData()
formData.addOnsFlag = types
this.setData({
'retrofitInfo.inclueType':types,
formData
})
},
onClickShow(e) { onClickShow(e) {
const { type } = e.target.dataset const { type } = e.target.dataset
this.setData({ imgShow: true, imgType: type }) this.setData({ imgShow: true, imgType: type })
...@@ -122,7 +147,7 @@ Component({ ...@@ -122,7 +147,7 @@ Component({
}, },
dealFormRule() { dealFormRule() {
let formData = this.getPageData() let formData = this.getPageData()
var { formRule } = this.data var { formRule,retrofitInfo } = this.data
// const list = ['tireBrand', 'frontTireSpecification', 'rearTireSpecification'] // const list = ['tireBrand', 'frontTireSpecification', 'rearTireSpecification']
const list = ['tireBrand', 'tireScale', 'leftFrontDTO', 'leftFrontBatch', 'rightFrontDTO', 'rightFrontBatch', 'leftRearDTO', 'leftRearBatch', 'rightRearDTO', 'rightRearBatch'] const list = ['tireBrand', 'tireScale', 'leftFrontDTO', 'leftFrontBatch', 'rightFrontDTO', 'rightFrontBatch', 'leftRearDTO', 'leftRearBatch', 'rightRearDTO', 'rightRearBatch']
if (formData && formData.tireFlag == 0) { if (formData && formData.tireFlag == 0) {
...@@ -130,13 +155,15 @@ Component({ ...@@ -130,13 +155,15 @@ Component({
formRule[item][0].required = false formRule[item][0].required = false
}) })
} }
retrofitInfo.inclueType=formData.addOnsFlag==0?2:1
this.setData({ this.setData({
formRule formRule,
retrofitInfo
}) })
}, },
dealImg() { dealImg() {
let { serviceInfo, codeToAttr, imgObj } = this.data let { serviceInfo, codeToAttr, imgObj } = this.data
if (serviceInfo.ybAttachmentFlag == 0 && serviceInfo.attachmentList.length) { if ((serviceInfo.ybAttachmentFlag == 0 || serviceInfo.qsFlag==1) && serviceInfo.attachmentList.length) {
serviceInfo.attachmentList.forEach(item => { serviceInfo.attachmentList.forEach(item => {
imgObj[codeToAttr[item.attachmentCode]].push({ url: item.attachmentFile }) imgObj[codeToAttr[item.attachmentCode]].push({ url: item.attachmentFile })
}) })
...@@ -182,20 +209,28 @@ Component({ ...@@ -182,20 +209,28 @@ Component({
return thisPage?.data[this.data.dataAttrName] return thisPage?.data[this.data.dataAttrName]
}, },
confirmDealImg() { confirmDealImg() {
var { serviceInfo, imgObj, imgToInfo } = this.data var { serviceInfo, imgObj, imgToInfo,retrofitInfo } = this.data
let formData = this.getPageData() let formData = this.getPageData()
// 图片处理 // 图片处理
if (serviceInfo.ybAttachmentFlag == 0) { if (serviceInfo.ybAttachmentFlag == 0 || serviceInfo.qsFlag==1) {
formData.attachmentList = [] formData.attachmentList = []
let attrList = Object.keys(imgObj) let attrList = Object.keys(imgObj)
for (let i = 0; i < attrList.length; i++) { for (let i = 0; i < attrList.length; i++) {
let item = attrList[i] let item = attrList[i]
imgObj[item].forEach(k => { imgObj[item].forEach(k => {
if((item=='retrofitInvoice' || item=='retrofit')&&retrofitInfo.inclueType==1){
formData.attachmentList.push({ formData.attachmentList.push({
attachmentCode: imgToInfo[item].code, attachmentCode: imgToInfo[item].code,
attachmentType: 'IMG', attachmentType: 'IMG',
attachmentFile: k.url attachmentFile: k.url
}) })
}else if(item!='retrofitInvoice' && item!='retrofit'){
formData.attachmentList.push({
attachmentCode: imgToInfo[item].code,
attachmentType: 'IMG',
attachmentFile: k.url
})
}
}) })
} }
} }
...@@ -214,7 +249,7 @@ Component({ ...@@ -214,7 +249,7 @@ Component({
}) })
}, },
handleConfirm(e) { handleConfirm(e) {
var { formRule, serviceInfo, imgObj, imgToInfo, energyFormRule, oilFormRule } = this.data var { formRule, serviceInfo, imgObj, imgToInfo, energyFormRule, oilFormRule,retrofitInfo } = this.data
let formData = this.getPageData() let formData = this.getPageData()
let validObj = fn.checkRequired(formData, formRule) let validObj = fn.checkRequired(formData, formRule)
if (validObj) { if (validObj) {
...@@ -259,12 +294,12 @@ Component({ ...@@ -259,12 +294,12 @@ Component({
} }
} }
// 图片处理 // 图片处理
if (serviceInfo.ybAttachmentFlag == 0) { if (serviceInfo.ybAttachmentFlag == 0 || serviceInfo.qsFlag==1) {
formData.attachmentList = [] formData.attachmentList = []
let attrList = Object.keys(imgObj) let attrList = Object.keys(imgObj)
for (let i = 0; i < attrList.length; i++) { for (let i = 0; i < attrList.length; i++) {
let item = attrList[i] let item = attrList[i]
if (item != 'other' && !imgObj[item].length) { if ((item != 'other' && !imgObj[item].length&&item != 'retrofitInvoice'&&item != 'retrofit'&&serviceInfo.ybAttachmentFlag==0) || (item == 'retrofitInvoice' && !imgObj[item].length &&retrofitInfo.inclueType==1) || (item == 'retrofit' && !imgObj[item].length &&retrofitInfo.inclueType==1)) {
wx.$util.showToast('请上传' + imgToInfo[item].label) wx.$util.showToast('请上传' + imgToInfo[item].label)
return true return true
} }
......
...@@ -131,6 +131,36 @@ ...@@ -131,6 +131,36 @@
</view> </view>
</gl-form> </gl-form>
</view> </view>
<!-- 改装件信息 -->
<view wx:if="{{serviceInfo.qsFlag==1}}" class="box m-b-40">
<view class="title">
<view>改装件信息</view>
<view class="up-down-box" bindtap="handleUpDown" data-attr="retrofit">
<view class="up-down-arrow">
<view class="arrow-up {{isShowObj.retrofit ? '' : 'arrow-down'}}"></view>
</view>
</view>
</view>
<gl-form wx:if="{{isShowObj.retrofit}}" id="retrofit" formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" formDataList="{{secondObj.retrofitList}}">
<view slot="upload" class="{{retrofitInfo.inclueType==1?'upload':''}}">
<gl-cell border class="pay-type" label="含加改装件" valueAlign="right" labelWidth="140rpx">
<view class="switch-box">
<view class="block text-center {{ retrofitInfo.inclueType==1?'':'right' }}" />
<view class="left text-center {{ retrofitInfo.inclueType == 1?'active':'' }}" bindtap="changeInclueType" data-types="1">是</view>
<view class="right text-center {{ retrofitInfo.inclueType == 2?'active':'' }}" bindtap="changeInclueType" data-types="2">否</view>
</view>
</gl-cell>
<block wx:if="{{retrofitInfo.inclueType==1}}">
<view class="label">发票或收据</view>
<van-uploader class="plus" file-list="{{ imgObj.retrofitInvoice }}" upload-text="上传照片" max-count="1" deletable preview-size="192rpx" bind:after-read="upLoad" bind:delete="handleDeleteImg" data-attr="retrofitInvoice">
</van-uploader>
<view class="label">加改装部位照片</view>
<van-uploader class="plus" file-list="{{ imgObj.retrofit }}" upload-text="上传照片" max-count="1" deletable preview-size="192rpx" bind:after-read="upLoad" bind:delete="handleDeleteImg" data-attr="retrofit">
</van-uploader>
</block>
</view>
</gl-form>
</view>
<view class="box m-b-40"> <view class="box m-b-40">
<view class="title"> <view class="title">
<view>店面信息</view> <view>店面信息</view>
......
...@@ -314,3 +314,61 @@ ...@@ -314,3 +314,61 @@
.upload .van-uploader .van-uploader__wrapper .van-uploader__upload { .upload .van-uploader .van-uploader__wrapper .van-uploader__upload {
order: 0 !important; order: 0 !important;
} }
.switch-box {
/* box-sizing: border-box; */
width: 216rpx;
height: 60rpx;
display: flex;
border: 2rpx solid #347BFF;
border-radius: 12rpx;
font-size: 28rpx;
color: #347BFF;
margin-left: auto;
margin-right: -30rpx;
position: relative;
}
.switch-box .block {
position: absolute;
/* top: 0; */
top: 50%;
transform: translateY(-50%);
border: 2rpx solid #347BFF;
left: 0;
width: 50%;
border-radius: 12rpx;
height: 100%;
background: #347BFF;
color: #fff;
transition: all .25s;
}
.switch-box .block.right {
left: 50%;
top: 50%;
}
.switch-box .left,
.switch-box .right {
width: 50%;
height: 100%;
position: absolute;
top: 0;
transition: all .25s;
}
.switch-box .left {
left: 0;
}
.switch-box .right {
right: 0;
}
.switch-box .left.active,
.switch-box .right.active {
color: #fff;
}
.pay-type .cell {
padding-left: 20rpx!important;
}
\ No newline at end of file \ No newline at end of file
...@@ -649,7 +649,14 @@ const secondObj = { ...@@ -649,7 +649,14 @@ const secondObj = {
// noCellHeight: true, // noCellHeight: true,
maxlength: '100' maxlength: '100'
} }
] ],
retrofitList:[{
label: ' ',
name: 'upload',
type: 'slot',
labelWidth: '0rpx',
noCellHeight: true,
}]
} }
export default { export default {
......
...@@ -48,7 +48,6 @@ Page({ ...@@ -48,7 +48,6 @@ Page({
cardSetting: true, cardSetting: true,
isAsk: false isAsk: false
}, },
getPickerObj(obj) { getPickerObj(obj) {
let data = [] let data = []
if (!obj) { if (!obj) {
...@@ -290,6 +289,7 @@ Page({ ...@@ -290,6 +289,7 @@ Page({
let params = this.dealComfirmData(JSON.parse(JSON.stringify(serviceInfo))) let params = this.dealComfirmData(JSON.parse(JSON.stringify(serviceInfo)))
// 0草稿,1提单 // 0草稿,1提单
params.operationType = typeObj[type] params.operationType = typeObj[type]
params.addOnsFlag = serviceInfo.addOnsFlag==2?0:1
console.log(params, '调接口---') console.log(params, '调接口---')
this.setData({ this.setData({
isAsk: true isAsk: true
......
...@@ -14,6 +14,8 @@ Component({ ...@@ -14,6 +14,8 @@ Component({
observer: function (n) { observer: function (n) {
} }
}, },
resetTransNo:String,
resetOrder:Boolean
}, },
/** /**
...@@ -108,10 +110,11 @@ Component({ ...@@ -108,10 +110,11 @@ Component({
}) })
}, },
confirm(e) { confirm(e) {
let { outTradeNo, payVoucherList } = this.data let { outTradeNo, payVoucherList,resetOrder } = this.data
// debugger // debugger
// console.log(wx.$router) // console.log(wx.$router)
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
if(resetOrder) return this.newResetOrder()
// if (orderType == 2) { // if (orderType == 2) {
if (payVoucherList.length && outTradeNo) { if (payVoucherList.length && outTradeNo) {
thisPage.setData({ thisPage.setData({
...@@ -125,7 +128,20 @@ Component({ ...@@ -125,7 +128,20 @@ Component({
} }
// } // }
}, },
// 标记错误订单&补录订单
newResetOrder(){
let { resetTransNo, payVoucherList } = this.data
let thisPage = wx.$router.getPageInstance()
if (payVoucherList.length && resetTransNo) {
thisPage.setData({
['orderInfo.transactionNo']: resetTransNo,
['orderInfo.paymentDocList']: payVoucherList.map(item=>item.url)
})
thisPage.handleSecondConfirm()
} else {
wx.$util.showToast('交易流水号或付款凭证不能为空!')
}
}
} }
}) })
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
<block wx:if="{{orderType == 2}}"> <block wx:if="{{orderType == 2}}">
<view class="input-item"> <view class="input-item">
<view class="title-text">交易流水号</view> <view class="title-text">交易流水号</view>
<view class="input-box"> <view class="input-box" wx:if="{{resetOrder}}">{{resetTransNo}}</view>
<view wx:else class="input-box">
<input <input
type="text" type="text"
class="input" class="input"
......
...@@ -72,6 +72,14 @@ Component({ ...@@ -72,6 +72,14 @@ Component({
}) })
// } // }
}, },
'orderInfo.resetOrder': function (value) {
// console.log(value, 'outTradeNo')
// if (value) {
value && this.setData({
['textNameObj.cancelName']: '放弃'
})
// }
},
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
......
...@@ -392,3 +392,14 @@ ...@@ -392,3 +392,14 @@
.van-cell:after { .van-cell:after {
border: none!important; border: none!important;
} }
.only-select-text{
width: 300rpx;
height: 60rpx;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 28rpx;
margin-left: auto;
margin-right: -30rpx;
position: relative;
}
\ No newline at end of file \ No newline at end of file
...@@ -51,8 +51,9 @@ ...@@ -51,8 +51,9 @@
<view class="label">其他信息</view> <view class="label">其他信息</view>
</view> </view>
</view> </view>
<gl-cell wx:if="{{!orderInfo.outTradeNo}}" border class="pay-type" label="支付方式" valueAlign="right" labelWidth="140rpx"> <gl-cell wx:if="{{!orderInfo.outTradeNo || orderInfo.resetOrder}}" border class="pay-type" label="支付方式" valueAlign="right" labelWidth="140rpx">
<view class="switch-box"> <view class="only-select-text" wx:if="{{orderInfo.resetOrder}}">门店收款</view>
<view wx:else class="switch-box">
<view class="block text-center {{ orderInfo.payType==1?'':'right' }}" /> <view class="block text-center {{ orderInfo.payType==1?'':'right' }}" />
<view class="left text-center {{ orderInfo.payType == 1?'active':'' }}" bindtap="changePayType" data-payType="1">线上支付</view> <view class="left text-center {{ orderInfo.payType == 1?'active':'' }}" bindtap="changePayType" data-payType="1">线上支付</view>
<view class="right text-center {{ orderInfo.payType == 2?'active':'' }}" bindtap="changePayType" data-payType="2">门店收款</view> <view class="right text-center {{ orderInfo.payType == 2?'active':'' }}" bindtap="changePayType" data-payType="2">门店收款</view>
......
...@@ -7,6 +7,8 @@ const orderStatusObj = { ...@@ -7,6 +7,8 @@ const orderStatusObj = {
'4': '已支付', '4': '已支付',
'5': '已完成', '5': '已完成',
'-1': '战败', '-1': '战败',
'9':'已撤销',
'11':'已退单'
} }
const orderStatusList = [{ const orderStatusList = [{
confName: '待报价', confName: '待报价',
......
...@@ -7,7 +7,8 @@ import { ...@@ -7,7 +7,8 @@ import {
quotationUpgrade, quotationUpgrade,
getQuotationInfoById, getQuotationInfoById,
listByMerchantIdAndIds, listByMerchantIdAndIds,
quotationRecording quotationRecording,
errorOrderById
} from '../../../api' } from '../../../api'
import { import {
quotedImgUrl quotedImgUrl
...@@ -201,9 +202,10 @@ Page({ ...@@ -201,9 +202,10 @@ Page({
// 是订单补录直接走另外的补录逻辑 // 是订单补录直接走另外的补录逻辑
console.log(outTradeNo, '是订单补录直接走另外的补录逻辑'); console.log(outTradeNo, '是订单补录直接走另外的补录逻辑');
if (outTradeNo) return this.setQuotationRecording() if (outTradeNo&&!orderInfo.resetOrder) return this.setQuotationRecording()
// debugger // debugger
// 如果是门店收款 并且付款凭证没有填 // 如果是门店收款 并且付款凭证没有填
orderInfo.paymentDocList = orderInfo.paymentDocList || []
if (orderInfo.payType == 2 && !(orderInfo.transactionNo && orderInfo.paymentDocList.length)) return this.setData({ if (orderInfo.payType == 2 && !(orderInfo.transactionNo && orderInfo.paymentDocList.length)) return this.setData({
showPopup: true, showPopup: true,
confirmStatus: false confirmStatus: false
...@@ -303,6 +305,13 @@ Page({ ...@@ -303,6 +305,13 @@ Page({
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
// let { orderInfo } = this.data // let { orderInfo } = this.data
console.log('调接口---') console.log('调接口---')
// 标记错误--补录订单
if(orderInfo.resetOrder&&orderInfo.id){
orderInfo.oldQuotationId = orderInfo.id
delete orderInfo.id
let result = await errorOrderById(orderInfo)
return resolve(result)
}
// 编辑后重新提交 // 编辑后重新提交
if (orderInfo.id) { if (orderInfo.id) {
let result = await updateQuotation(orderInfo) let result = await updateQuotation(orderInfo)
...@@ -355,7 +364,11 @@ Page({ ...@@ -355,7 +364,11 @@ Page({
item.price = this.divideByHundred(item.goodsPrice) item.price = this.divideByHundred(item.goodsPrice)
return item return item
}) })
// 标识为补录工单
if(this.resetOrder){
orderInfo.resetOrder = this.resetOrder
tableInfo.payType = 2
}
this.setData({ this.setData({
orderInfo: Object.assign(orderInfo, tableInfo, { orderInfo: Object.assign(orderInfo, tableInfo, {
insureList: [] insureList: []
...@@ -413,7 +426,7 @@ Page({ ...@@ -413,7 +426,7 @@ Page({
saveStatus saveStatus
} = this.data } = this.data
// 补单点放弃 // 补单点放弃
if (orderInfo.outTradeNo) { if (orderInfo.outTradeNo || orderInfo.resetOrder) {
return wx.$router.redirectTo('packageEquity.equityPage', { return wx.$router.redirectTo('packageEquity.equityPage', {
tabIndex: 1 tabIndex: 1
}) })
...@@ -580,7 +593,8 @@ Page({ ...@@ -580,7 +593,8 @@ Page({
outTradeNo, outTradeNo,
totalFee, totalFee,
accountDate, accountDate,
id id,
resetOrder
} = options } = options
// outTradeNo // outTradeNo
if (outTradeNo) { if (outTradeNo) {
...@@ -591,7 +605,7 @@ Page({ ...@@ -591,7 +605,7 @@ Page({
accountDate accountDate
}) })
} }
if(resetOrder)this.resetOrder = resetOrder
if (id) { if (id) {
this.setData({ this.setData({
id id
......
...@@ -48,5 +48,7 @@ ...@@ -48,5 +48,7 @@
</view> </view>
<order-popup <order-popup
orderType="{{orderInfo.payType }}" orderType="{{orderInfo.payType }}"
resetTransNo="{{orderInfo.transactionNo}}"
resetOrder="{{orderInfo.resetOrder}}"
wx:if="{{showPopup}}" wx:if="{{showPopup}}"
show="{{showPopup}}" /> show="{{showPopup}}" />
\ No newline at end of file \ No newline at end of file
...@@ -4,7 +4,8 @@ import { ...@@ -4,7 +4,8 @@ import {
getQuotationStatistics, getQuotationStatistics,
updateOrderStatus, updateOrderStatus,
merchantMode, merchantMode,
orderStatistics orderStatistics,
cancelOrderById
} from '../../../api' } from '../../../api'
import data from '../constant/data' import data from '../constant/data'
import constantData from '../constant/data' import constantData from '../constant/data'
...@@ -43,6 +44,15 @@ Component({ ...@@ -43,6 +44,15 @@ Component({
key: 'goodsName' key: 'goodsName'
}, },
{ {
label: '工单编号',
key: 'payId'
},
{
label: '交易流水号',
key: 'transactionNo',
canCopy:true
},
{
label: '拒升原因', label: '拒升原因',
key: 'remark' key: 'remark'
}, },
...@@ -53,7 +63,15 @@ Component({ ...@@ -53,7 +63,15 @@ Component({
{ {
label: '创建时间', label: '创建时间',
key: 'createdTime' key: 'createdTime'
},
{
label: '支付方式',
key: 'payType',
mapValue:{
1:'线上支付',
2:'门店收款'
} }
},
], ],
// statisticsObj: {}, // statisticsObj: {},
btnTxt: { btnTxt: {
...@@ -116,7 +134,7 @@ Component({ ...@@ -116,7 +134,7 @@ Component({
*/ */
methods: { methods: {
onScroll: function (e) { onScroll: function (e) {
console.log(e, 'onPageScroll'); // console.log(e, 'onPageScroll');
// const { // const {
// scrollTop // scrollTop
// } = e.detail // } = e.detail
...@@ -250,6 +268,8 @@ Component({ ...@@ -250,6 +268,8 @@ Component({
if (item.payTime) { if (item.payTime) {
item.payTime = wx.$util.tsFormatTime(item.payTime, 'Y/M/D h:m:s') item.payTime = wx.$util.tsFormatTime(item.payTime, 'Y/M/D h:m:s')
} }
item.isTouchMove = false
item.repeal = item.orderStatus==3 || item.orderStatus==5
return item return item
}) })
this.setData({ this.setData({
...@@ -456,5 +476,187 @@ Component({ ...@@ -456,5 +476,187 @@ Component({
console.log(err) console.log(err)
}) })
}, },
//手指触摸动作开始 记录起点X坐标
touchstart: function (e) {
//开始触摸时 重置所有删除
this.data.list.forEach(v => {
// console.log(item)
if (v.isTouchMove)
//只操作为true的
v.isTouchMove = false
v.confirmIndex = false
})
this.setData({
startX: e.changedTouches[0].clientX,
startY: e.changedTouches[0].clientY,
list: this.data.list
})
},
//滑动事件处理
touchmove: function (e) {
// console.log(e)
// if (condition) {
// }
// let { userInfo } = this.data
let {
item
} = e.currentTarget.dataset
// console.log(!li.repeal)
if (!item.repeal) return
// let userType = !userInfo.isSuper && userInfo.merchantType
// let orderType = userInfo.userType == 1 && li.status != 9 && li.status != 1 && li.selectPayType != 3 && li.selectPayType != 1
// // 权限检验
// // console.log(!userType || !orderType)
// if (!userType || !orderType) return
var that = this,
index = e.currentTarget.dataset.index, //当前索引
// ind = e.currentTarget.dataset.ind, //当前索引
startX = that.data.startX, //开始X坐标
startY = that.data.startY, //开始Y坐标
touchMoveX = e.changedTouches[0].clientX, //滑动变化坐标
touchMoveY = e.changedTouches[0].clientY, //滑动变化坐标
//获取滑动角度
angle = that.angle({
X: startX,
Y: startY
}, {
X: touchMoveX,
Y: touchMoveY
})
// console.log(that.data.list[index])
that.data.list.forEach(function (v, i) {
v.isTouchMove = false
//滑动超过30度角 return
if (Math.abs(angle) > 30) return
if (i == index) {
if (touchMoveX > startX)
//右滑
v.isTouchMove = false
//左滑
else v.isTouchMove = true
}
})
//更新数据
that.setData({
list: that.data.list
})
},
touchE: function (e) {
// console.log(e)
var that = this
// console.log(e.changedTouches.length)
// debugger
let {
item
} = e.currentTarget.dataset
// // console.log(!li.repeal)
if (!item.repeal) return
if (e.changedTouches.length == 1) {
//手指移动结束后触摸点位置的X坐标
var endX = e.changedTouches[0].clientX
//触摸开始与结束,手指移动的距离
var disX = that.data.startX - endX
// console.log(disX)
var delBtnWidth = that.data.delBtnWidth
//如果距离小于删除按钮的1/2,不显示删除按钮
var txtStyle = disX > delBtnWidth / 2 ? 'left:-' + delBtnWidth + 'rpx' : 'left:0rpx'
//获取手指触摸的是哪一项
var index = e.currentTarget.dataset.index
// var ind = e.currentTarget.dataset.ind
var list = that.data.list
list[index].txtStyle = txtStyle
// console.log(list)
//更新列表的状态
that.setData({
list: list
})
}
},
angle: function (start, end) {
var _X = end.X - start.X,
_Y = end.Y - start.Y
//返回角度 /Math.atan()返回数字的反正切值
return (360 * Math.atan(_Y / _X)) / (2 * Math.PI)
},
toConfirmReturanOrder(e){
const {id} = e.currentTarget.dataset
let _this = this
wx.showModal({
title: '',
content: '是否取撤销该工单?',
confirmText: '是',
confirmColor: '#347BFF',
cancelText: '否',
success(res) {
if (res.confirm) {
// _this.showLoading('取消中...')
_this.repeal(id)
}
}
})
},
toCopyNumber(e){
const {ordernum} = e.currentTarget.dataset
wx.setClipboardData({
data: ordernum.toString(),
success (res) {
wx.$util.showToast('已复制')
}
})
},
repeal(id){
let _this = this
cancelOrderById({id}).then(_res_=>{
let {
code,
message
} = _res_
if (code == 0) {
wx.showToast({
title: '操作成功',
icon: 'success'
})
setTimeout(() => {
_this.getList()
}, 500)
} else {
wx.$util.showToast(message)
}
})
},
toshowErrorOrder(e){
const {item} = e.currentTarget.dataset
this.setData({
showErrorId:item.payId
},()=>{
wx.$modal(this, {
show: true,
title: '工单标记',
tabTitleShow: false,
success: res => {
wx.showModal({
title: '提示',
content: '是否补录新工单?',
confirmText: '确定',
confirmColor: '#347BFF',
cancelText: '取消',
success(res) {
if (res.confirm) {
wx.$router.go(item.mode != 0 ? 'createOrderCarQuotationSimple' : 'createOrderCarQuotation', {
id: item.id,
resetOrder:true
})
}
}
})
},
error: () => {
}
})
})
},
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -64,7 +64,8 @@ ...@@ -64,7 +64,8 @@
<view wx:if="{{flag}}" class="order-box"> <view wx:if="{{flag}}" class="order-box">
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="search" bindscroll="onScroll" bindscrolltolower="onBottomRefresh" class="list" scroll-top="{{scrollTop}}" lower-threshold="400" refresher-threshold="104" refresher-triggered="{{triggered}}"> <scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="search" bindscroll="onScroll" bindscrolltolower="onBottomRefresh" class="list" scroll-top="{{scrollTop}}" lower-threshold="400" refresher-threshold="104" refresher-triggered="{{triggered}}">
<block wx:if="{{list.length > 0}}"> <block wx:if="{{list.length > 0}}">
<view wx:for="{{list}}" wx:key="index" class="item"> <view wx:for="{{list}}" wx:key="index" class="item {{item.isTouchMove ? 'touch-move-active' : ''}}">
<view class="item-inner" data-item="{{item}}" data-index='{{index}}' bindtouchstart="touchstart" bindtouchmove="touchmove" bindtouchend="touchE">
<view class="item-content"> <view class="item-content">
<view class="item-header"> <view class="item-header">
<view class="header-cust"> <view class="header-cust">
...@@ -113,7 +114,9 @@ ...@@ -113,7 +114,9 @@
<view class="order" wx:else> <view class="order" wx:else>
<view class="order-label">{{i.label}}</view> <view class="order-label">{{i.label}}</view>
<view class="order-value"> <view class="order-value">
<block>{{item[i.key] || ''}}</block> <block wx:if="{{i.mapValue}}">{{i.mapValue[item[i.key]] || ''}}</block>
<block wx:else>{{item[i.key] || ''}}</block>
<image wx:if="{{i.canCopy&&item[i.key]}}" catch:tap="toCopyNumber" data-ordernum="{{item[i.key]}}" class="copy_icon" src="../../../images/copy_name.png" />
</view> </view>
</view> </view>
</block> </block>
...@@ -188,6 +191,15 @@ ...@@ -188,6 +191,15 @@
<image class="icon-info" src="/packageEquity/images/icon-info.png"></image> <image class="icon-info" src="/packageEquity/images/icon-info.png"></image>
订单已支付,尚未签名确认 订单已支付,尚未签名确认
</view> </view>
</view>
<view wx:if="{{item.payType==2}}" data-id="{{item.id}}" bind:tap="toConfirmReturanOrder" class="del">
<view>撤销</view>
<view>工单</view>
</view>
<view wx:if="{{item.payType==1}}" data-item="{{item}}" bind:tap="toshowErrorOrder" class="del">
<view>错误</view>
<view>工单</view>
</view>
<!-- </view> --> <!-- </view> -->
</view> </view>
<block wx:if="{{nothing}}"> <block wx:if="{{nothing}}">
...@@ -224,3 +236,20 @@ ...@@ -224,3 +236,20 @@
</block> </block>
</view> </view>
<remark-popup wx:if="{{showRemark}}" title="战败原因" show="{{showRemark}}" required="{{true}}" bindcancel="remarkCancel" bindconfirm="remarkConfirm" placeholder="请填写战败原因" maxlength="15" value="{{sufferReason}}" /> <remark-popup wx:if="{{showRemark}}" title="战败原因" show="{{showRemark}}" required="{{true}}" bindcancel="remarkCancel" bindconfirm="remarkConfirm" placeholder="请填写战败原因" maxlength="15" value="{{sufferReason}}" />
<modal
id="modal"
class="modal"
custom='true'
btns="{{['返回','确定']}}">
<view class="modatcontent">
<view class="orderCode">
<text class="code">订单编号:</text>
<text>{{showErrorId}}</text>
</view>
<view class="tips">
若工单信息有误,确认操作可标记为
<text class="color">已失效</text>
,并补录新工单以提供线下核对。
</view>
</view>
</modal>
...@@ -210,8 +210,35 @@ ...@@ -210,8 +210,35 @@
border-radius: 16rpx; border-radius: 16rpx;
margin: 0 6rpx 20rpx; margin: 0 6rpx 20rpx;
padding-bottom: 20rpx; padding-bottom: 20rpx;
display: flex;
justify-content: space-between;
overflow: hidden;
}
.list .item .item-inner{
width: 100%;
margin-right: 0;
-webkit-transition: all 0.4s;
transition: all 0.4s;
-webkit-transform: translateX(72px);
transform: translateX(72px);
margin-left: -72px;
}
.list .item .del {
width: 72px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #fff;
background-color: #f1554c;
-webkit-transform: translateX(90px);
transform: translateX(90px);
-webkit-transition: all 0.4s;
transition: all 0.4s;
font-size: 28rpx;
} }
.list .item:first-child { .list .item:first-child {
margin-top: 20rpx; margin-top: 20rpx;
} }
...@@ -702,3 +729,35 @@ ...@@ -702,3 +729,35 @@
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
} }
.touch-move-active .item-inner,
.touch-move-active .del {
-webkit-transform: translateX(0) !important;
transform: translateX(0) !important;
}
.modatcontent {
box-sizing: border-box;
padding: 48rpx 50rpx;
}
.modal text,
.modal {
font-size: 28rpx;
color: #333333;
}
.modal .orderCode {
margin-bottom: 20rpx;
}
.modal .code {
color: #888888;
}
.modal .color {
color: #347BFF;
}
.copy_icon{
width: 28rpx;
height: 28rpx;
margin-left: 12rpx;
}
\ No newline at end of file \ No newline at end of file
...@@ -97,5 +97,7 @@ ...@@ -97,5 +97,7 @@
] ]
} }
}, },
"libVersion": "3.3.4" "setting": {
"compileHotReLoad": true
}
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!