Commit 40eff0bb authored by jiaxu.yan's avatar jiaxu.yan

Merge branch 'develop' of http://gitlab.91isoft.com:90/car-test/web into developer/yanjiaxu

# Conflicts:
#	src/utils/ModelDataSource.js
#	src/views/setting/standardTerms/components/vehicleModelDialog.vue
#	src/views/setting/testMatrix/index.vue
parents 5b70c2c7 ed7b7171
...@@ -2,18 +2,18 @@ import request from '@/utils/request' ...@@ -2,18 +2,18 @@ import request from '@/utils/request'
// 体系审查、车型审查检验内容列表 // 体系审查、车型审查检验内容列表
export function listInspection(data) { export function listInspection(data) {
return request({ return request({
url: '/review/standard/getInspectionContent', url: '/review/standard/getInspectionContent',
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 文档审查检验内容列表 // 文档审查检验内容列表
export function listDocumentReview(data) { export function listDocumentReview(data) {
return request({ return request({
url: '/review/standard/test/getInspectionContent', url: '/review/standard/test/getInspectionContent',
method: 'post', method: 'post',
data: data data: data
}) })
} }
import request from '@/utils/request' import request from '@/utils/request'
export function listMatrix(data) { export function listMatrix(data) {
return request({ return request({
url: '/usecase/matrix/getInfo', url: '/usecase/matrix/getInfo',
method: 'post', method: 'post',
data: data data: data
}) })
} }
import request from '@/utils/request' import request from '@/utils/request'
//获取任务详情 //获取任务详情
export function taskDetail(data) { export function taskDetail(data) {
return request({ return request({
......
...@@ -115,4 +115,3 @@ ...@@ -115,4 +115,3 @@
top: 20px; top: 20px;
transform: translateX(100%); transform: translateX(100%);
} }
...@@ -17,25 +17,23 @@ ...@@ -17,25 +17,23 @@
<!-- 上传按钮 --> <!-- 上传按钮 -->
<el-button size="mini" type="primary">选取文件</el-button> <el-button size="mini" type="primary">选取文件</el-button>
<!-- 上传提示 --> <!-- 上传提示 -->
<!-- <div class="el-upload__tip" slot="tip" v-if="showTip">--> <!-- <div class="el-upload__tip" slot="tip" v-if="showTip">-->
<!-- 请上传--> <!-- 请上传-->
<!-- <template v-if="fileSize">--> <!-- <template v-if="fileSize">-->
<!-- 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>--> <!-- 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>-->
<!-- </template>--> <!-- </template>-->
<!-- <template v-if="fileType">--> <!-- <template v-if="fileType">-->
<!-- 格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>--> <!-- 格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>-->
<!-- </template>--> <!-- </template>-->
<!-- 的文件--> <!-- 的文件-->
<!-- </div>--> <!-- </div>-->
<div class="el-upload__tip" slot="tip" v-if="showTip"> <div class="el-upload__tip" slot="tip" v-if="showTip">
只能上传 只能上传
<template v-if="fileType"> <template v-if="fileType">
{{ fileType.join('/') }} {{ fileType.join('/') }}
</template> </template>
文件, 文件,
<template v-if="fileSize"> <template v-if="fileSize"> 且不得超过{{ fileSize }}MB </template>
且不得超过{{ fileSize }}MB
</template>
</div> </div>
</el-upload> </el-upload>
......
...@@ -22,16 +22,16 @@ ...@@ -22,16 +22,16 @@
</el-upload> </el-upload>
<!-- 上传提示 --> <!-- 上传提示 -->
<!-- <div class="el-upload__tip" slot="tip" v-if="showTip">--> <!-- <div class="el-upload__tip" slot="tip" v-if="showTip">-->
<!-- 请上传--> <!-- 请上传-->
<!-- <template v-if="fileSize">--> <!-- <template v-if="fileSize">-->
<!-- 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>--> <!-- 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>-->
<!-- </template>--> <!-- </template>-->
<!-- <template v-if="fileType">--> <!-- <template v-if="fileType">-->
<!-- 格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>--> <!-- 格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>-->
<!-- </template>--> <!-- </template>-->
<!-- 的文件--> <!-- 的文件-->
<!-- </div>--> <!-- </div>-->
<div class="el-upload__tip" slot="tip" v-if="showTip"> <div class="el-upload__tip" slot="tip" v-if="showTip">
只能上传 只能上传
...@@ -39,16 +39,10 @@ ...@@ -39,16 +39,10 @@
{{ fileType.join('/') }} {{ fileType.join('/') }}
</template> </template>
文件, 文件,
<template v-if="fileSize"> <template v-if="fileSize"> 且不得超过{{ fileSize }}MB </template>
且不得超过{{ fileSize }}MB
</template>
</div> </div>
<el-dialog <el-dialog :visible.sync="dialogVisible" width="800" append-to-body>
:visible.sync="dialogVisible"
width="800"
append-to-body
>
<img <img
:src="dialogImageUrl" :src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto" style="display: block; max-width: 100%; margin: 0 auto"
......
...@@ -216,5 +216,4 @@ export default { ...@@ -216,5 +216,4 @@ export default {
border: 1px solid #1a6fd7; border: 1px solid #1a6fd7;
color: #1a6fd7; color: #1a6fd7;
} }
</style> </style>
...@@ -213,5 +213,4 @@ export default { ...@@ -213,5 +213,4 @@ export default {
border: 1px solid #1a6fd7; border: 1px solid #1a6fd7;
color: #1a6fd7; color: #1a6fd7;
} }
</style> </style>
...@@ -117,7 +117,7 @@ export default { ...@@ -117,7 +117,7 @@ export default {
list-style-type: none; list-style-type: none;
margin-top: 5px; margin-top: 5px;
padding: 0; padding: 0;
width:100%; width: 100%;
li { li {
margin: 10px 0; margin: 10px 0;
cursor: pointer; cursor: pointer;
......
...@@ -100,7 +100,7 @@ Vue.component('FooterButton', FooterButton) ...@@ -100,7 +100,7 @@ Vue.component('FooterButton', FooterButton)
Vue.use(directive) Vue.use(directive)
Vue.use(plugins) Vue.use(plugins)
Vue.use(VueMeta) Vue.use(VueMeta)
import ModelDataSource from './utils/ModelDataSource'; import ModelDataSource from './utils/ModelDataSource'
Vue.use(ModelDataSource) Vue.use(ModelDataSource)
DictData.install() DictData.install()
......
...@@ -2,166 +2,164 @@ ...@@ -2,166 +2,164 @@
* Model 数据源 * Model 数据源
* 用于 单条记录的增删查改 * 用于 单条记录的增删查改
*/ */
import _ from "lodash" import _ from 'lodash'
import request from "@/utils/request" import request from '@/utils/request'
function ModelDataSource(vm, settings) { function ModelDataSource(vm, settings) {
this.vm = vm this.vm = vm
this.settings = settings this.settings = settings
this.errors = {} this.errors = {}
this.debug = true this.debug = true
// this.dataKey = settings. // this.dataKey = settings.
// this.defaultAttributes = settings.attributes; // this.defaultAttributes = settings.attributes;
this.init() this.init()
} }
ModelDataSource.prototype = { ModelDataSource.prototype = {
vm: null, vm: null,
settings: null, settings: null,
uuid: 0, uuid: 0,
init: function () { init: function () {
let self = this let self = this
_.assign(self, self.settings.attributes) _.assign(self, self.settings.attributes)
_.assignInWith(self.errors, self.settings.attributes, () => { _.assignInWith(self.errors, self.settings.attributes, () => {
return '' return ''
}) })
}, },
/** /**
* Fetch * Fetch
* *
* @param id * @param id
* @param successCallback * @param successCallback
* @param failedCallback * @param failedCallback
*/ */
fetch: function ( fetch: function (
uuid = 0, uuid = 0,
params = {}, params = {},
successCallback = function () {}, successCallback = function () {},
failedCallback = function () {} failedCallback = function () {}
) { ) {
let self = this let self = this
let url = self.settings.url let url = self.settings.url
self.uuid = uuid self.uuid = uuid
if (uuid == 0 || uuid == null) { if (uuid == 0 || uuid == null) {
self.reset() self.reset()
} else { } else {
params.id = uuid params.id = uuid
request({
url: url + '/getById',
method: 'post',
data: params
})
.then(function (response) {
console.log(response)
if (response.data) {
for (let key in response.data) {
self[key] = response.data[key]
}
} else {
for (let key in response.data) {
self[key] = response.data[key]
}
}
successCallback()
})
.catch(function (error) {
failedCallback()
})
}
},
/**
* 保存model
* @param successCallback
* @param failedCallback
*/
save: function (
successCallback = function () {},
failedCallback = function () {}
) {
let self = this
let url = ''
if (self.uuid == 0) {
url = self.settings.url + '/add'
delete self.id
} else {
url = self.settings.url + '/edit'
}
request({ request({
url, url: url + '/getById',
method: 'post', method: 'post',
data: _.omit(self, ['vm', 'settings', 'errors', 'debug']) data: params
}) })
.then(function (response) { .then(function (response) {
successCallback(response) successCallback(response)
}) })
.catch(function (error) { .catch(function (error) {
// console.log(error.response) failedCallback()
// if (error.response) {
// _.forEach(error.response.data, function (value, key) {
// typeof value === 'object' && self.vm.$set(self.vm[self.settings.dataKey].errors, key, value[0]);
// typeof value === 'string' && self.vm.$set(self.vm[self.settings.dataKey].errors, key, value);
// });
// } else {
// // Something happened in setting up the request that triggered an Error
// self.debug && console.log(error);
// }
failedCallback(error)
}) })
}, }
/** },
* 删除model
* @param id
*/
/** /**
* * 保存model
* @param successCallback * @param successCallback
* @param failedCallback * @param failedCallback
*/ */
destroy: function ( save: function (
successCallback = function () {}, successCallback = function () {},
failedCallback = function () {} failedCallback = function () {}
) { ) {
let self = this let self = this
request({ let url = ''
url: self.settings.url + '/remove', if (self.uuid == 0) {
method: 'post', url = self.settings.url + '/add'
data: { delete self.id
ids: [self.uuid] } else {
url = self.settings.url + '/edit'
}
request({
url,
method: 'post',
data: _.omit(self, ['vm', 'settings', 'errors', 'debug'])
})
.then(function (response) {
if (response.data) {
for (let key in response.data) {
self[key] = response.data[key]
}
} else {
for (let key in response.data) {
self[key] = response.data[key]
}
} }
successCallback()
}) })
.then(function (response) { .catch(function (error) {
successCallback() // console.log(error.response)
}) // if (error.response) {
.catch(function (error) { // _.forEach(error.response.data, function (value, key) {
// Something happened in setting up the request that triggered an Error // typeof value === 'object' && self.vm.$set(self.vm[self.settings.dataKey].errors, key, value[0]);
self.debug && console.log('Error', error.message) // typeof value === 'string' && self.vm.$set(self.vm[self.settings.dataKey].errors, key, value);
failedCallback(error) // });
}) // } else {
}, // // Something happened in setting up the request that triggered an Error
// self.debug && console.log(error);
// }
failedCallback(error)
})
},
/**
* 删除model
* @param id
*/
/** /**
* 重置model 为默认值 *
* @param id * @param successCallback
*/ * @param failedCallback
reset: function () { */
let self = this destroy: function (
_.assign(self, self.settings.attributes) successCallback = function () {},
_.assignInWith(self.errors, self.settings.attributes, () => { failedCallback = function () {}
return '' ) {
let self = this
request({
url: self.settings.url + '/remove',
method: 'post',
data: {
ids: [self.uuid]
}
})
.then(function (response) {
successCallback()
}) })
} .catch(function (error) {
} // Something happened in setting up the request that triggered an Error
self.debug && console.log('Error', error.message)
failedCallback(error)
})
},
/** /**
* Vue Plugin * 重置model 为默认值
* @param id
*/ */
ModelDataSource.install = function (Vue) { reset: function () {
Vue.prototype.$modelDataSource = function (options) { let self = this
console.log(this, options); _.assign(self, self.settings.attributes)
return new ModelDataSource(this, options) _.assignInWith(self.errors, self.settings.attributes, () => {
} return ''
})
}
}
/**
* Vue Plugin
*/
ModelDataSource.install = function (Vue) {
Vue.prototype.$modelDataSource = function (options) {
console.log(this, options)
return new ModelDataSource(this, options)
} }
}
export default ModelDataSource export default ModelDataSource
...@@ -64,10 +64,10 @@ ...@@ -64,10 +64,10 @@
>新建</el-button >新建</el-button
> >
</el-col> </el-col>
<right-toolbar <!-- <right-toolbar-->
:show-search.sync="showSearch" <!-- :show-search.sync="showSearch"-->
@queryTable="getList" <!-- @queryTable="getList"-->
></right-toolbar> <!-- ></right-toolbar>-->
</el-row> </el-row>
<el-table <el-table
...@@ -328,18 +328,24 @@ ...@@ -328,18 +328,24 @@
label-width="100px" label-width="100px"
> >
<el-form-item label="商标:" prop="trademark"> <el-form-item label="商标:" prop="trademark">
<image-preview <div v-if="clickNameForm.trademark">
:src="clickNameForm.trademark" <image-preview
width="150px" :src="clickNameForm.trademark"
height="150px" width="150px"
></image-preview> height="150px"
></image-preview>
</div>
<div v-else>暂无数据</div>
</el-form-item> </el-form-item>
<el-form-item label="样品照片:" prop="samplePhotos"> <el-form-item label="样品照片:" prop="samplePhotos">
<image-preview <div v-if="clickNameForm.samplePhotos">
:src="clickNameForm.samplePhotos" <image-preview
width="150px" :src="clickNameForm.samplePhotos"
height="150px" width="150px"
></image-preview> height="150px"
></image-preview>
</div>
<div v-else>暂无数据</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
......
...@@ -50,12 +50,12 @@ ...@@ -50,12 +50,12 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div> <!-- <div>-->
<right-toolbar <!-- <right-toolbar-->
:show-search.sync="showSearch" <!-- :show-search.sync="showSearch"-->
@queryTable="loadData" <!-- @queryTable="loadData"-->
></right-toolbar> <!-- ></right-toolbar>-->
</div> <!-- </div>-->
</div> </div>
<el-table <el-table
v-if="refreshTable" v-if="refreshTable"
...@@ -93,7 +93,6 @@ ...@@ -93,7 +93,6 @@
label="测试场景" label="测试场景"
prop="testScenario" prop="testScenario"
min-width="200" min-width="200"
sortable
align="left" align="left"
> >
</el-table-column> </el-table-column>
......
<template> <template>
<el-dialog <el-dialog
:visible.sync="dialogManger.dialogVisible" :visible.sync="dialogManger.dialogVisible"
:title="modelTitle" title="修改"
width="1200" width="1200"
append-to-body append-to-body
destroy-on-close destroy-on-close
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<el-form-item label="标准分类" prop="standardType"> <el-form-item label="标准分类" prop="standardType">
<el-select <el-select
v-model="model.standardType" v-model="model.standardType"
disabled
style="width: 100%" style="width: 100%"
placeholder="请选择" placeholder="请选择"
clearable clearable
...@@ -96,7 +97,7 @@ export default { ...@@ -96,7 +97,7 @@ export default {
data() { data() {
return { return {
model: this.$modelDataSource({ model: this.$modelDataSource({
url: '/standard/getInfo', url: '/standard',
dataKey: 'model', dataKey: 'model',
attributes: { attributes: {
standardType: '', standardType: '',
...@@ -129,11 +130,11 @@ export default { ...@@ -129,11 +130,11 @@ export default {
} }
} }
}, },
computed: { // computed: {
modelTitle() { // modelTitle() {
return this.dialogManger.dialogEditId ? '编辑标准' : '新增标准' // return this.dialogManger.dialogEditId ? '编辑标准' : '新增标准'
} // }
}, // },
watch: { watch: {
'dialogManger.dialogEditId'(newValue) { 'dialogManger.dialogEditId'(newValue) {
this.model.fetch( this.model.fetch(
......
...@@ -20,16 +20,16 @@ ...@@ -20,16 +20,16 @@
prop="standardType" prop="standardType"
align="left" align="left"
> >
<!-- <template slot-scope="scope">--> <template slot-scope="scope">
<!-- <div v-for="dict in classFicationList" :key="dict.dictValue">--> <div v-for="dict in classFicationList" :key="dict.dictValue">
<!-- <div--> <div
<!-- v-if="dict.dictValue == scope.row.standardType"--> v-if="dict.dictValue == scope.row.standardType"
<!-- style="display: flex"--> style="display: flex"
<!-- >--> >
<!-- {{ dict.dictLabel }}--> {{ dict.dictLabel }}
<!-- </div>--> </div>
<!-- </div>--> </div>
<!-- </template>--> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="standardNo" prop="standardNo"
...@@ -43,7 +43,13 @@ ...@@ -43,7 +43,13 @@
label="标准名称" label="标准名称"
min-width="200" min-width="200"
align="left" align="left"
/> >
<template slot-scope="scope">
<div class="font-color" @click="downPdf(scope.row)">
{{ scope.row.name }}
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
prop="standardStatus" prop="standardStatus"
label="标准状态" label="标准状态"
...@@ -116,6 +122,7 @@ ...@@ -116,6 +122,7 @@
ref="TixiDialog" ref="TixiDialog"
:dialog-manger="TixiDialogManger" :dialog-manger="TixiDialogManger"
@close="TixiDialogManger.dialogVisible = false" @close="TixiDialogManger.dialogVisible = false"
@refresh="TixiDialogManger.refreshList = true"
></tixi-dialog> ></tixi-dialog>
</page-standard> </page-standard>
</template> </template>
...@@ -163,6 +170,10 @@ export default { ...@@ -163,6 +170,10 @@ export default {
}) })
}, },
methods: { methods: {
downPdf(row) {
console.log('row', row)
window.open(process.env.VUE_APP_IMAGE_API + row.file)
},
viewTemplate() { viewTemplate() {
// this.$router.push({ // this.$router.push({
// path: '/processing/reviewReport' // path: '/processing/reviewReport'
...@@ -199,7 +210,7 @@ export default { ...@@ -199,7 +210,7 @@ export default {
<style scoped> <style scoped>
.font-color { .font-color {
text-decoration: underline; text-decoration: underline;
color: #1890ff; color: #1a6fd7;
cursor: pointer; cursor: pointer;
} }
</style> </style>
...@@ -17,20 +17,27 @@ ...@@ -17,20 +17,27 @@
<tbody> <tbody>
<!-- 循环遍历 keyPointList --> <!-- 循环遍历 keyPointList -->
<template v-for="(i, PointIndex) in tableData.keyPointList"> <template v-for="(i, PointIndex) in tableData.keyPointList">
<tr :key="'PointIndex-2' + PointIndex"> <tr :key="'PointIndex' + PointIndex">
<td align="center" :rowspan="getRows(i)"> <td align="center" :rowspan="getRows(i)">
{{ i.text }} {{ i.text }}
</td> </td>
</tr> </tr>
<!-- 循环遍历 reviewDetailsList --> <!-- 循环遍历 reviewDetailsList -->
<template v-for="(v, reviewDetailIndex) in i.reviewDetailsList"> <template v-for="(v, reviewDetailIndex) in i.reviewDetailsList">
<tr :key="'reviewDetailIndex-3' + PointIndex + reviewDetailIndex"> <tr :key="'reviewDetailIndex' + PointIndex + reviewDetailIndex">
<td align="center"> <td align="center">
{{ v.text }} {{ v.text }}
</td> </td>
<td align="center"> <td align="center">
<template v-for="(a, reviewSceneIndex) in v.reviewSceneList"> <template v-for="(a, reviewSceneIndex) in v.reviewSceneList">
<div :key="'reviewSceneIndex-3' + reviewSceneIndex"> <div
:key="
'reviewSceneIndex' +
PointIndex +
reviewDetailIndex +
reviewSceneIndex
"
>
<span>{{ a.text }}</span> <span>{{ a.text }}</span>
<br /> <br />
</div> </div>
......
...@@ -54,12 +54,12 @@ ...@@ -54,12 +54,12 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div> <!-- <div>-->
<right-toolbar <!-- <right-toolbar-->
:show-search.sync="showSearch" <!-- :show-search.sync="showSearch"-->
@queryTable="loadData" <!-- @queryTable="loadData"-->
></right-toolbar> <!-- ></right-toolbar>-->
</div> <!-- </div>-->
</div> </div>
<el-table <el-table
v-loading="loading" v-loading="loading"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<page-standard> <page-standard>
<el-table <el-table
v-loading="loading" v-loading="loading"
height="calc(100vh - 300px)" height="calc(100vh - 135px)"
:data="tableData" :data="tableData"
border border
:header-cell-style="headerCellStyle" :header-cell-style="headerCellStyle"
...@@ -215,8 +215,8 @@ export default { ...@@ -215,8 +215,8 @@ export default {
} }
} else { } else {
cell.style.backgroundColor = '#F3F8FD' cell.style.backgroundColor = '#F3F8FD'
for (var v = 1; v < selrange.length; v++) { for (var a = 1; a < selrange.length; a++) {
selrange[v].style.backgroundColor = '#F3F8FD' selrange[a].style.backgroundColor = '#F3F8FD'
} }
} }
} }
......
...@@ -50,12 +50,12 @@ ...@@ -50,12 +50,12 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div> <!-- <div>-->
<right-toolbar <!-- <right-toolbar-->
:show-search.sync="showSearch" <!-- :show-search.sync="showSearch"-->
@queryTable="loadData" <!-- @queryTable="loadData"-->
></right-toolbar> <!-- ></right-toolbar>-->
</div> <!-- </div>-->
</div> </div>
<el-table <el-table
v-if="refreshTable" v-if="refreshTable"
...@@ -93,7 +93,6 @@ ...@@ -93,7 +93,6 @@
label="测试类型" label="测试类型"
prop="testType" prop="testType"
min-width="200" min-width="200"
sortable
align="left" align="left"
> >
</el-table-column> </el-table-column>
......
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