|
@@ -31,7 +31,42 @@
|
|
|
</u-col>
|
|
|
</u-row>
|
|
|
</view>
|
|
|
- <view class="box" v-show="!hs.visible">
|
|
|
+ <view class="box" v-show="china.visible">
|
|
|
+ <view class="top">
|
|
|
+ <text class="title">中国车录入</text>
|
|
|
+ </view>
|
|
|
+ <view style="display: flex;margin-top: 40rpx;">
|
|
|
+ <u-button type="primary" @click="china.visible=false" text="返回" style="width: 20px;" size="mini" />
|
|
|
+ <u-button type="primary" @click="showChinaModal" text="添加" icon="plus" style="width: 20px;"
|
|
|
+ size="mini" />
|
|
|
+ </view>
|
|
|
+ <u-row style="margin-top: 70rpx;">
|
|
|
+ <u-col span="3" style="text-align: center;">车牌号</u-col>
|
|
|
+ <u-col span="3" style="text-align: center;">联系人</u-col>
|
|
|
+ <u-col span="3" style="text-align: center;">联系号码</u-col>
|
|
|
+ <u-col span="3" style="text-align: center;">操作</u-col>
|
|
|
+ </u-row>
|
|
|
+ <u-row v-for="(item,index) in china.list" style="margin-top: 40rpx;">
|
|
|
+ <u-col span="3" style="text-align: center;">{{item.carNo}}</u-col>
|
|
|
+ <u-col span="3" style="text-align: center;">{{item.driverName}}</u-col>
|
|
|
+ <u-col span="3" style="text-align: center;">{{item.driverPhone}}</u-col>
|
|
|
+ <u-col span="3" style="text-align: center;">
|
|
|
+ <u-row>
|
|
|
+ <u-col span="6">
|
|
|
+ <u-button type="primary" text="编辑" style="width: 20px;" @click="editChinaCar(item,index)"
|
|
|
+ size="mini">
|
|
|
+ </u-button>
|
|
|
+ </u-col>
|
|
|
+ <u-col span="6">
|
|
|
+ <u-button type="error" style="width: 20px;" text="删除" @click="deleteChinaCar(item,index)"
|
|
|
+ size="mini">
|
|
|
+ </u-button>
|
|
|
+ </u-col>
|
|
|
+ </u-row>
|
|
|
+ </u-col>
|
|
|
+ </u-row>
|
|
|
+ </view>
|
|
|
+ <view class="box" v-show="!hs.visible&&!china.visible">
|
|
|
<view class="top">
|
|
|
<text class="title">业务录入</text>
|
|
|
</view>
|
|
@@ -59,7 +94,7 @@
|
|
|
<view class="item">
|
|
|
<view class="l"><text style="color: red;">*</text>载重:</view>
|
|
|
<view class="r">
|
|
|
- <u-input type="number" placeholder="输入载重" v-model="form.netWeight">
|
|
|
+ <u-input type="number" placeholder="输入载重" v-model="form.netWeight">
|
|
|
<text slot="suffix">吨</text>
|
|
|
</u-input>
|
|
|
</view>
|
|
@@ -67,44 +102,23 @@
|
|
|
<view class="item">
|
|
|
<view class="l"><text style="color: red;">*</text>境外车牌:</view>
|
|
|
<view class="r">
|
|
|
- <u-input placeholder="输入车牌号" v-model="form.cardNo" />
|
|
|
+ <u-input placeholder="输入车牌号" v-model="form.cardNo" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<view class="l"><text style="color: red;">*</text>境外车规格:</view>
|
|
|
<view class="r">
|
|
|
- <u-input type="number" placeholder="输入车辆规格" @blur="car.carInput=false" @input="carSizeInput"
|
|
|
- v-model="form.cardSize">
|
|
|
+ <u-input type="number" placeholder="输入车辆规格" v-model="form.cardSize">
|
|
|
<text slot="suffix">米</text>
|
|
|
</u-input>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <view class="item">
|
|
|
- <view class="l"><text style="color: red;">*</text>预计入场:</view>
|
|
|
- <view class="r">
|
|
|
- <view class="r">
|
|
|
- <uni-datetime-picker placeholder="请选择" @change="expectDayChange" :clear-icon="false"
|
|
|
- :start="exprctStart" type="datetime" v-model="form.expectInDay" @close="closeFn" />
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="item">
|
|
|
- <view class="l"><text style="color: red;">*</text>中国车牌号:</view>
|
|
|
- <view class="r">
|
|
|
- <u-input placeholder="中国车牌号" v-model="form.chinaCarNo" />
|
|
|
- </view>
|
|
|
- </view>
|
|
|
<view class="item">
|
|
|
- <view class="l"><text style="color: red;">*</text>中国司机:</view>
|
|
|
+ <view class="l">中国车:</view>
|
|
|
<view class="r">
|
|
|
- <u-input placeholder="司机姓名" v-model="form.driverName" />
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="item">
|
|
|
- <view class="l"><text style="color: red;">*</text>联系号码:</view>
|
|
|
- <view class="r">
|
|
|
- <u-input placeholder="司机联系号码" type="number" v-model="form.driverPhone" />
|
|
|
+ <u-input placeholder="中国车" v-model="china.list.map(obj=>obj.carNo).join('、')" readonly>
|
|
|
+ <text slot="suffix" style="font-size: 50rpx;" @click="addCar">+</text>
|
|
|
+ </u-input>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
@@ -118,7 +132,7 @@
|
|
|
<view @click="selectItemFn(item)" style="width: 150px;">
|
|
|
<u-input placeholder="请选择" v-model="item.itemName" readonly clearable>
|
|
|
<u-icon name="close" v-if="item.itemName" slot="suffix" color="#E5E5E5;" size="5"
|
|
|
- @click="item.itemName=''"></u-icon>
|
|
|
+ @click="cleanItemSelect(item)"></u-icon>
|
|
|
</u-input>
|
|
|
</view>
|
|
|
<view style="width: 20px;margin-left: 10rpx;">
|
|
@@ -137,7 +151,7 @@
|
|
|
合计:{{totalPrice}}元
|
|
|
</view>
|
|
|
</view>
|
|
|
- <u-button type="primary" text="确定" @click="saveFn" v-show="!hs.visible"></u-button>
|
|
|
+ <u-button type="primary" text="确定" @click="saveFn" v-show="!hs.visible&&!china.visible"></u-button>
|
|
|
<!-- ---------------------------------------------------------- -->
|
|
|
<view class="bottom-safety"></view>
|
|
|
<u-popup :show="car.carInput" :overlay="false" @close="car.carInput=false" borderRadius="10">
|
|
@@ -176,6 +190,29 @@
|
|
|
</u--input>
|
|
|
</view>
|
|
|
</u-modal>
|
|
|
+ <u-modal :show="chinaAddModal.visible" title="中国车" @confirm="sureCarFn" @cancel="chinaAddModal.visible=false"
|
|
|
+ showCancelButton cancelText="关闭">
|
|
|
+ <view class="slot-content">
|
|
|
+ <u-row>
|
|
|
+ <u-col span="4">车牌号</u-col>
|
|
|
+ <u-col span="8">
|
|
|
+ <u--input placeholder="车牌号" v-model="chinaAddModal.form.carNo"></u--input>
|
|
|
+ </u-col>
|
|
|
+ </u-row>
|
|
|
+ <u-row>
|
|
|
+ <u-col span="4">联系人</u-col>
|
|
|
+ <u-col span="8">
|
|
|
+ <u--input placeholder="联系人" v-model="chinaAddModal.form.driverName"></u--input>
|
|
|
+ </u-col>
|
|
|
+ </u-row>
|
|
|
+ <u-row>
|
|
|
+ <u-col span="4">联系号码</u-col>
|
|
|
+ <u-col span="8">
|
|
|
+ <u--input placeholder="联系号码" v-model="chinaAddModal.form.driverPhone"></u--input>
|
|
|
+ </u-col>
|
|
|
+ </u-row>
|
|
|
+ </view>
|
|
|
+ </u-modal>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -242,7 +279,22 @@
|
|
|
name: '',
|
|
|
phone: ''
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ china: {
|
|
|
+ visible: false,
|
|
|
+ index: -1,
|
|
|
+ list: []
|
|
|
+ },
|
|
|
+ chinaAddModal: {
|
|
|
+ visible: false,
|
|
|
+ form: {
|
|
|
+ carNo: '',
|
|
|
+ driverName: '',
|
|
|
+ driverPhone: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkItem: '',
|
|
|
+ chinaCarPrefix:"浙粤京津冀晋蒙辽黑沪吉苏皖赣鲁豫鄂湘桂琼渝川贵云藏陕甘青宁"
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
@@ -279,12 +331,61 @@
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ addCar() {
|
|
|
+ this.china.visible = true;
|
|
|
+ },
|
|
|
+ showChinaModal() {
|
|
|
+ Object.assign(this.chinaAddModal, {
|
|
|
+ visible: true,
|
|
|
+ index: -1,
|
|
|
+ form: {
|
|
|
+ carNo: '',
|
|
|
+ driverName: '',
|
|
|
+ driverPhone: ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ sureCarFn() {
|
|
|
+ let form = this.chinaAddModal.form;
|
|
|
+ let carNo = form.carNo;
|
|
|
+ let phone = form.driverPhone;
|
|
|
+ if (carNo && !this.$common.isCarNo(carNo)) {
|
|
|
+ this.$common.toast('请输入正确的车牌号')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (phone && !this.$common.isPhone(phone)) {
|
|
|
+ this.$common.toast('请输入正确的手机号')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let list = this.china.list;
|
|
|
+ let index = this.chinaAddModal.index;
|
|
|
+ if (index > -1) {
|
|
|
+ list.splice(index, 1)
|
|
|
+ }
|
|
|
+ list.push(form)
|
|
|
+ this.chinaAddModal.visible = false;
|
|
|
+ },
|
|
|
+ deleteChinaCar(item, index) {
|
|
|
+ this.china.list.splice(index, 1);
|
|
|
+ },
|
|
|
+ editChinaCar(item, index) {
|
|
|
+ Object.assign(this.chinaAddModal, {
|
|
|
+ visible: true,
|
|
|
+ index: index,
|
|
|
+ form: item
|
|
|
+ })
|
|
|
+ },
|
|
|
getBusinessById() {
|
|
|
this.$api.getBusinessById({
|
|
|
id: this.form.id
|
|
|
}).then(resp => {
|
|
|
let data = resp.data;
|
|
|
this.form = data;
|
|
|
+ let list=this.chinaCarPrefix;
|
|
|
+ this.china.list=data.cars.filter(obj=>{
|
|
|
+ return list.indexOf(obj.carNo.substr(0,1))!==-1
|
|
|
+ });
|
|
|
+ console.log(this.china.list)
|
|
|
let goodsName = data.goodsName;
|
|
|
this.customer.index = this.customer.customerList.map(obj => obj.name).indexOf(data
|
|
|
.customerName);
|
|
@@ -300,6 +401,10 @@
|
|
|
let item = items[j];
|
|
|
if (item.itemTypeId == type.id) {
|
|
|
type.itemName = item.itemName;
|
|
|
+ let typeName=type.name;
|
|
|
+ if (typeName == '干杂货人工装卸' || typeName == '特殊车辆') {
|
|
|
+ this.checkItem = typeName;
|
|
|
+ }
|
|
|
type.num = item.num
|
|
|
break;
|
|
|
}
|
|
@@ -307,7 +412,7 @@
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
this.car.carInput = false;
|
|
|
- }, 50)
|
|
|
+ }, 30)
|
|
|
})
|
|
|
},
|
|
|
getBusinessPeople() {
|
|
@@ -458,10 +563,27 @@
|
|
|
},
|
|
|
|
|
|
selectItemFn(item) {
|
|
|
+ let typeName = item.name;
|
|
|
+ let checkItem = this.checkItem;
|
|
|
+ if ((typeName == '干杂货人工装卸' && checkItem == '特殊车辆') ||
|
|
|
+ (typeName == '特殊车辆' && checkItem == '干杂货人工装卸')) {
|
|
|
+ this.$common.toast('不能同时选择干杂货人工装卸和特殊车辆');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (typeName == '干杂货人工装卸' || typeName == '特殊车辆') {
|
|
|
+ this.checkItem = typeName;
|
|
|
+ }
|
|
|
this.item = item;
|
|
|
this.show = true;
|
|
|
|
|
|
},
|
|
|
+ cleanItemSelect(item) {
|
|
|
+ item.itemName = '';
|
|
|
+ setTimeout(() => {
|
|
|
+ this.show = false;
|
|
|
+ this.checkItem = ''
|
|
|
+ }, 80)
|
|
|
+ },
|
|
|
itemSelectFn(data) {
|
|
|
this.show = false;
|
|
|
this.item.itemName = data;
|
|
@@ -475,19 +597,6 @@
|
|
|
this.$common.toast('车辆规格请录入数字')
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
- if (!this.form.chinaCarNo) {
|
|
|
- this.$common.toast('请录入中国车牌')
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (!this.form.driverName) {
|
|
|
- this.$common.toast('请录入中国司机')
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (!this.$common.isPhone(this.form.driverPhone)) {
|
|
|
- this.$common.toast('司机联系号码不正确')
|
|
|
- return false;
|
|
|
- }
|
|
|
if (!this.form.netWeight || !this.$common.isNum(this.form.netWeight)) {
|
|
|
this.$common.toast('载重必须输入数字')
|
|
|
return false;
|