Commit b8f9b0a3 by 张立顺

bug修复

1 parent fd29a882
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* 2测试 * 2测试
* 3生产环境 * 3生产环境
*/ */
let index = 2 let index = 1
const accountInfo = wx.getAccountInfoSync() const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync() const systemInfo = wx.getSystemInfoSync()
......
...@@ -24,6 +24,12 @@ Component({ ...@@ -24,6 +24,12 @@ Component({
orderInfo: { orderInfo: {
type: Object, type: Object,
observer: function (n) { observer: function (n) {
if (n.mode) {
// first: data.firstObj,
this.setData({
first:n.mode?data.firstObjSimple:data.firstObj
})
}
if (n?.modifyEquityQuotation) { if (n?.modifyEquityQuotation) {
this.setData({ this.setData({
// activeNames: ['3'], // activeNames: ['3'],
......
...@@ -87,7 +87,70 @@ const firstObj = { ...@@ -87,7 +87,70 @@ const firstObj = {
label: '车架号', label: '车架号',
name: 'carVin', name: 'carVin',
type: 'input', type: 'input',
maxlength: '17' maxlength: '17',
required:true,
requiredAfter:true
},
{
label: '座位数',
name: 'seat',
labelName: 'seat',
type: 'select',
optionList: constantList.seatesList,
optionId: 'optionId',
optionLabel: 'optionLabel'
},
{
label: '车辆发票价',
name: 'price',
type: 'input',
fieldType: 'digit',
maxlength: '8',
required:true,
requiredAfter:true,
labelWidth:80
// fieldType: 'digit'
}
]
}
const firstObjSimple = {
customerFormList: [
{
label: '姓名',
name: 'owner',
type: 'input',
maxlength: '10',
noCellHeight: true,
fieldType: 'textarea',
required:true,
requiredAfter:true
},
{
label: '联系电话',
name: 'phone',
type: 'input',
fieldType: 'number',
maxlength: '11',
required:true,
requiredAfter:true
},
{
label: '证件号码',
name: 'certificateNo',
type: 'input',
maxlength: '18',
placeholder: '请输入(非必填)'
}
],
carFormList: [
{
label: '车架号',
name: 'carVin',
type: 'input',
maxlength: '17',
// required:true,
// requiredAfter:true
}, },
{ {
...@@ -178,5 +241,6 @@ const optionsSelect = { ...@@ -178,5 +241,6 @@ const optionsSelect = {
export default { export default {
formRule, formRule,
firstObj, firstObj,
optionsSelect optionsSelect,
firstObjSimple
} }
...@@ -438,9 +438,9 @@ Page({ ...@@ -438,9 +438,9 @@ Page({
} }
this.setData({ id: options.id }) this.setData({ id: options.id })
this.getOrderInfo() this.getOrderInfo()
} else { }
this.getQuotationInfo() this.getQuotationInfo()
}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
......
// packageEquity/pages/carQuotation/index/index.js // packageEquity/pages/carQuotation/index/index.js
import { quotationPage, getQuotationStatistics, updateOrderStatus, merchantMode } from '../../../api' import {
quotationPage,
getQuotationStatistics,
updateOrderStatus,
merchantMode
} from '../../../api'
import data from '../constant/data' import data from '../constant/data'
import constantData from '../constant/data' import constantData from '../constant/data'
Component({ Component({
...@@ -11,9 +16,16 @@ Component({ ...@@ -11,9 +16,16 @@ Component({
type: Number, type: Number,
value: 0 value: 0
}, },
mode:{ mode: {
type: Number, type: Number,
value: 0 // value: 0,
// observer: function (n) {
// console.log(n,'mode');
// let {tabListNor,tabListSimple} = this.data
// this.setData({
// tabList:n?tabListSimple:tabListNor
// })
// }
} }
}, },
...@@ -21,8 +33,7 @@ Component({ ...@@ -21,8 +33,7 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
orderObj: [ orderObj: [{
{
label: '车架号', label: '车架号',
key: 'carVin' key: 'carVin'
}, },
...@@ -59,6 +70,8 @@ Component({ ...@@ -59,6 +70,8 @@ Component({
nothing: false, nothing: false,
orderStatusObj: data.orderStatusObj, orderStatusObj: data.orderStatusObj,
// 0待报价、1待确认、2待支付、3已支付、4已完成、-1战败 // 0待报价、1待确认、2待支付、3已支付、4已完成、-1战败
tabListNor: ['全部', '待报价', '待确认', '待支付', '已支付', '已完成', '战败'],
tabListSimple: ['全部', '待报价', '待支付', '已支付', '已完成', '战败'],
tabList: ['全部', '待报价', '待确认', '待支付', '已支付', '已完成', '战败'], tabList: ['全部', '待报价', '待确认', '待支付', '已支付', '已完成', '战败'],
pageSize: 4, pageSize: 4,
currentPage: 1, currentPage: 1,
...@@ -71,7 +84,18 @@ Component({ ...@@ -71,7 +84,18 @@ Component({
sufferReason: '', sufferReason: '',
// mode: 0 // mode: 0
}, },
observers: {
'mode': function (value) {
// console.log(value,'mode');
let {
tabListNor,
tabListSimple
} = this.data
this.setData({
tabList: value ? tabListSimple : tabListNor
})
}
},
lifetimes: { lifetimes: {
attached() { attached() {
this.setData({ this.setData({
...@@ -98,30 +122,39 @@ Component({ ...@@ -98,30 +122,39 @@ Component({
this.getTotal() this.getTotal()
if (!noGetList) this.getList(true) if (!noGetList) this.getList(true)
}, },
handleClickOrderBtn(e) { handleClickOrderBtn(e) {
// console.log(e) // console.log(e)
// let { target } = e.target.dataset // let { target } = e.target.dataset
let { mode } = this.data let {
mode
} = this.data
wx.$router.go(mode ? 'createOrderCarQuotationSimple' : 'createOrderCarQuotation') wx.$router.go(mode ? 'createOrderCarQuotationSimple' : 'createOrderCarQuotation')
}, },
onBottomRefresh() { onBottomRefresh() {
this.getList() this.getList()
}, },
getTotal() { getTotal() {
let { storeInfo } = this.data let {
getQuotationStatistics({ merchantId: storeInfo?.merchantId }).then(res => { storeInfo
} = this.data
getQuotationStatistics({
merchantId: storeInfo?.merchantId
}).then(res => {
// console.log(res, '统计---') // console.log(res, '统计---')
let { code, message } = res let {
let data = res.data code,
? { message
...res.data, } = res
todayTurnover: res.data.todayTurnover ? ((res.data.todayTurnover / 100).toFixed(2) + '').split('.')[0] : '0', let data = res.data ?
todayTurDecimal: res.data.todayTurnover ? ((res.data.todayTurnover / 100).toFixed(2) + '').split('.')[1] : '00', {
totalTurnover: res.data.totalTurnover ? ((res.data.totalTurnover / 100).toFixed(2) + '').split('.')[0] : '0', ...res.data,
totalTurDecimal: res.data.totalTurnover ? ((res.data.totalTurnover / 100).toFixed(2) + '').split('.')[1] : '00' todayTurnover: res.data.todayTurnover ? ((res.data.todayTurnover / 100).toFixed(2) + '').split('.')[0] : '0',
} todayTurDecimal: res.data.todayTurnover ? ((res.data.todayTurnover / 100).toFixed(2) + '').split('.')[1] : '00',
: {} totalTurnover: res.data.totalTurnover ? ((res.data.totalTurnover / 100).toFixed(2) + '').split('.')[0] : '0',
totalTurDecimal: res.data.totalTurnover ? ((res.data.totalTurnover / 100).toFixed(2) + '').split('.')[1] : '00'
} :
{}
if (code == '0') { if (code == '0') {
this.setData({ this.setData({
statisticsObj: data statisticsObj: data
...@@ -147,7 +180,15 @@ Component({ ...@@ -147,7 +180,15 @@ Component({
return arr return arr
}, },
getList(isReset = false) { getList(isReset = false) {
let { pageSize, currentPage, tabList, tabIndex, customerName, storeInfo, nothing } = this.data let {
pageSize,
currentPage,
tabList,
tabIndex,
customerName,
storeInfo,
nothing
} = this.data
if (nothing) { if (nothing) {
return return
} }
...@@ -160,9 +201,12 @@ Component({ ...@@ -160,9 +201,12 @@ Component({
} }
quotationPage(params).then(res => { quotationPage(params).then(res => {
if (res.code == '0') { if (res.code == '0') {
let { list, total } = res.data let {
list,
total
} = res.data
let tempList = isReset ? this.dealListData(list || []) || [] : this.data.list.concat(this.dealListData(list || []) || []) let tempList = isReset ? this.dealListData(list || []) || [] : this.data.list.concat(this.dealListData(list || []) || [])
tempList = tempList.map((item)=>{ tempList = tempList.map((item) => {
item.createdTime = wx.$util.tsFormatTime(item.createdTime, 'Y.M.D h:m:s') item.createdTime = wx.$util.tsFormatTime(item.createdTime, 'Y.M.D h:m:s')
return item return item
}) })
...@@ -204,14 +248,18 @@ Component({ ...@@ -204,14 +248,18 @@ Component({
this.search() this.search()
}, },
input(e) { input(e) {
let { value } = e.detail let {
value
} = e.detail
this.setData({ this.setData({
customerName: value customerName: value
}) })
}, },
// 首次进入会触发该方法,因此不需要在attached调getList // 首次进入会触发该方法,因此不需要在attached调getList
tabClick(e) { tabClick(e) {
let { searchObj } = this.data let {
searchObj
} = this.data
delete searchObj.statusList delete searchObj.statusList
this.setData({ this.setData({
tabIndex: e?.detail, tabIndex: e?.detail,
...@@ -221,7 +269,10 @@ Component({ ...@@ -221,7 +269,10 @@ Component({
}, },
// 按钮 // 按钮
handleClickBtn(e) { handleClickBtn(e) {
let { target, type } = e.currentTarget.dataset let {
target,
type
} = e.currentTarget.dataset
console.log(target) console.log(target)
// wx.$router.go('createOrderCarQuotation', { // wx.$router.go('createOrderCarQuotation', {
// id: target.id // id: target.id
...@@ -267,7 +318,10 @@ Component({ ...@@ -267,7 +318,10 @@ Component({
apiName: 'handler' apiName: 'handler'
}) })
} else { } else {
wx.$router.go('signature', { id: target.id, orderId: target.orderId }) wx.$router.go('signature', {
id: target.id,
orderId: target.orderId
})
} }
break break
case '-1': case '-1':
...@@ -293,14 +347,19 @@ Component({ ...@@ -293,14 +347,19 @@ Component({
}, },
remarkConfirm(e) { remarkConfirm(e) {
let value = e.detail let value = e.detail
let { id } = this.data let {
id
} = this.data
if (value) { if (value) {
updateOrderStatus({ updateOrderStatus({
id, id,
orderStatus: -1, orderStatus: -1,
remark: value remark: value
}).then(res => { }).then(res => {
let { code, message } = res let {
code,
message
} = res
if (code == 0) { if (code == 0) {
wx.$util.showToast('提交成功') wx.$util.showToast('提交成功')
this.onLoad() this.onLoad()
...@@ -311,4 +370,4 @@ Component({ ...@@ -311,4 +370,4 @@ Component({
} }
} }
} }
}) })
\ 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!