| | |
| | | <dict-tag :options="dict.type.sys_platform" :value="scope.row.platformCode"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="归属部门" align="center" prop="deptName" /> |
| | | <el-table-column label="归属分公司" align="center" prop="deptNames" width="200"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.deptNames && scope.row.deptNames.length > 0"> |
| | | {{ scope.row.deptNames.join('、') }} |
| | | </span> |
| | | <span v-else>-</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="状态" align="center" prop="status"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="归属部门" align="center" prop="deptName" /> |
| | | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="归属部门" prop="deptId"> |
| | | <el-select v-model="form.deptId" placeholder="请选择部门" clearable> |
| | | <el-option |
| | | v-for="dept in deptOptions" |
| | | :key="dept.deptId" |
| | | :label="dept.deptName" |
| | | :value="dept.deptId" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio |
| | |
| | | >{{dict.label}}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="归属部门" prop="deptId"> |
| | | <el-select v-model="form.deptId" placeholder="请选择归属部门" clearable style="width: 100%"> |
| | | <el-form-item label="归属分公司" prop="deptIds"> |
| | | <el-select v-model="form.deptIds" placeholder="请选择归属分公司" multiple clearable style="width: 100%"> |
| | | <el-option |
| | | v-for="dept in deptList" |
| | | :key="dept.deptId" |
| | |
| | | status: "0", |
| | | remark: null, |
| | | platformCode: null, |
| | | deptId: null |
| | | deptId: null, |
| | | deptIds: [] // 多个分公司ID数组 |
| | | }, |
| | | // 表单校验 |
| | | rules: { |
| | |
| | | platformCode: [ |
| | | { required: true, message: "平台标识不能为空", trigger: "change" } |
| | | ], |
| | | deptId: [ |
| | | { required: true, message: "归属部门不能为空", trigger: "change" } |
| | | deptIds: [ |
| | | { required: true, message: "归属分公司不能为空", trigger: "change", type: 'array' } |
| | | ] |
| | | } |
| | | }; |
| | |
| | | status: "0", |
| | | remark: null, |
| | | platformCode: null, |
| | | deptId: null |
| | | deptId: null, |
| | | deptIds: [] // 重置为空数组 |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | |
| | | const vehicleId = row.vehicleId || this.ids |
| | | getVehicle(vehicleId).then(response => { |
| | | this.form = response.data; |
| | | // 如果没有deptIds,则从 deptId 和 deptName 中预填 |
| | | if (!this.form.deptIds || this.form.deptIds.length === 0) { |
| | | if (this.form.deptId) { |
| | | this.form.deptIds = [this.form.deptId]; |
| | | } else { |
| | | this.form.deptIds = []; |
| | | } |
| | | } |
| | | this.open = true; |
| | | this.title = "修改车辆信息"; |
| | | }); |
| | |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | // 如果选择了多个分公司,将第一个设置为deptId(主分公司) |
| | | if (this.form.deptIds && this.form.deptIds.length > 0) { |
| | | this.form.deptId = this.form.deptIds[0]; |
| | | } |
| | | |
| | | if (this.form.vehicleId != null) { |
| | | updateVehicle(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |