Commit b8f9b0a3 by 张立顺

bug修复

1 parent fd29a882
......@@ -10,7 +10,7 @@
* 2测试
* 3生产环境
*/
let index = 2
let index = 1
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
......
......@@ -24,6 +24,12 @@ Component({
orderInfo: {
type: Object,
observer: function (n) {
if (n.mode) {
// first: data.firstObj,
this.setData({
first:n.mode?data.firstObjSimple:data.firstObj
})
}
if (n?.modifyEquityQuotation) {
this.setData({
// activeNames: ['3'],
......
......@@ -87,7 +87,70 @@ const firstObj = {
label: '车架号',
name: 'carVin',
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 = {
export default {
formRule,
firstObj,
optionsSelect
optionsSelect,
firstObjSimple
}
......@@ -438,9 +438,9 @@ Page({
}
this.setData({ id: options.id })
this.getOrderInfo()
} else {
this.getQuotationInfo()
}
this.getQuotationInfo()
},
/**
* 生命周期函数--监听页面加载
......
// 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 constantData from '../constant/data'
Component({
......@@ -11,9 +16,16 @@ Component({
type: Number,
value: 0
},
mode:{
mode: {
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({
* 组件的初始数据
*/
data: {
orderObj: [
{
orderObj: [{
label: '车架号',
key: 'carVin'
},
......@@ -59,6 +70,8 @@ Component({
nothing: false,
orderStatusObj: data.orderStatusObj,
// 0待报价、1待确认、2待支付、3已支付、4已完成、-1战败
tabListNor: ['全部', '待报价', '待确认', '待支付', '已支付', '已完成', '战败'],
tabListSimple: ['全部', '待报价', '待支付', '已支付', '已完成', '战败'],
tabList: ['全部', '待报价', '待确认', '待支付', '已支付', '已完成', '战败'],
pageSize: 4,
currentPage: 1,
......@@ -71,7 +84,18 @@ Component({
sufferReason: '',
// mode: 0
},
observers: {
'mode': function (value) {
// console.log(value,'mode');
let {
tabListNor,
tabListSimple
} = this.data
this.setData({
tabList: value ? tabListSimple : tabListNor
})
}
},
lifetimes: {
attached() {
this.setData({
......@@ -102,26 +126,35 @@ Component({
handleClickOrderBtn(e) {
// console.log(e)
// let { target } = e.target.dataset
let { mode } = this.data
let {
mode
} = this.data
wx.$router.go(mode ? 'createOrderCarQuotationSimple' : 'createOrderCarQuotation')
},
onBottomRefresh() {
this.getList()
},
getTotal() {
let { storeInfo } = this.data
getQuotationStatistics({ merchantId: storeInfo?.merchantId }).then(res => {
let {
storeInfo
} = this.data
getQuotationStatistics({
merchantId: storeInfo?.merchantId
}).then(res => {
// console.log(res, '统计---')
let { code, message } = res
let data = res.data
? {
let {
code,
message
} = res
let data = res.data ?
{
...res.data,
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') {
this.setData({
statisticsObj: data
......@@ -147,7 +180,15 @@ Component({
return arr
},
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) {
return
}
......@@ -160,9 +201,12 @@ Component({
}
quotationPage(params).then(res => {
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 || []) || [])
tempList = tempList.map((item)=>{
tempList = tempList.map((item) => {
item.createdTime = wx.$util.tsFormatTime(item.createdTime, 'Y.M.D h:m:s')
return item
})
......@@ -204,14 +248,18 @@ Component({
this.search()
},
input(e) {
let { value } = e.detail
let {
value
} = e.detail
this.setData({
customerName: value
})
},
// 首次进入会触发该方法,因此不需要在attached调getList
tabClick(e) {
let { searchObj } = this.data
let {
searchObj
} = this.data
delete searchObj.statusList
this.setData({
tabIndex: e?.detail,
......@@ -221,7 +269,10 @@ Component({
},
// 按钮
handleClickBtn(e) {
let { target, type } = e.currentTarget.dataset
let {
target,
type
} = e.currentTarget.dataset
console.log(target)
// wx.$router.go('createOrderCarQuotation', {
// id: target.id
......@@ -267,7 +318,10 @@ Component({
apiName: 'handler'
})
} else {
wx.$router.go('signature', { id: target.id, orderId: target.orderId })
wx.$router.go('signature', {
id: target.id,
orderId: target.orderId
})
}
break
case '-1':
......@@ -293,14 +347,19 @@ Component({
},
remarkConfirm(e) {
let value = e.detail
let { id } = this.data
let {
id
} = this.data
if (value) {
updateOrderStatus({
id,
orderStatus: -1,
remark: value
}).then(res => {
let { code, message } = res
let {
code,
message
} = res
if (code == 0) {
wx.$util.showToast('提交成功')
this.onLoad()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!