|
|
@@ -11,10 +11,9 @@ |
|
|
|
} from "@/utils/utils" |
|
|
|
import { |
|
|
|
orderList, |
|
|
|
workOrderList, |
|
|
|
userInfoQuery, |
|
|
|
searchVehicleInfo, |
|
|
|
silentLoginApi |
|
|
|
silentLoginApi, |
|
|
|
selectCarInfo |
|
|
|
} from "@/utils/network/api.js"; |
|
|
|
import { |
|
|
|
getItem, |
|
|
@@ -28,6 +27,7 @@ |
|
|
|
stringToJson |
|
|
|
} from "@/utils/network/encryption"; |
|
|
|
import { msg } from "@/utils/utils"; |
|
|
|
import { vehiclePlateColorPai } from "@/datas/vehiclePlateColor.js"; |
|
|
|
const state = reactive({ |
|
|
|
type: "", |
|
|
|
name: "", |
|
|
@@ -150,25 +150,13 @@ |
|
|
|
} else if (state.type == "9" && state.name == '解除车牌占用') { |
|
|
|
navTo('/subpackage/after-sale/rescind-carId/rescind-carId-select') |
|
|
|
} else if (state.type == "20") { |
|
|
|
uni.switchTab({ |
|
|
|
url: "/pages/user/user" |
|
|
|
queryCarMsg().then((item) => { |
|
|
|
console.log("item", item.vehicleManages) |
|
|
|
const params = encodeURIComponent(JSON.stringify(item.vehicleManages[0])) |
|
|
|
uni.navigateTo({ |
|
|
|
url: `/subpackage/personal-center/car-details?params=${params}` |
|
|
|
}) |
|
|
|
}) |
|
|
|
// searchVehicleInfoQuery().then((item : any) => { |
|
|
|
// console.log("====", item.vehicles[0]) |
|
|
|
// state.customerId = item.vehicles[0]['customerId'] |
|
|
|
// state.vehiclePlate = item.vehicles[0]['vehiclePlate'] |
|
|
|
// state.vehiclePlateColor = item.vehicles[0]['vehiclePlateColor'] |
|
|
|
// isWorkOrder().then((item : any) => { |
|
|
|
// console.log("查询是否有工单", item) |
|
|
|
// if (item.data) { |
|
|
|
// if (item.data[0]['status'] == '0') { |
|
|
|
// navTo(`/subpackage/after-sale/equipment-upgrade/upgrade-confirm?id=${state.id}&workId=${item.data[0]['id']}`) |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// msg('暂无工单') |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
} else if (state.type == "21") { |
|
|
|
navTo(`/subpackage/after-sale/additional-equipment/additional-equipment-confirm?id=${state.id}`) |
|
|
|
} else if (state.type == "22") { |
|
|
@@ -196,7 +184,11 @@ |
|
|
|
var vehiclePlateColor = state.vehicleId.split("_")[1] |
|
|
|
navTo(`/subpackage/after-sale/blacklist-query/list?vehiclePlate=${vehiclePlate}&vehiclePlateColor=${vehiclePlateColor}`) |
|
|
|
} else if (state.type == "31") { |
|
|
|
navTo(`/subpackage/orders/invoiceApply/Invoice-mannager`) |
|
|
|
if (state.name == "服务发票") { |
|
|
|
navTo(`/subpackage/orders/invoiceApply/invoice-content?type=1`) |
|
|
|
} else { |
|
|
|
navTo(`/subpackage/orders/invoiceApply/invoice-content?type=2`) |
|
|
|
} |
|
|
|
} else if (state.type == "32") { |
|
|
|
navTo(`/subpackage/after-sale/month-statement/month-statement-query-list?vehicleId=${state.vehicleId}`) |
|
|
|
} else if (state.type == "33") { |
|
|
@@ -206,42 +198,34 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const searchVehicleInfoQuery = () => { |
|
|
|
|
|
|
|
// 查询车辆信息 |
|
|
|
const queryCarMsg = () => { |
|
|
|
const options = { |
|
|
|
type: 2, |
|
|
|
data: { |
|
|
|
vehicleId: state.vehicleId |
|
|
|
"openId": getItem('openId'), |
|
|
|
"vehicleId": state.vehicleId |
|
|
|
}, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |
|
|
|
}; |
|
|
|
return new Promise(async (resolve, reject) => { |
|
|
|
const res = await request(searchVehicleInfo, options); |
|
|
|
const data = stringToJson(res.bizContent); |
|
|
|
resolve(data); |
|
|
|
}).catch((error) => { |
|
|
|
reject(error); |
|
|
|
}); |
|
|
|
} |
|
|
|
const isWorkOrder = () => { |
|
|
|
var data = { |
|
|
|
vehiclePlate: state.vehiclePlate, |
|
|
|
vehiclePlateColor: state.vehiclePlateColor, |
|
|
|
customerId: state.customerId, |
|
|
|
}; |
|
|
|
const options = { |
|
|
|
type: 2, |
|
|
|
data: data, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |
|
|
|
}; |
|
|
|
return new Promise(async (resolve, reject) => { |
|
|
|
const res = await request(workOrderList, options); |
|
|
|
const res = await request(selectCarInfo, options); |
|
|
|
const data = stringToJson(res.bizContent); |
|
|
|
for (var i = 0; i < data.length; i++) { |
|
|
|
for (var j = 0; j < vehiclePlateColorPai.length; j++) { |
|
|
|
if (data[i].vehiclePlateColor == vehiclePlateColorPai[j]['id']) { |
|
|
|
data[i].color = vehiclePlateColorPai[j]['color'] |
|
|
|
data[i].showColor = vehiclePlateColorPai[j]['showColor'] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
resolve(data); |
|
|
|
}).catch((error) => { |
|
|
|
reject(error); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
|