Commit 150db94d by cwq0219

修改

1 parent 6f85768f
...@@ -18,19 +18,18 @@ function removeApi(data) { ...@@ -18,19 +18,18 @@ function removeApi(data) {
} }
function exportApi(data) { function exportApi(data) {
data.method = `${path}export` data.method = `${path}exportPdf`
return request(data) return request(data)
} }
function downloadApi(data) { // function downloadApi(data) {
data.method = `${path}download` // data.method = `${path}download`
return request(data) // return request(data)
} // }
export { export {
getListApi, getListApi,
detailApi, detailApi,
removeApi, removeApi,
exportApi, exportApi
downloadApi
} }
...@@ -21,7 +21,7 @@ function removeApi(data) { ...@@ -21,7 +21,7 @@ function removeApi(data) {
return request(data) return request(data)
} }
function isExistApi(data) { function isTrafficExistApi(data) {
data.method = `${path}detail` data.method = `${path}detail`
return request(data) return request(data)
} }
...@@ -31,5 +31,5 @@ export { ...@@ -31,5 +31,5 @@ export {
methods, methods,
editApi, editApi,
removeApi, removeApi,
isExistApi isTrafficExistApi
} }
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
<script> <script>
import DetailDialog from './detailDialog' import DetailDialog from './detailDialog'
import { getListApi, removeApi, exportApi, downloadApi } from '@api/materiaOrderManagement' import { getListApi, detailApi, removeApi, exportApi } from '@api/materiaOrderManagement'
import notice from '@/common/notice' import notice from '@/common/notice'
export default { export default {
name: 'fimsMateriaOrderManagement', name: 'fimsMateriaOrderManagement',
...@@ -264,7 +264,7 @@ export default { ...@@ -264,7 +264,7 @@ export default {
// 表格-查看详情 // 表格-查看详情
handleDetail(row) { handleDetail(row) {
downloadApi({ detailApi({
orderCode: row.orderCode orderCode: row.orderCode
}).then(res => { }).then(res => {
this.dialogTitle = row.orderType === 1 ? '物料申请' : '物料报废' this.dialogTitle = row.orderType === 1 ? '物料申请' : '物料报废'
......
<!-- 新增/编辑车辆弹窗 --> <!-- 新增/编辑车辆弹窗 -->
import { constants } from 'fs';
<template> <template>
<div> <div>
<el-dialog <el-dialog
...@@ -19,7 +18,9 @@ import { constants } from 'fs'; ...@@ -19,7 +18,9 @@ import { constants } from 'fs';
<el-input <el-input
:disabled="disabled" :disabled="disabled"
v-model="editForm.subsystemCode" v-model="editForm.subsystemCode"
maxlength="14"
placeholder="请输入子系统编号" placeholder="请输入子系统编号"
clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
...@@ -28,8 +29,10 @@ import { constants } from 'fs'; ...@@ -28,8 +29,10 @@ import { constants } from 'fs';
<el-input <el-input
:disabled="disabled" :disabled="disabled"
v-model="editForm.trafficCode" v-model="editForm.trafficCode"
maxlength="4"
placeholder="请输入车辆编号" placeholder="请输入车辆编号"
@change="validateCode" @change="validateCode"
clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="subsystemTypeCode"> <el-form-item label="类型" prop="subsystemTypeCode">
...@@ -72,6 +75,7 @@ import { constants } from 'fs'; ...@@ -72,6 +75,7 @@ import { constants } from 'fs';
<script> <script>
import { isExistApi } from '@api/subSysManagement' import { isExistApi } from '@api/subSysManagement'
import { isTrafficExistApi } from '@api/trafficManagement'
export default { export default {
name: 'EditDialog', name: 'EditDialog',
data() { data() {
...@@ -81,10 +85,13 @@ export default { ...@@ -81,10 +85,13 @@ export default {
rules: { rules: {
subsystemCode: [ subsystemCode: [
{ required: true, message: '请输入子系统编号', trigger: 'blur' }, { required: true, message: '请输入子系统编号', trigger: 'blur' },
{ required: true, message: '子系统编号需输入14位数字或大写字母', trigger: 'change', validator: this.isNumOrString },
{ required: true, message: '子系统编号已存在', trigger: 'blur', validator: this.isCodeExist } { required: true, message: '子系统编号已存在', trigger: 'blur', validator: this.isCodeExist }
], ],
trafficCode: [ trafficCode: [
{ required: true, message: '请输入车辆编号', trigger: 'blur' } { required: true, message: '请输入车辆编号', trigger: 'blur' },
{ required: true, message: '车辆编号需输入4位数字', trigger: 'change', validator: this.isNum },
{ required: true, message: '该车辆编号不存在', trigger: 'blur', validator: this.isTrafficCodeExist }
], ],
subsystemTypeCode: [ subsystemTypeCode: [
{ required: true, message: '请选择类型', trigger: 'change' } { required: true, message: '请选择类型', trigger: 'change' }
...@@ -132,6 +139,24 @@ export default { ...@@ -132,6 +139,24 @@ export default {
} }
}, },
async isTrafficCodeExist(rule, value, callback) {
console.log(value)
if (!this.editForm.id) {
const res = await isTrafficExistApi({ trafficCode: value })
res.trafficCode ? callback() : callback(new Error(rule.message))
}
},
isNum(rule, value, callback) {
const regNum = /^[\d]{4,4}$/
regNum.test(value) ? callback() : callback(new Error(rule.message))
},
isNumOrString(rule, value, callback) {
const regNum = /^[A-Z\d]{14,14}$/
regNum.test(value) ? callback() : callback(new Error(rule.message))
},
validateCode(value) { validateCode(value) {
this.$refs.editRuleForm.validateField('subsystemCode') this.$refs.editRuleForm.validateField('subsystemCode')
}, },
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</template> </template>
<script> <script>
import { isExistApi } from '@api/trafficManagement' import { isTrafficExistApi } from '@api/trafficManagement'
export default { export default {
name: 'EditDialog', name: 'EditDialog',
data() { data() {
...@@ -102,7 +102,7 @@ export default { ...@@ -102,7 +102,7 @@ export default {
methods: { methods: {
async isCodeExist(rule, value, callback) { async isCodeExist(rule, value, callback) {
if (!this.editForm.id) { if (!this.editForm.id) {
const res = await isExistApi({ trafficCode: value }) const res = await isTrafficExistApi({ trafficCode: value })
res.trafficCode ? callback(new Error(rule.message)) : callback() res.trafficCode ? callback(new Error(rule.message)) : callback()
} }
}, },
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
<el-table-column <el-table-column
align="center" align="center"
label="操作" label="操作"
width="100"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<auth-button :data="scope.row"></auth-button> <auth-button :data="scope.row"></auth-button>
...@@ -139,7 +140,8 @@ export default { ...@@ -139,7 +140,8 @@ export default {
tableData: [], tableData: [],
tableColumns: [{ tableColumns: [{
label: '车辆编号', label: '车辆编号',
prop: 'trafficCode' prop: 'trafficCode',
width: '120px'
}, { }, {
label: '归属车辆段', label: '归属车辆段',
prop: 'stationName' prop: 'stationName'
...@@ -149,6 +151,7 @@ export default { ...@@ -149,6 +151,7 @@ export default {
}, { }, {
label: '接口开放', label: '接口开放',
prop: 'openType', prop: 'openType',
width: '80px',
formatter: (cellValue) => { formatter: (cellValue) => {
if (cellValue.openType) { if (cellValue.openType) {
return { return {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!