Commit 577b56fd authored by zhang's avatar zhang
parents c97dd43d 0a649eb4
...@@ -11,7 +11,7 @@ VUE_APP_BASE_API = '/dev-api' ...@@ -11,7 +11,7 @@ VUE_APP_BASE_API = '/dev-api'
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true
# 图片服务器地址 # 图片服务器地址
# VUE_APP_IMAGE_API ='http://106.3.99.64:22013' # VUE_APP_IMAGE_API ='http://106.3.99.64:22013'
VUE_APP_IMAGE_API ='https://10.12.48.78' VUE_APP_IMAGE_API ='https://10.11.77.251:22008'
VUE_APP_CLIENT_API = 'https://10.12.48.78/vvmpapi' VUE_APP_CLIENT_API = 'https://10.12.48.78/vvmpapi'
import request from '@/utils/request' import request from '@/utils/request'
// 获取项目
export const getObjectList = () => {
return request({
url: '/Object/Data/getList',
method: 'post'
})
}
export const add = data => {
return request({
url: '/Plan/Record/add',
method: 'post',
data
})
}
// 获取路由 export const details = data => {
export const getObjectList = () => { return request({
return request({ url: '/Plan/Record/details',
url: '/Object/Data/getList', method: 'post',
method: 'post' data
}) })
} }
\ No newline at end of file export const standard = data => {
return request({
url: '/Plan/Record/standard',
method: 'post',
data
})
}
export const getList = () => {
return request({
url: '/Plan/Record/page',
method: 'post'
})
}
export const standardDetail = data => {
return request({
url: '/Plan/Record/standard',
method: 'post',
data
})
}
export const useCase = data => {
return request({
url: '/Plan/Record/useCase',
method: 'post',
data
})
}
export const update = (data) => {
return request({
url: '/Plan/Record/update',
method: 'post',
data
})
}
export const del = (data) => {
return request({
url: '/Plan/Record/del',
method: 'post',
data
})
}
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
<div v-for="(i, k) in items.options" class="checkbox-item" :key="k"> <div v-for="(i, k) in items.options" class="checkbox-item" :key="k">
<el-checkbox <el-checkbox
:disabled="status" :disabled="status"
v-model="value" :model="i.check"
:value="i.check"
@change="input" @change="input"
label="" label=""
> >
...@@ -46,12 +45,13 @@ export default { ...@@ -46,12 +45,13 @@ export default {
}, },
data() { data() {
return { return {
value: '', model: {
list: [] value: '',
list: []
}
} }
}, },
created() { created() {
this.value = this.defaultValue
this.reset() this.reset()
}, },
watch: { watch: {
...@@ -61,23 +61,33 @@ export default { ...@@ -61,23 +61,33 @@ export default {
status(newVal) { status(newVal) {
this.reset() this.reset()
this.$emit('changeVal', { name: this.prop, val: [] }) this.$emit('changeVal', { name: this.prop, val: [] })
this.$emit('makeRecord', { name: this.prop, record: {} })
}
},
mounted() {
if (this.defaultValue) {
this.model = this.defaultValue
this.$emit('changeVal', { name: this.prop, val: this.result})
this.$emit('makeRecord', { name: this.prop, record: this.model })
} else {
this.reset()
} }
}, },
methods: { methods: {
input(val) { input(val) {
let arr = [] let arr = []
this.list.map(i => { this.mdoel.list.map(i => {
if (i.check) { if (i.check) {
arr.push(i.useCaseNo) arr.push(i.useCaseNo)
} }
}) })
console.log(arr) this.$emit('changeVal', { name: this.prop, val: arr.join(',') })
this.$emit('changeVal', { name: this.prop, val: arr }) this.$emit('makeRecord', { name: this.prop, record: this.mdoel.list })
}, },
reset() { reset() {
this.list = [] this.model.list = []
this.items.options.map(i => { this.items.options.map(i => {
this.list.push({ this.model.list.push({
value: '', value: '',
check: false, check: false,
useCaseNo: i.useCaseNo, useCaseNo: i.useCaseNo,
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
<div v-for="(i, k) in items.options" class="checkbox-item" :key="k"> <div v-for="(i, k) in items.options" class="checkbox-item" :key="k">
<el-checkbox <el-checkbox
:disabled="status" :disabled="status"
v-model="list[k].check" v-model="model.list[k].check"
:value="i.id"
@change="input" @change="input"
label="" label=""
> >
...@@ -13,9 +12,9 @@ ...@@ -13,9 +12,9 @@
<el-input <el-input
v-bind="items" v-bind="items"
placeholder="请输入" placeholder="请输入"
:disabled="!list[k].check" :disabled="!model.list[k].check"
style="width: 10rem; margin: 0 10px" style="width: 10rem; margin: 0 10px"
v-model="list[k].value" v-model="model.list[k].value"
@input="input" @input="input"
> >
</el-input> </el-input>
...@@ -30,7 +29,7 @@ ...@@ -30,7 +29,7 @@
class="upload-demo" class="upload-demo"
:action="uploadImgUrl" :action="uploadImgUrl"
:on-preview="handlePreview" :on-preview="handlePreview"
v-model="file" v-model="model.file"
:on-remove="handleRemove" :on-remove="handleRemove"
:before-remove="beforeRemove" :before-remove="beforeRemove"
:show-file-list="false" :show-file-list="false"
...@@ -67,10 +66,12 @@ export default { ...@@ -67,10 +66,12 @@ export default {
}, },
data() { data() {
return { return {
value: '', model: {
list: [], value: '',
file: '', list: [],
path: '', file: '',
path: ''
},
uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio' // 上传的图片服务器地址 uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio' // 上传的图片服务器地址
} }
}, },
...@@ -80,28 +81,38 @@ export default { ...@@ -80,28 +81,38 @@ export default {
}, },
watch: { watch: {
defaultValue(newVal) { defaultValue(newVal) {
this.value = newVal this.model.value = newVal
}, },
status(newVal) { status(newVal) {
this.reset() this.reset()
this.$emit('changeVal', { name: this.prop, val: [] }) this.$emit('changeVal', { name: this.prop, val: [] })
this.$emit('makeRecord', { name: this.prop, record: {} })
}
},
mounted() {
if (this.defaultValue) {
this.model = this.defaultValue
this.$emit('changeVal', { name: this.prop, val: this.result})
this.$emit('makeRecord', { name: this.prop, record: this.model })
} else {
this.reset()
} }
}, },
methods: { methods: {
input(val) { input(val) {
let arr = [] let arr = []
this.list.map(i => { this.model.list.map(i => {
if (i.check) { if (i.check) {
arr.push(i.useCaseNo) arr.push(i.useCaseNo)
} }
}) })
console.log(arr) this.$emit('changeVal', { name: this.prop, val: arr.join(',') })
this.$emit('changeVal', { name: this.prop, val: this.list }) this.$emit('makeRecord', { name: this.prop, record: this.model })
}, },
reset() { reset() {
this.list = [] this.model.list = []
this.items.options.map(i => { this.items.options.map(i => {
this.list.push({ this.model.list.push({
value: '', value: '',
check: false, check: false,
useCaseNo: i.useCaseNo, useCaseNo: i.useCaseNo,
...@@ -117,7 +128,7 @@ export default { ...@@ -117,7 +128,7 @@ export default {
}, },
handleSuccess(res, file) { handleSuccess(res, file) {
if (res === 200) { if (res === 200) {
console.log(res) this.model.path = res.url
this.$message.success('上传成功') this.$message.success('上传成功')
} else { } else {
this.$message.error('error') this.$message.error('error')
......
...@@ -21,7 +21,9 @@ export default { ...@@ -21,7 +21,9 @@ export default {
default: false default: false
}, },
defaultValue: { defaultValue: {
type: [String, Number], default: ''
},
result: {
default: '' default: ''
} }
}, },
...@@ -37,11 +39,17 @@ export default { ...@@ -37,11 +39,17 @@ export default {
status(newVal) { status(newVal) {
this.value = [] this.value = []
this.$emit('changeVal', { name: this.prop, val: [] }) this.$emit('changeVal', { name: this.prop, val: [] })
this.$emit('makeRecord', { name: this.prop, record: []}) this.$emit('makeRecord', { name: this.prop, record: [] })
} }
}, },
mounted() { mounted() {
// this.value = this.defaultValue if (this.defaultValue) {
this.value = this.defaultValue
this.$emit('changeVal', { name: this.prop, val: this.result})
this.$emit('makeRecord', { name: this.prop, record: this.value })
} else {
this.reset()
}
}, },
methods: { methods: {
input(val) { input(val) {
...@@ -51,13 +59,11 @@ export default { ...@@ -51,13 +59,11 @@ export default {
arr.push(i.useCaseNo) arr.push(i.useCaseNo)
} }
}) })
console.log(arr) this.$emit('changeVal', { name: this.prop, val: arr.join(',') })
this.$emit('changeVal', { name: this.prop, val: arr })
this.$emit('makeRecord', { name: this.prop, record: this.value }) this.$emit('makeRecord', { name: this.prop, record: this.value })
}, },
reset() { reset() {
this.value = '' this.value = []
}, },
setDefaultValue(val) { setDefaultValue(val) {
this.value = val this.value = val
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
<el-checkbox-group :disabled="status" v-model="model.value" @change="input"> <el-checkbox-group :disabled="status" v-model="model.value" @change="input">
<el-checkbox <el-checkbox
v-for="(i, k) in items.options" v-for="(i, k) in items.options"
:label="i.object" :label="i.id"
:value="i.useCaseNo"
:key="k" :key="k"
> >
{{ i.object }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<el-upload <el-upload
...@@ -69,20 +69,29 @@ export default { ...@@ -69,20 +69,29 @@ export default {
} }
}, },
mounted() { mounted() {
this.reset() if (this.defaultValue) {
this.model = this.defaultValue
this.$emit('changeVal', { name: this.prop, val: this.result})
this.$emit('makeRecord', { name: this.prop, record: this.model })
} else {
this.reset()
}
}, },
methods: { methods: {
input() { input() {
let arr = [] let arr = []
this.item.options.map(i => { this.items.options.map(i => {
console.log(this.model.value)
console.log(i)
if (this.model.value.includes(i.id)) { if (this.model.value.includes(i.id)) {
arr.push(i.useCaseNo) arr.push(i.useCaseNo)
} }
}) })
console.log(arr)
this.$emit('changeVal', { this.$emit('changeVal', {
name: this.prop, name: this.prop,
val: arr val: arr.join(',')
}) })
this.$emit('makeRecord', { name: this.prop, record: this.model }) this.$emit('makeRecord', { name: this.prop, record: this.model })
}, },
......
...@@ -40,20 +40,22 @@ export default { ...@@ -40,20 +40,22 @@ export default {
status(newVal) { status(newVal) {
this.value = '' this.value = ''
this.$emit('changeVal', { name: this.prop, val: [] }) this.$emit('changeVal', { name: this.prop, val: [] })
this.$emit('makeRecord', { name: this.prop, record: '' })
} }
}, },
mounted() { mounted() {
this.value = this.defaultValue if (this.defaultValue) {
this.value = this.defaultValue
this.$emit('changeVal', { name: this.prop, val: this.result})
this.$emit('makeRecord', { name: this.prop, record: this.value })
} else {
this.reset()
}
}, },
methods: { methods: {
input(val) { input(val) {
let arr = [] this.$emit('changeVal', { name: this.prop, val: val })
if (val) { this.$emit('makeRecord', { name: this.prop, record: val })
this.items.options.map(i => {
arr.push(i.useCaseNo)
})
}
this.$emit('changeVal', { name: this.prop, val: arr })
}, },
reset() { reset() {
this.value = '' this.value = ''
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<el-input <el-input
v-bind="items" v-bind="items"
:disabled="status" :disabled="status"
v-model="value" v-model="model.value"
style="width: 50%" style="width: 50%"
placeholder="请输入" placeholder="请输入"
@input="input" @input="input"
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
class="upload-demo" class="upload-demo"
:action="uploadImgUrl" :action="uploadImgUrl"
:on-preview="handlePreview" :on-preview="handlePreview"
v-model="file" v-model="model.file"
:on-remove="handleRemove" :on-remove="handleRemove"
:before-remove="beforeRemove" :before-remove="beforeRemove"
:show-file-list="false" :show-file-list="false"
...@@ -50,8 +50,11 @@ export default { ...@@ -50,8 +50,11 @@ export default {
}, },
data() { data() {
return { return {
value: '', model: {
file: '', value: '',
file: '',
path: ''
},
uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio' // 上传的图片服务器地址 uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio' // 上传的图片服务器地址
} }
}, },
...@@ -60,12 +63,19 @@ export default { ...@@ -60,12 +63,19 @@ export default {
this.value = newVal this.value = newVal
}, },
status(newVal) { status(newVal) {
this.value = '' this.reset()
this.$emit('changeVal', { name: this.prop, val: [] }) this.$emit('changeVal', { name: this.prop, val: [] })
this.$emit('makeRecord', { name: this.prop, record:{} })
} }
}, },
mounted() { mounted() {
this.value = this.defaultValue if (this.defaultValue) {
this.model = this.defaultValue
this.$emit('changeVal', { name: this.prop, val: this.result})
this.$emit('makeRecord', { name: this.prop, record: this.model })
} else {
this.reset()
}
}, },
methods: { methods: {
input(val) { input(val) {
...@@ -75,10 +85,17 @@ export default { ...@@ -75,10 +85,17 @@ export default {
arr.push(i.useCaseNo) arr.push(i.useCaseNo)
}) })
} }
this.$emit('changeVal', { name: this.prop, val: arr }) console.log(arr);
this.$emit('changeVal', { name: this.prop, val: arr.join(',') })
this.$emit('makeRecord', { name: this.prop, record: this.model })
}, },
reset() { reset() {
this.value = '' this.model = {
value: '',
file: '',
path: ''
}
}, },
setDefaultValue(val) { setDefaultValue(val) {
this.value = val this.value = val
...@@ -91,6 +108,7 @@ export default { ...@@ -91,6 +108,7 @@ export default {
}, },
handleSuccess(res, file) { handleSuccess(res, file) {
if (res === 200) { if (res === 200) {
this.model.path = res.url
this.$message.success('上传成功') this.$message.success('上传成功')
} else { } else {
this.$message.error('error') this.$message.error('error')
......
...@@ -37,22 +37,32 @@ export default { ...@@ -37,22 +37,32 @@ export default {
status(newVal) { status(newVal) {
this.value = '' this.value = ''
this.$emit('changeVal', { name: this.prop, val: [] }) this.$emit('changeVal', { name: this.prop, val: [] })
this.$emit('makeRecord', { name: this.prop, record: this.value })
} }
}, },
mounted() { mounted() {
this.value = this.defaultValue if (this.defaultValue) {
this.value = this.defaultValue
this.$emit('changeVal', { name: this.prop, val: this.result})
this.$emit('makeRecord', { name: this.prop, record: this.value })
} else {
this.reset()
}
}, },
methods: { methods: {
input(val) { input(val) {
let arr = [] let arr = []
this.items.options.map(i => { this.items.options.map(i => {
console.log(i.id == this.value);
if (i.id == this.value) { if (i.id == this.value) {
console.log(i);
arr.push(i.useCaseNo) arr.push(i.useCaseNo)
} }
}) })
console.log(arr) this.$emit('changeVal', { name: this.prop, val: arr.join(',') })
this.$emit('makeRecord', { name: this.prop, record: this.value })
this.$emit('changeVal', { name: this.prop, val: arr })
}, },
reset() { reset() {
this.value = '' this.value = ''
......
<template> <template>
<div> <div>
<el-radio-group :disabled="status" v-model="value" @change="input"> <el-radio-group :disabled="status" v-model="model.value" @change="input">
<div v-for="(i, k) in items.options" class="checkbox-item" :key="k"> <div v-for="(i, k) in items.options" class="checkbox-item" :key="k">
<el-radio @change="input" :label="i.id"> <el-radio @change="input" :label="i.id">
<div class="checkbox-radio"> <div class="checkbox-radio">
<el-input <el-input
v-model="list[k].value" v-model="model.list[k].value"
placeholder="请输入" placeholder="请输入"
:disabled="value !== i.value" :disabled="value !== i.value"
style="width: 50%; margin: 0 10px" style="width: 50%; margin: 0 10px"
...@@ -43,8 +43,10 @@ export default { ...@@ -43,8 +43,10 @@ export default {
}, },
data() { data() {
return { return {
value: '', model:{
list: [] list: []
}
} }
}, },
created() { created() {
...@@ -58,23 +60,37 @@ export default { ...@@ -58,23 +60,37 @@ export default {
status(newVal) { status(newVal) {
this.reset() this.reset()
this.$emit('changeVal', { name: this.prop, val: [] }) this.$emit('changeVal', { name: this.prop, val: [] })
this.$emit('makeRecord', { name: this.prop, record: this.model })
}
},
mounted() {
if (this.defaultValue) {
this.model = this.defaultValue
this.$emit('changeVal', { name: this.prop, val: this.result})
this.$emit('makeRecord', { name: this.prop, record: this.model })
value
} else {
this.reset()
} }
}, },
methods: { methods: {
input(val) { input(val) {
let arr = [] let arr = []
if (val) { if (val) {
this.list.options.map(i => { this.model.list.options.map(i => {
if (i.key == this.value) { if (i.key == this.value) {
arr.push(i.useCaseNo) arr.push(i.useCaseNo)
} }
}) })
} }
this.$emit('changeVal', { name: this.prop, val: arr }) this.$emit('changeVal', { name: this.prop, val: arr.join(',') })
this.$emit('makeRecord', { name: this.prop, record: this.model })
}, },
reset() { reset() {
this.model.value = ''
this.items.options.map(i => { this.items.options.map(i => {
this.list.push({ this.model.list.push({
value: '', value: '',
useCaseNo:i.useCaseNo, useCaseNo:i.useCaseNo,
key: i.id key: i.id
......
<template> <template>
<div class="checkbox-upload"> <div class="checkbox-upload">
<el-radio-group :disabled="status" v-model="value" @change="input"> <el-radio-group :disabled="status" v-model="model.value" @change="input">
<el-radio v-for="(i, k) in items.options" :label="i.id" :key="k" <el-radio v-for="(i, k) in items.options" :label="i.id" :key="k"
>{{ i.object }} >{{ i.object }}
</el-radio> </el-radio>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
class="upload-demo" class="upload-demo"
:action="uploadImgUrl" :action="uploadImgUrl"
:on-preview="handlePreview" :on-preview="handlePreview"
v-model="file" v-model="model.file"
:on-remove="handleRemove" :on-remove="handleRemove"
:before-remove="beforeRemove" :before-remove="beforeRemove"
:show-file-list="false" :show-file-list="false"
...@@ -46,38 +46,54 @@ export default { ...@@ -46,38 +46,54 @@ export default {
}, },
data() { data() {
return { return {
value: '', model: {
file: '', value: '',
file: '',
path: ''
},
uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio' // 上传的图片服务器地址 uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio' // 上传的图片服务器地址
} }
}, },
watch: { watch: {
defaultValue(newVal) { defaultValue(newVal) {
this.value = newVal this.model = newVal
}, },
status(newVal) { status(newVal) {
this.reset() this.reset()
this.$emit('changeVal', { name: this.prop, val: [] }) this.$emit('changeVal', { name: this.prop, val: [] })
this.$emit('makeRecord', { name: this.prop, record: this.model })
} }
}, },
mounted() { mounted() {
this.value = this.defaultValue if (this.defaultValue) {
this.model = this.defaultValue
this.$emit('changeVal', { name: this.prop, val: this.result })
this.$emit('makeRecord', { name: this.prop, record: this.model })
} else {
this.reset()
}
}, },
methods: { methods: {
input(val) { input(val) {
let arr = [] let arr = []
this.items.options.map(i => { this.items.options.map(i => {
if (i.id == this.value) { if (i.id == this.model.value) {
arr.push(i.useCaseNo) arr.push(i.useCaseNo)
} }
}) })
this.$emit('changeVal', { name: this.prop, val: arr }) this.$emit('changeVal', { name: this.prop, val: arr.join(',') })
this.$emit('makeRecord', { name: this.prop, record: this.model })
}, },
reset() { reset() {
this.value = '' this.model = {
value: '',
file: '',
path: ''
}
}, },
setDefaultValue(val) { setDefaultValue(val) {
this.value = val this.mdoel = val
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
console.log(file, fileList) console.log(file, fileList)
...@@ -87,6 +103,7 @@ export default { ...@@ -87,6 +103,7 @@ export default {
}, },
handleSuccess(res, file) { handleSuccess(res, file) {
if (res === 200) { if (res === 200) {
this.model.path = res.url
this.$message.success('上传成功') this.$message.success('上传成功')
} else { } else {
this.$message.error('error') this.$message.error('error')
......
...@@ -22,9 +22,11 @@ ...@@ -22,9 +22,11 @@
style="width: 100%" style="width: 100%"
:rules="[ :rules="[
{ {
required: !item.status, validator: (rule, value, callback) => {
message: `${item.describe}不能为空`, checkItem(item, value, callback)
trigger: ['blur'] },
// message: `${item.describe}不能为空`,
trigger: ['change', 'blur']
} }
]" ]"
> >
...@@ -33,7 +35,8 @@ ...@@ -33,7 +35,8 @@
:status="item.status" :status="item.status"
:prop="item.key" :prop="item.key"
:items="item.componentProps" :items="item.componentProps"
:defaultValue="form[item.prop]" :defaultValue="item.record ? item.record.defaultValue : ''"
:result="item.result"
@changeVal="changeVal" @changeVal="changeVal"
@makeRecord="makeRecord" @makeRecord="makeRecord"
ref="formItem" ref="formItem"
...@@ -88,8 +91,6 @@ export default { ...@@ -88,8 +91,6 @@ export default {
...item ...item
} }
}) })
console.log('schemas', schemas)
return schemas return schemas
} }
}, },
...@@ -105,12 +106,12 @@ export default { ...@@ -105,12 +106,12 @@ export default {
changeVal(data) { changeVal(data) {
const { name, val } = data const { name, val } = data
this.form[name] = val this.form[name] = val
this.$refs.queryForm.clearValidate(name)
this.$emit('input', this.form) this.$emit('input', this.form)
this.$refs.queryForm.clearValidate(name)
}, },
makeRecord(data) { makeRecord(data) {
const { name, record } = data const { name, record } = data
if (this.record[name]) { if (!this.record[name]) {
this.record[name] = { this.record[name] = {
defaultValue: '' defaultValue: ''
} }
...@@ -118,16 +119,37 @@ export default { ...@@ -118,16 +119,37 @@ export default {
this.record[name].defaultValue = record this.record[name].defaultValue = record
}, },
getValidate() { checkItem(prop, value, cb) {
this.$refs.queryForm.validate(res => { if (!prop.status) {
if (res) { if (this.form[prop.key]) {
return true cb()
} else { } else {
console.log(3333) cb(new Error(`${prop.describe}不能为空`))
}
}
cb()
},
async getValidateVaule() {
const res = await this.$refs.queryForm.validate
if (res) {
let arr = []
let codes = []
this.schemas.map((i, k) => {
if (i.status == false) {
i.result = this.form[i.key]
i.record = this.record[i.key]
codes.push(this.form[i.key])
}
arr.push(i)
})
return false return {
record: arr,
codes: codes.join(',')
} }
}) } else {
return false
}
} }
} }
} }
......
...@@ -164,12 +164,7 @@ export function download(url, params, filename, config) { ...@@ -164,12 +164,7 @@ export function download(url, params, filename, config) {
}) })
return service return service
.post(url, params, { .post(url, params, {
transformRequest: [ headers: { 'Content-Type': 'application/json' },
params => {
return tansParams(params)
}
],
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob', responseType: 'blob',
...config ...config
}) })
......
<template>
<!--查看审查问卷页面-->
<task-standard v-loading="loading">
<div slot="header-right">
<header-button icon="arrow-left" type="no-line" @click="goBack">
返回
</header-button>
<header-button type="no-line" @click="exportPlan">
导出方案
</header-button>
</div>
<!--2-统计值-->
<div class="main-content-style">
<!--任务编号,名称,单位-->
<div class="task-box">
<div class="task-header">
<div class="task-item">
<span class="task-label">检验标准:</span>
<span class="task-content">
{{ task.inspectionStandardName }}
</span>
</div>
<div class="task-item">
<span class="task-label">被检车企:</span>
<span class="task-content">
{{ task.inspectCarCompanyName }}
</span>
</div>
<div class="task-item">
<span class="task-label">车辆VIN号:</span>
<span class="task-content">
{{ task.carModel }}
</span>
</div>
<div class="task-item">
<span class="task-label">检测机构:</span>
<span class="task-content">
{{ task.testOrganizationName }}
</span>
</div>
</div>
</div>
<el-tabs v-model="activeName">
<el-tab-pane
v-for="(item, key2) in dict.type.task_type"
:key="key2"
:label="item.label"
:name="item.value"
>
<!--审查表单概要-->
<div>
<div class="form-review-questionnaire">
<div class="title-display">
<div class="control-btns">
<div class="control-btn" @click="openAll()">
<icon-park
type="down-c"
theme="outline"
size="16"
style="margin-right: 5px"
fill="#303133"
/>
全部展开
</div>
<div class="control-btn" @click="closeAll()">
<icon-park
type="up-c"
theme="outline"
size="16"
style="margin-right: 5px"
fill="#303133"
/>
全部收起
</div>
</div>
</div>
</div>
<collapse
v-if="activeName == 'sraif' || activeName == 'trfis'"
v-model="activeNames"
class="mt10"
>
<collapse-item
v-for="(item, key3) in model"
:key="key3"
:name="item.chapter"
>
<span slot="title" style="width: 100%">
<div class="standard-box">
<div class="standard-left">
<div class="standard-title">
<div class="standard">标准:</div>
{{ item.chapter + item.text }}
</div>
</div>
</div>
</span>
<table class="table">
<tr>
<th>审查要点</th>
<th>审查细则</th>
<th>场景</th>
</tr>
<template
v-for="(keyPoint, keyPointKey) in item.keyPointList"
>
<tr :key="'keyPointKey' + keyPoint.id">
<td :rowspan="getRows(keyPoint)">
{{ keyPoint.text }}
</td>
</tr>
<template
v-for="reviewDetail in keyPoint.reviewDetailsList"
>
<tr :key="'reviewDetailKey' + reviewDetail.id">
<td
align="center"
:rowspan="
reviewDetail.reviewSceneList
? reviewDetail.reviewSceneList.length +1
: 2
"
>
{{ reviewDetail.text }}
</td>
</tr>
<template v-if="reviewDetail.reviewSceneList">
<template
v-for="(
reviewScene, reviewSceneKey
) in reviewDetail.reviewSceneList"
>
<tr :key="'reviewSceneKey' + reviewScene.id">
<td align="center">{{ reviewScene.text }}</td>
</tr>
</template>
</template>
<template v-else>
<tr>
<td align="center">__</td>
</tr>
</template>
</template>
</template>
</table>
</collapse-item>
</collapse>
<collapse
v-if="activeName == 'grfis'"
v-model="activeNames"
class="mt10"
>
<collapse-item
v-for="(item, key3) in model"
:key="key3"
:name="item.serialNumber"
>
<span slot="title" style="width: 100%">
<div class="standard-box">
<div class="standard-left">
<div class="standard-title">
<div class="standard">标准要求:</div>
{{ item.serialNumber + item.requirements }}
</div>
</div>
</div>
</span>
<table class="table">
<tr>
<th>用例编号</th>
<th>用例描述</th>
</tr>
<tr v-for="(item, key4) in item.useCases">
<td>{{ item.customizedID }}</td>
<td>
{{ item.description }}
</td>
</tr>
</table>
</collapse-item>
</collapse>
</div>
</el-tab-pane>
</el-tabs>
</div>
<!--返回按钮-->
<div class="bottom-btn">
<footer-button type="default" icon="arrow-left" @click="$router.go(-1)">
返回
</footer-button>
</div>
</task-standard>
</template>
<!--js逻辑-->
<script>
import collapse from '@/components/Collapse/collapse'
import collapseItem from '@/components/Collapse/collapse-item'
import routerMixins from '@/mixins/router'
import { details, standardDetail, useCase } from '@/api/plan'
export default {
components: {
collapse: collapse,
'collapse-item': collapseItem
},
dicts: ['task_type'],
mixins: [routerMixins],
watch: {
activeName: function (val) {
this.getDetailSource(val)
}
},
data() {
return {
isShow: true,
task: {},
inspectionItem: [],
activeName: '',
checkTestScenarioList: [],
activeNames: [],
model: [],
taskId: '',
loading: false
}
},
async mounted() {
if (this.$route.query.id) {
this.taskId = this.$route.query.id
}
await this.getTask()
this.openAll()
},
async activated() {
if (this.$route.query.id) {
this.taskId = this.$route.query.id
}
await this.getTask()
this.openAll()
},
methods: {
exportPlan() {
let queryParams = {
regulationName: this.task.inspectionStandardName,
matchUseCases: this.task.useCaseNo.split(',')
}
console.log(queryParams);
this.download(
'/Plan/Record/export',
{
...queryParams
},
`检验方案${new Date().getTime()}.xlsx`
)
},
openAll() {
if (this.activeName == 'grfis') {
this.activeNames = this.model.map(i => {
return i.serialNumber
})
} else {
this.activeNames = this.model.map(i => {
return i.chapter
})
}
},
getRows(i) {
let n = 0
if (i.reviewDetailsList) {
n = i.reviewDetailsList.length
}
i.reviewDetailsList.map(s => {
if (s.reviewSceneList) {
n = n * s.reviewSceneList.length
}else{
n = n + 1
}
})
return n + 1
},
async getDetailSource(type) {
let res
switch (type) {
case 'sraif':
res = await standardDetail({
inspectionStandardId: this.task.inspectionStandardId,
type: 'system'
})
if (res.code == 200) {
this.model = res.data
}
break
case 'trfis':
res = await standardDetail({
inspectionStandardId: this.task.inspectionStandardId,
type: 'car'
})
if (res.code == 200) {
this.model = res.data
console.log(this.model)
}
break
case 'grfis':
res = await useCase({
regulationName: this.task.inspectionStandardName,
matchUseCases: this.task.useCaseNo.split(',')
})
console.log(res)
if (res.code == 200) {
this.model = res.data
console.log(this.model)
}
break
}
},
closeAll() {
this.activeNames = []
},
/**
* 获取任务详情
*/
async getTask() {
this.loading = true
const res = await details({
id: this.taskId
})
this.loading = false
if (res.code === 200) {
this.task = res.data
this.inspectionItem = this.task.inspectionItem.split(',')
this.activeName = this.inspectionItem[0]
// this.getDetailSource(this.activeName)
} else {
this.$modal.msgError(res.msg)
}
},
/**
* 获取任务详情
*/
async getTaskDetail() {
const result = await getBySubtaskId({
id: this.taskId
})
if (result.code === 200) {
this.task = result.data
}
}
}
}
</script>
<!--样式-->
<style lang="scss" scoped>
::v-deep {
.form-review-questionnaire {
padding: 0;
}
.el-collapse-item {
margin-top: 10px;
}
}
</style>
...@@ -3,9 +3,13 @@ ...@@ -3,9 +3,13 @@
<el-form ref="form" :model="form" :rules="rules" class="formClass"> <el-form ref="form" :model="form" :rules="rules" class="formClass">
<el-row :gutter="30"> <el-row :gutter="30">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="检验标准" prop="standardId" style="width: 100%"> <el-form-item
label="检验标准"
prop="inspectionStandardId"
style="width: 100%"
>
<el-select <el-select
v-model="form.standardId" v-model="form.inspectionStandardId"
placeholder="请选择标准" placeholder="请选择标准"
style="width: 100%" style="width: 100%"
> >
...@@ -13,21 +17,22 @@ ...@@ -13,21 +17,22 @@
v-for="item in standardList" v-for="item in standardList"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id" :value="Number(item.id)"
> >
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="16" v-if="form.standardId"> <el-col :span="16" v-if="form.inspectionStandardId">
<el-form-item <el-form-item
prop="inspectionItemList" prop="inspectionItem"
label="检验项目(可多选)" label="检验项目(可多选)"
style="width: 100%" style="width: 100%"
required
> >
<div class="test-scenario-container"> <div class="test-scenario-container">
<div <div
v-for="(item, index) in inspectionItemList" v-for="(item, index) in inspectionItem"
:key="index" :key="index"
:class="{ :class="{
'test-scenario': item.check == false, 'test-scenario': item.check == false,
...@@ -41,9 +46,13 @@ ...@@ -41,9 +46,13 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="被检车企" prop="companyId" style="width: 100%"> <el-form-item
label="被检车企"
prop="inspectCarCompanyId"
style="width: 100%"
>
<el-select <el-select
v-model="form.companyId" v-model="form.inspectCarCompanyId"
placeholder="请选择被检车企" placeholder="请选择被检车企"
style="width: 100%" style="width: 100%"
> >
...@@ -51,15 +60,15 @@ ...@@ -51,15 +60,15 @@
v-for="item in componentSelect" v-for="item in componentSelect"
:key="item.id" :key="item.id"
:label="item.enterpriseName" :label="item.enterpriseName"
:value="item.id" :value="Number(item.id)"
> >
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="车辆VIN号" prop="VIN" style="width: 100%"> <el-form-item label="车辆VIN号" prop="carModel" style="width: 100%">
<el-input v-model="form.VIN" placeholder="请输入"></el-input> <el-input v-model="form.carModel" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
...@@ -70,7 +79,7 @@ ...@@ -70,7 +79,7 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<template v-if="form.inspectionItemList.indexOf('trfis') !== -1"> <template v-if="form.inspectionItem.indexOf('trfis') !== -1">
<CheckBuilder ref="check" :schemas="model" /> <CheckBuilder ref="check" :schemas="model" />
</template> </template>
<div class="page-footer"> <div class="page-footer">
...@@ -81,7 +90,7 @@ ...@@ -81,7 +90,7 @@
</template> </template>
<script> <script>
import CheckBuilder from '@/components/checkBuilder' import CheckBuilder from '@/components/checkBuilder'
import { getObjectList } from '@/api/plan' import { getObjectList, add, details } from '@/api/plan'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { getByStandardId } from '@/api/task/new' import { getByStandardId } from '@/api/task/new'
import { componentSelect } from '@/api/system/sample' import { componentSelect } from '@/api/system/sample'
...@@ -91,235 +100,124 @@ export default { ...@@ -91,235 +100,124 @@ export default {
}, },
data() { data() {
return { return {
model: [ model: [],
{
name: '远控系统包含',
type: 'FormCheckbox',
status: false,
key: '1',
componentProps: {
options: [
{ label: 'cellular', value: '1' },
{ label: 'cellular', value: '1' },
{ label: 'cellular', value: '1' }
]
}
},
{
name: '①授权的第三方应用',
type: 'FormInput',
status: false,
key: '2',
componentProps: {
placeholder: '请输入',
maxlength: 30,
size: 'small',
clearable: true
}
},
{
name: '②授权的第三方应用',
type: 'FormCheckbox',
status: false,
key: '3',
componentProps: {
options: [
{ label: 'cellular', value: '1' },
{ label: 'cellular', value: '1' },
{ label: 'cellular', value: '1' }
]
}
},
{
name: '是否支持APP远程控车',
type: 'FormCheckbox',
status: false,
key: '4',
componentProps: {
options: [
{ label: 'TBOX', value: '1' },
{ label: 'TBOX', value: '1' },
{ label: 'TBOX', value: '1' }
]
}
},
{
name: '②授权的第三方应用',
type: 'FormInput',
status: false,
key: '5',
componentProps: {
placeholder: '请输入',
maxlength: 30,
size: 'small',
clearable: true
}
},
{
name: '外部直接无线通信零部件为(抽样,不包括短距离无线传感器)',
type: 'FormRadio',
status: false,
key: '6',
componentProps: {
options: [
{ label: 'IVI 只具备root/实时操作系统', value: '1' },
{ label: 'IVI 只具备root/实时操作系统', value: '1' },
{ label: 'IVI 只具备root/实时操作系统', value: '1' }
]
}
},
{
name: '车载软件升级系统为***',
type: 'FormCheckInput',
status: false,
key: '7',
componentProps: {
options: [
{ label: '零部件', value: '1' },
{ label: '零部件', value: '1' },
{ label: '零部件', value: '1' }
],
placeholder: '请输入'
}
},
{
name: '车辆内存储VIN等车辆身份识别数据的零部件为(清单中抽选1个)',
type: 'FormRadioCheck',
status: false,
key: '8',
componentProps: {
options: [
{ label: '零部件只具备root/实时操作系统', value: '1' },
{ label: '零部件可提供多用户', value: '2' }
]
}
},
{
name: '车辆内存储VIN等车辆身份识别数据的零部件为(清单中抽选1个)',
type: 'FormInputUpload',
status: false,
key: '9',
componentProps: {
placeholder: '请输入',
maxlength: 30,
size: 'small',
clearable: true
}
},
{
name: '是否支持APP远程控车',
type: 'FormCheckboxUpload',
status: false,
key: '10',
componentProps: {
options: [
{ label: 'TBOX', value: '1' },
{ label: 'TBOX', value: '1' },
{ label: 'TBOX', value: '1' }
]
}
},
{
name: '是否支持APP远程控车',
type: 'FormRadioUpload',
status: false,
key: '11',
componentProps: {
options: [
{ label: 'TBOX', value: '1' },
{ label: 'TBOX', value: '1' },
{ label: 'TBOX', value: '1' }
]
}
}
],
loading: false, loading: false,
form: { form: {
standardId: '1', inspectionStandardId: null,
inspectionItemList: ['trfis'] inspectionItem: []
}, },
inspectionItemList: [], inspectionItem: [],
componentSelect: [], componentSelect: [],
rules: { rules: {
inspectionItemList: [ inspectionItem: [
{ {
type: 'array',
required: true, required: true,
type: 'array',
message: '请至少选择一个检验项目', message: '请至少选择一个检验项目',
trigger: 'change' trigger: 'change'
} }
], ],
standardId: [ inspectionStandardId: [
{ required: true, message: '请选择检验依据', trigger: 'change' } { required: true, message: '请选择检验依据', trigger: 'change' }
], ],
VIN: [{ required: true, message: '请输入VIN', trigger: 'change' }], carModel: [{ required: true, message: '请输入VIN', trigger: 'change' }],
companyId: [ inspectCarCompanyId: [
{ required: true, message: '请选择车企', trigger: 'change' } { required: true, message: '请选择车企', trigger: 'change' }
] ]
} }
} }
}, },
watch: { watch: {
'form.standardId': { 'form.inspectionStandardId': {
handler(newValue, oldValue) { handler(newValue, oldValue) {
if (newValue) { if (newValue) {
this.model.inspectionItemList = [] // this.model.inspectionItem = []
console.log(newValue)
this.getTaskType(newValue) this.getTaskType(newValue)
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.form.clearValidate() this.$refs.form.clearValidate('inspectionItem')
}) })
} }
} }
}, },
'form.inspectionItemList': { 'form.inspectionItem': {
handler(newValue, oldValue) { handler(newValue, oldValue) {
if (newValue !== null) { if (newValue !== null) {
if (newValue.length > 0) { if (newValue.length > 0) {
this.$refs.form.clearValidate('inspectionItemList') this.$refs.form.clearValidate('inspectionItem')
} else { } else {
this.$refs.form.validateField('inspectionItemList') this.$refs.form.validateField('inspectionItem')
} }
} }
} }
} }
}, },
mounted() { mounted() {
this.handleLoad()
this.$store.dispatch('standard/setStandardList') this.$store.dispatch('standard/setStandardList')
this.getTaskType(1)
this.getComponentSelect() this.getComponentSelect()
this.$nextTick(() => {
if (this.$route.query.id !== undefined) {
this.getTaskDetail(this.$route.query.id)
} else {
this.handleLoad()
this.form = {
inspectionStandardId: 1,
inspectionItem: ['trfis']
}
}
})
}, },
computed: { computed: {
...mapGetters(['standardList']) ...mapGetters(['standardList'])
}, },
methods: { methods: {
handleConfirm() { getTaskDetail(id) {
const res = this.$refs.check.getValidate() details({
console.log(res) id
}).then(res => {
if (res.code === 200) {
this.form = res.data
this.form.inspectionItem = this.form.inspectionItem.split(',')
this.model = JSON.parse(res.data.specifyPlan)
this.form.id = undefined
}
})
},
async handleConfirm() {
const res = await this.$refs.check.getValidateVaule()
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
console.log(1) let form = JSON.parse(JSON.stringify(this.form))
form.specifyPlan = JSON.stringify(res.record)
form.useCaseNo = res.codes
form.inspectionItem = form.inspectionItem.join(',')
add(form).then(res => {
if (res.code == 200) {
this.$router.push({
path: '/plan/detail?id=' + res.data
})
}
})
} }
}) })
}, },
handleInspectionItem(item) { handleInspectionItem(item) {
// 查看item.value在this.checkTestScenarioList里面存不存在 // 查看item.value在this.checkTestScenarioList里面存不存在
// 存在则删除 // 存在则删除
if (this.form.inspectionItemList === null) { if (this.form.inspectionItem === null) {
this.form.inspectionItemList = [] this.form.inspectionItem = []
} }
if (this.form.inspectionItemList.includes(item.value)) { if (this.form.inspectionItem.includes(item.value)) {
this.form.inspectionItemList.splice( this.form.inspectionItem.splice(
this.form.inspectionItemList.indexOf(item.value), this.form.inspectionItem.indexOf(item.value),
1 1
) )
item.check = false item.check = false
} else { } else {
item.check = true item.check = true
this.form.inspectionItemList.push(item.value) this.form.inspectionItem.push(item.value)
} }
console.log()
}, },
getComponentSelect() { getComponentSelect() {
componentSelect({ componentSelect({
...@@ -335,17 +233,18 @@ export default { ...@@ -335,17 +233,18 @@ export default {
getByStandardId({ getByStandardId({
id id
}).then(response => { }).then(response => {
this.inspectionItemList = [] this.inspectionItem = []
this.inspectionItemList = response.rows.map( this.inspectionItem = response.rows.map(
({ dictValue, dictLabel, ...rest }, i) => ({ ({ dictValue, dictLabel, ...rest }, i) => ({
label: dictLabel, label: dictLabel,
value: dictValue, value: dictValue,
check: i == 2 ? true : false, check:
this.form.inspectionItem.indexOf(dictValue) != -1 ? true : false,
...rest ...rest
}) })
) )
this.rules.inspectionItemList[0].required = false this.rules.inspectionItem[0].required = false
}) })
}, },
handleLoad() { handleLoad() {
...@@ -360,7 +259,7 @@ export default { ...@@ -360,7 +259,7 @@ export default {
} }
} }
}) })
this.$message.success('加载成功') // this.$message.success('加载成功')
} else { } else {
this.$message.error('加载失败') this.$message.error('加载失败')
} }
......
<template>
<el-dialog
:visible.sync="dialogManger.dialogVisible"
:title="modalTitle"
width="1200"
append-to-body
destroy-on-close
:close-on-click-modal="false"
:before-close="handleClose"
>
<el-form
ref="form"
class="company-form"
label-width="120px"
label-position="top"
:model="model"
:rules="rules"
>
<el-form-item label="企业名称" prop="enterpriseName">
<el-input
v-model="model.enterpriseName"
class="w-100"
placeholder="请输入企业名称"
/>
</el-form-item>
<el-form-item label="企业地址" prop="address">
<el-input
v-model="model.address"
type="textarea"
:rows="4"
maxlength="200"
show-word-limit
placeholder="请输入企业地址"
/>
</el-form-item>
<el-form-item label="企业邮编" prop="postcode">
<el-input v-model="model.postcode" placeholder="请输入企业邮编" />
</el-form-item>
<el-form-item label="企业联系人" prop="enterpriseContact">
<el-input
v-model="model.enterpriseContact"
placeholder="请输入企业联系人"
/>
</el-form-item>
<el-form-item label="联系电话" prop="contactNumber">
<el-input v-model="model.contactNumber" placeholder="请输入联系电话" />
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="handleClose()"> 取消 </el-button>
<el-button type="primary" @click="saveModel()"> 保存 </el-button>
</div>
</el-dialog>
</template>
<script>
export default {
props: {
dialogManger: {
default: () => {
return {
dialogVisible: false,
dialogEditId: null
}
},
type: Object
}
},
data() {
return {
model: this.$modelDataSource({
url: '/system/enterprise',
dataKey: 'model',
attributes: {
address: '',
contactNumber: '',
enterpriseContact: '',
enterpriseName: '',
id: 0,
// params: '',
postcode: ''
// remark: ''
}
}),
rules: {
enterpriseName: [
{ required: true, message: '请输入企业名称', trigger: 'blur' }
],
address: [
{ required: true, message: '请输入企业地址', trigger: 'blur' }
],
postcode: [
{ required: true, message: '请输入企业邮编', trigger: 'blur' }
],
enterpriseContact: [
{ required: true, message: '请输入企业联系人', trigger: 'blur' }
],
contactNumber: [
{ required: true, message: '请输入联系电话', trigger: 'blur' }
]
}
}
},
computed: {
modalTitle() {
if (this.dialogManger.dialogEditId === 0) {
return '新增'
} else {
return '编辑'
}
}
},
watch: {
'dialogManger.dialogEditId'(newValue) {
this.model.fetch(
newValue,
{},
() => {
this.dialogManger.dialogVisible = true
},
() => {
this.$emit('refresh')
}
)
}
},
methods: {
handleClose() {
this.model.reset()
this.dialogManger.dialogEditId = null
this.dialogManger.dialogVisible = false
},
saveModel() {
this.$refs['form'].validate(valid => {
if (valid) {
console.log('表单验证通过')
this.model.save(
() => {
this.$message.success('保存成功')
this.$emit('refresh')
this.handleClose()
},
errors => {
// this.handleClose()
}
)
} else {
console.log('表单验证失败')
}
})
}
}
}
</script>
<template>
<page-standard>
<el-form ref="queryForm" :model="queryParams" size="small" :inline="true">
<template v-if="showSearch">
<el-form-item label="被检车企" prop="inspectCarCompanyId">
<el-select
v-model="queryParams.inspectCarCompanyId"
placeholder="请选择被检车企"
style="width: 100%"
>
<el-option
v-for="item in componentSelect"
:key="item.id"
:label="item.enterpriseName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="车辆VIN号" prop="carModel">
<el-input
v-model="queryParams.carModel"
placeholder="请输入"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>查询</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</template>
<!-- <el-form-item>
<right-toolbar
:show-search.sync="showSearch"
@queryTable="loadData"
></right-toolbar>
</el-form-item> -->
</el-form>
<el-table
v-if="refreshTable"
v-loading="loading"
border
:scroll-x="'1500px'"
:data="tableData"
:default-sort="{ prop: 'createTime', order: 'descending' }"
@sort-change="sort_change"
>
<el-table-column type="index" width="55" label="序号" align="center">
</el-table-column>
<el-table-column
label="被检车企"
show-overflow-tooltip
prop="inspectCarCompanyName"
min-width="200"
align="left"
>
</el-table-column>
<el-table-column
label="车辆VIN号"
show-overflow-tooltip
min-width="200"
prop="carModel"
align="left"
>
</el-table-column>
<el-table-column
label="检测方案生成时间"
show-overflow-tooltip
prop="createTime"
min-width="200"
align="left"
>
</el-table-column>
<el-table-column
label="检测机构"
prop="testOrganizationName"
min-width="200"
align="left"
sortable
>
</el-table-column>
<el-table-column
label="操作"
align="center"
min-width="160"
fixed="right"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<div class="button-bar">
<el-button type="text" @click="goDetail(scope.row.id)">
查看方案</el-button
>
<el-button type="text" @click="handleUpdate(scope.row.id)">
修改</el-button
>
<el-button type="text" @click="handleDelete(scope.row.id)">
删除</el-button
>
<el-upload
v-if="!scope.row.file_url"
ref="fileUpload"
:action="uploadFileUrl"
:limit="1"
:on-success="(res)=>{
handleUploadSuccess(res,scope.row.id)
}"
:show-file-list="false"
:headers="headers"
class="upload-file-uploader"
>
<el-button type="text">上传结果 </el-button>
</el-upload>
<el-button type="text" v-else> 重新上传 </el-button>
</div>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:background="false"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="loadData"
>
</pagination>
<company-dialog
:dialog-manger="dialogManger"
@refresh="refreshList = true"
></company-dialog>
</page-standard>
</template>
<script>
import page from '@/mixins/page'
import { del,update } from '@/api/plan'
import companyDialog from './components/dialog.vue'
export default {
components: {
companyDialog
},
mixins: [page],
data() {
return {
listUrl: '/Plan/Record/page',
uploadFileUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio', // 上传文件服务器地址
componentSelect: [],
showSearch: true,
headers: {
Authorization: 'Bearer ' + this.$store.getters.token
},
view: '',
tableData: [],
dialogManger: {
dialogVisible: false,
dialogEditId: null
},
refreshList: false,
model: this.$modelDataSource({
url: '/Plan/Record/page',
dataKey: 'model',
attributes: {
id: ''
}
})
}
},
watch: {
refreshList(newVal) {
if (newVal) {
this.loadData()
this.refreshList = false
}
}
},
created() {
this.queryParams.isAsc = 'desc'
this.queryParams.orderByColumn = 'createTime'
this.view = this.$route.query.view
},
methods: {
goDetail(id) {
this.$router.push({
path: '/plan/detail?id=' + id
})
},
handleUploadSuccess(res,id) {
update({
id: id,
testResult: res.originalFilename,
fileUrl: res.url
}).then(res => {
if (res.code == 200) {
this.$message.success('上传成功')
this.loadData()
} else {
this.$message.error('上传失败')
}
})
},
resetQuery() {
this.queryParams = {
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize,
isAsc: this.queryParams.isAsc,
orderByColumn: this.queryParams.orderByColumn
}
this.loadData()
},
sort_change(column, prop, order) {
this.queryParams.pageNum = 1 // 排序后返回第一页
if (column.order) {
this.queryParams.isAsc = column.order === 'ascending' ? 'asc' : 'desc'
this.queryParams.orderByColumn = column.prop
this.loadData()
}
},
handleDelete(id) {
this.$modal
.confirm('是否确定删除该条数据?', {
type: 'warning',
title: '删除',
closeOnClickModal: false
})
.then(() => {
del({
id: id
}).then(() => {
this.refreshList = true
this.$message.success('删除成功')
})
})
.catch(() => {})
},
handleUpdate(id) {
this.$router.push({
path: '/plan/customized?id=' + id
})
},
getComponentSelect() {
componentSelect({
pageNum: 1,
pageSize: 9999,
isAsc: 'desc',
orderByColumn: 'createTime'
}).then(res => {
this.componentSelect = res.rows
})
}
}
}
</script>
...@@ -38,6 +38,7 @@ module.exports = { ...@@ -38,6 +38,7 @@ module.exports = {
// target: `http://106.3.99.64:22016`, // target: `http://106.3.99.64:22016`,
// target: `http://192.168.10.171:22032`, // target: `http://192.168.10.171:22032`,
// target: `http://10.11.77.251:22008`,
target: `http://10.11.79.113:22008`, target: `http://10.11.79.113:22008`,
// target: `http://10.11.79.113/prod-api`, // target: `http://10.11.79.113/prod-api`,
// target: `http://10.11.77.182:22016`, // target: `http://10.11.77.182:22016`,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment