作者 xudada

小程序车辆分配任务优化

... ... @@ -125,9 +125,11 @@
</el-form-item>
<el-form-item label="跟进状态" prop="status">
<el-select v-model="ruleForm.status" placeholder="请选择状态" style="width: 100%">
<el-option label="待装" value="待装"></el-option>
<el-option label="在途" value="在途"></el-option>
<el-option label="已到仓" value="已到仓"></el-option>
<el-option label="靠台装货" value="靠台装货"></el-option>
<el-option label="运输中" value="运输中"></el-option>
<el-option label="已到未卸" value="已到未卸"></el-option>
<el-option label="靠台卸货" value="靠台卸货"></el-option>
<el-option label="已完成" value="已完成"></el-option>
</el-select>
</el-form-item>
... ...
... ... @@ -316,6 +316,24 @@
<el-form-item label="目的地" prop="dest">
<el-input v-model="PDForm.dest"></el-input>
</el-form-item>
<el-form-item label="客户名称" prop="opter">
<el-select v-model="PDForm.opter"
@click.native="getUsers2"
default-first-option
:loading="loading" clearable placeholder="请选择"
style="width: 100%">
<el-option
v-for="item in usernames2"
:key="item.roleName"
:label="item.roleName"
:value="item.departmentid"
:disabled="item.disabled">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="任务描述" prop="description">
<el-input type="textarea" v-model="PDForm.description"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitPDForm('PDForm')">派单</el-button>
<el-button @click="resetForm('PDForm')">取消</el-button>
... ... @@ -393,6 +411,7 @@
import {list} from "../../api/road_verecord/verecord";
import XLSX from 'xlsx';
import { saveAs } from 'file-saver';
import { getList as getCRMList } from '@/api/crm_api';
export default {
data() {
... ... @@ -402,7 +421,9 @@
licenseno: '',
orig: '',
dest: '',
dispatch: ''
dispatch: '',
description:'',
opter:''
},
rules: {
licenseno: [
... ... @@ -417,6 +438,10 @@
{required: true, message: '请输入始发地', trigger: 'blur'},
{min: 2, max: 100, message: '长度在 2 到 100 个字符', trigger: 'blur'}
],
opter: [
{required: true, message: '请选择派单客户', trigger: 'blur'},
{min: 2, max: 100, message: '长度在 2 到 100 个字符', trigger: 'blur'}
],
dest: [
{required: true, message: '请输入目的地', trigger: 'blur'},
{min: 2, max: 100, message: '长度在 3 到 100 个字符', trigger: 'blur'}
... ... @@ -529,6 +554,7 @@
trailerLicenseNo: '',
trailerFrameNo: ''
},
usernames2: [],
}
},
... ... @@ -633,7 +659,11 @@
item.dest = this.PDForm.dest;
item.dispatch = this.PDForm.dispatch;
});
paidan(this.multipleSelection).then((response) => {
const params = {
records: this.multipleSelection,
pdform: this.PDForm
};
paidan(params).then((response) => {
const res = response.data
if (res.code !== '200') {
return this.$message.error('车辆派单,失败!')
... ... @@ -749,6 +779,7 @@
} else {
this.$message.error('请选勾取要派车的运单信息!');
}
this.getUsers2();
},
//新增
addVehicle() {
... ... @@ -798,6 +829,20 @@
this.listLoading = false;
});
},
//获取用户名列表
getUsers2() {
let data = {orgtype: "",roleName:"",departmentid:""};
let para={pageSize: 1000, pageNum: 1}
this.listLoading = true;
getUserList(data,para).then((res) => {
this.usernames2 = res.data.data.list;
console.log(this.usernames2)
}).catch((error) => {
this.$message.error(error.toString());
}).finally(() => {
this.listLoading = false;
});
},
},
mounted() {
this.getLists();
... ...