Commit 150db94d by cwq0219

修改

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