|
@@ -4,7 +4,7 @@
|
|
|
<view class="top">
|
|
|
<text class="title">{{itemType.name}}</text>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="item-line">
|
|
|
基本信息
|
|
|
</view>
|
|
@@ -27,9 +27,9 @@
|
|
|
<view class="item">
|
|
|
<view class="l">车辆类型:</view>
|
|
|
<view class="r">
|
|
|
- <picker class="p-picker" id="qy" @change="bindPickerChange($event)" :value="type.index"
|
|
|
+ <picker v-if="type.list.length>0" class="p-picker" id="qy" @change="bindPickerChange($event)" :value="type.index"
|
|
|
:range="type.list" range-key="name">
|
|
|
- <text class="p-text">{{type.list[type.index]}}</text>
|
|
|
+ <text class="p-text">{{type.list[type.index].name}}</text>
|
|
|
<u-icon class="p-icon" name="arrow-down-fill" size="20"></u-icon>
|
|
|
</picker>
|
|
|
</view>
|
|
@@ -40,12 +40,26 @@
|
|
|
<u-input placeholder="请填写车辆规格" v-model="form.carSize" />
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="item" v-if="type.index==1">
|
|
|
+ <view class="item" v-if="type.index==0">
|
|
|
<view class="l">载重(kg):</view>
|
|
|
<view class="r">
|
|
|
<u-input placeholder="请填写车辆载重" v-model="form.carWeight" />
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="item">
|
|
|
+ <view class="l">作业人员:</view>
|
|
|
+ <view class="r">
|
|
|
+ <u-input placeholder="请填写作业人员" v-model="form.operator" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="item">
|
|
|
+ <view class="l">作业时间:</view>
|
|
|
+ <view class="r">
|
|
|
+ <uni-datetime-picker placeholder="请选择" :clear-icon="false" type="datetime"
|
|
|
+ v-model="form.operateTime" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view class="item-line">
|
|
|
收费明细<text style="color: red;">(总共{{totalPrice}}元)</text>
|
|
|
</view>
|
|
@@ -63,10 +77,11 @@
|
|
|
<view slot="minus" class="minus">
|
|
|
<u-icon name="minus" size="12"></u-icon>
|
|
|
</view>
|
|
|
- <text v-if="item.inc==0" slot="input" style="width: 50px;text-align: center;color: #E5E5E5;"
|
|
|
+ <text v-if="item.inc==0" slot="input"
|
|
|
+ style="width: 50px;text-align: center;color: #E5E5E5;"
|
|
|
+ class="input">{{item.num}}</text>
|
|
|
+ <text v-else slot="input" style="width: 50px;text-align: center;"
|
|
|
class="input">{{item.num}}</text>
|
|
|
- <text v-else slot="input" style="width: 50px;text-align: center;"
|
|
|
- class="input">{{item.num}}</text>
|
|
|
<view slot="plus" class="plus">
|
|
|
<u-icon name="plus" size="12"></u-icon>
|
|
|
</view>
|
|
@@ -93,8 +108,8 @@
|
|
|
return {
|
|
|
showRemark: false,
|
|
|
type: {
|
|
|
- index: 1,
|
|
|
- list: ['空车', '载货']
|
|
|
+ index: 0,
|
|
|
+ list: []
|
|
|
},
|
|
|
customer: {
|
|
|
index: 0,
|
|
@@ -105,7 +120,8 @@
|
|
|
customerId: '',
|
|
|
carNo: '',
|
|
|
carSize: '',
|
|
|
- carWeight: ''
|
|
|
+ carWeight: '',
|
|
|
+ operator: ''
|
|
|
},
|
|
|
list: [],
|
|
|
checkList: [],
|
|
@@ -131,12 +147,12 @@
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
let customerId = uni.getStorageSync('customerId');
|
|
|
- console.log(customerId)
|
|
|
this.customerId = customerId;
|
|
|
let typeId = options.typeId;
|
|
|
this.itemType.id = typeId;
|
|
|
- this.getItemType();
|
|
|
- if (!customerId||customerId == '1') {
|
|
|
+
|
|
|
+ this.getItemTypeEnum();
|
|
|
+ if (!customerId || customerId == '1') {
|
|
|
this.getCustomerList();
|
|
|
}
|
|
|
let that = this;
|
|
@@ -149,8 +165,19 @@
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ getItemTypeEnum() {
|
|
|
+ this.$api.getItemTypeEnum().then(resp => {
|
|
|
+ this.type.list = resp.data;
|
|
|
+ this.getItemType();
|
|
|
+ })
|
|
|
+ },
|
|
|
getCustomerList() {
|
|
|
- let p={judgeStatus: 2,pageNo:1,pageSize:30, type: 0}
|
|
|
+ let p = {
|
|
|
+ judgeStatus: 2,
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 30,
|
|
|
+ sortType: 20
|
|
|
+ }
|
|
|
this.$api.getCustomerList(p).then(resp => {
|
|
|
this.customer.list = resp.data;
|
|
|
})
|
|
@@ -167,8 +194,10 @@
|
|
|
id: this.itemType.id
|
|
|
}).then(resp => {
|
|
|
let data = resp.data;
|
|
|
+ let items = data.items
|
|
|
+ .filter(obj => obj.itemType && obj.itemType.indexOf(this.type.list[this.type.index].name) !== -1);
|
|
|
+ data.items=items;
|
|
|
this.itemType = data;
|
|
|
- let items = data.items;
|
|
|
this.checkList = items.filter(obj => obj.need == 1).map(obj => obj.id)
|
|
|
|
|
|
})
|
|
@@ -176,8 +205,9 @@
|
|
|
bindPickerChange(e) {
|
|
|
let index = e.detail.value;
|
|
|
this.type.index = index //当前picker选中的值
|
|
|
+ this.getItemType();
|
|
|
},
|
|
|
- customerChange(e){
|
|
|
+ customerChange(e) {
|
|
|
let index = e.detail.value;
|
|
|
this.customer.index = index //当前picker选中的值
|
|
|
},
|
|
@@ -189,14 +219,14 @@
|
|
|
let itemList = this.itemType.items;
|
|
|
let checkList = this.checkList;
|
|
|
let list = itemList.filter(obj => checkList.indexOf(obj.id) !== -1);
|
|
|
- if(this.customerId=='1'||!this.customerId){
|
|
|
+ if (this.customerId == '1' || !this.customerId) {
|
|
|
this.form.customerId = this.customer.list[this.customer.index].id;
|
|
|
- }else{
|
|
|
- this.form.customerId=this.customerId
|
|
|
+ } else {
|
|
|
+ this.form.customerId = this.customerId
|
|
|
}
|
|
|
this.form.itemTypeId = this.itemType.id;
|
|
|
this.form.items = list;
|
|
|
- this.form.carType = this.type.list[this.type.index]
|
|
|
+ this.form.carType = this.type.list[this.type.index].name
|
|
|
let that = this;
|
|
|
let content = '确认录入该车辆的业务?'
|
|
|
uni.showModal({
|
|
@@ -213,6 +243,8 @@
|
|
|
this.$api.addCarDisinfect(this.$common.removeNull(this.form)).then(resp => {
|
|
|
if (resp.code == 200) {
|
|
|
this.$common.to('/pages/onely-disinfect/addSuccess?typeId=' + this.itemType.id)
|
|
|
+ } else {
|
|
|
+ this.$common.toast(resp.msg);
|
|
|
}
|
|
|
})
|
|
|
},
|