Commit 33f759d2 authored by jiaxu.yan's avatar jiaxu.yan

Merge branch 'developer/gaixiankang' into develop

parents 9cf6b1fc bc3ac6f2
import request from '@/utils/request'
import { parseStrEmpty } from '@/utils/ruoyi'
// 通过角色名查询用户
export function getUserByRole(data) {
return request({
url: '/system/user/getUserByRole',
method: 'post',
data: data
})
}
// 查询用户列表
export function listUser(query) {
return request({
......
......@@ -128,3 +128,11 @@ export function carReviewTaskConfirm(data) {
data
})
}
export function createTask(data) {
return request({
url: '/task/createTask',
method: 'post',
data
})
}
......@@ -12,27 +12,33 @@
<el-form label-position="top">
<el-form-item label="车辆识别码(VIN)">
<el-select v-model="card.code" clearable>
<el-select
v-model="card.identificationCode"
@change="handleIdentificationCodeChange(card, $event)"
>
<el-option
key="1"
value="1"
label="汽车整车信息安全技术要求"
></el-option>
<el-option key="2" value="2" label="xxxxx软件升级要求"></el-option>
v-for="(item, index) in vehicleSampleInformation"
:key="index"
:label="item.identificationCode"
:value="item.identificationCode"
/>
</el-select>
</el-form-item>
<el-form-item label="样品编号">
<el-select v-model="card.number" clearable>
<el-select
v-model="card.sampleNumber"
@change="handleSampleNumberChange(card, $event)"
>
<el-option
key="1"
value="1"
label="汽车整车信息安全技术要求"
></el-option>
<el-option key="2" value="2" label="xxxxx软件升级要求"></el-option>
v-for="(item, index) in vehicleSampleInformation"
:key="index"
:label="item.sampleNumber"
:value="item.sampleNumber"
/>
</el-select>
</el-form-item>
<el-form-item label="样品名称">
<el-input v-model="card.name" disabled />
<el-input v-model="card.sampleName" disabled />
</el-form-item>
</el-form>
</el-card>
......@@ -53,20 +59,62 @@ export default {
cards: {
type: Array,
default: () => []
},
vehicleSampleInformation: {
type: Array,
default: () => []
}
},
watch: {
cards: {
handler(newValue, oldValue) {
this.emitChange()
},
deep: true
}
},
created() {
console.log('cardssss', this.cards)
},
methods: {
// 车辆识别码(VIN)下拉框选择后回调
handleIdentificationCodeChange(card, value) {
// 通过车辆识别码查找对象
const obj = this.vehicleSampleInformation.find(
item => item.identificationCode === value
)
card.sampleNumber = obj.sampleNumber
card.sampleName = obj.sampleName
card.sampleId = obj.id
card.flag = 0
},
// 样品编号下拉框选择后回调
handleSampleNumberChange(card, value) {
// 通过样品编号查找对象
const obj = this.vehicleSampleInformation.find(
item => item.sampleNumber === value
)
card.identificationCode = obj.identificationCode
card.sampleName = obj.sampleName
card.sampleId = obj.id
card.flag = 0
},
addCard() {
this.cards.push({
code: '',
number: '',
name: ''
})
this.emitChange()
// 新增一个新的整车样品信息做判断
if (this.cards[this.cards.length - 1].sampleName === '') {
this.$message.error('请先填写上一面的信息')
} else {
this.cards.push({
flag: 0,
sampleId: '', // 样品编号id
identificationCode: '',
sampleNumber: '',
sampleName: ''
})
}
},
removeCard(index) {
this.cards.splice(index, 1)
this.emitChange()
},
emitChange() {
this.$emit('change', this.cards)
......@@ -81,13 +129,15 @@ export default {
justify-content: flex-start;
flex-wrap: wrap;
.box-card {
width: 500px;
//width: 500px;
width: 450px;
height: 277px;
margin-bottom: 20px;
margin-right: 40px;
//margin-right: 40px;
margin-right: 32px;
}
.box-card-add {
width: 500px;
width: 450px;
height: 277px;
background: #f3f8fd;
border: 2px dashed #d9d9d9;
......@@ -101,7 +151,7 @@ export default {
}
.box-card,
.box-card-add {
flex: 0 0 500px; // 不允许子元素在主轴方向上伸缩
flex: 0 0 450px; // 不允许子元素在主轴方向上伸缩
height: 277px;
}
.select-group {
......@@ -113,7 +163,8 @@ export default {
}
::v-deep.el-select,
.el-input {
width: 463.44px;
//width: 463.44px;
width: 400px;
}
::v-deep.el-form-item {
margin-bottom: 0;
......
......@@ -12,17 +12,20 @@
<el-form label-position="top">
<el-form-item label="样品编号">
<el-select v-model="card.number" clearable>
<el-select
v-model="card.sampleNumber"
@change="handleSampleNumberChange(card, $event)"
>
<el-option
key="1"
value="1"
label="汽车整车信息安全技术要求"
></el-option>
<el-option key="2" value="2" label="xxxxx软件升级要求"></el-option>
v-for="(item, index) in partSampleInformation"
:key="index"
:label="item.sampleNumber"
:value="item.sampleNumber"
/>
</el-select>
</el-form-item>
<el-form-item label="样品名称">
<el-input v-model="card.name" disabled />
<el-input v-model="card.sampleName" disabled />
</el-form-item>
</el-form>
</el-card>
......@@ -43,20 +46,45 @@ export default {
cards: {
type: Array,
default: () => []
},
partSampleInformation: {
type: Array,
default: () => []
}
},
watch: {
cards: {
handler(newValue, oldValue) {
this.emitChange()
},
deep: true
}
},
methods: {
// 样品编号下拉框选择后回调
handleSampleNumberChange(card, value) {
// 通过样品编号查找对象
const obj = this.partSampleInformation.find(
item => item.sampleNumber === value
)
card.sampleName = obj.sampleName
card.sampleId = obj.id
card.flag = 1
},
addCard() {
this.cards.push({
code: '',
number: '',
name: ''
})
this.emitChange()
if (this.cards[this.cards.length - 1].sampleName === '') {
this.$message.error('请先填写上一面的信息')
} else {
this.cards.push({
flag: 1,
sampleId: '', // 样品编号id
sampleNumber: '', // 样品编号
sampleName: '' // 样品名称
})
}
},
removeCard(index) {
this.cards.splice(index, 1)
this.emitChange()
},
emitChange() {
this.$emit('change', this.cards)
......@@ -71,12 +99,14 @@ export default {
justify-content: flex-start;
flex-wrap: wrap;
.box-card {
width: 500px;
width: 450px;
margin-bottom: 20px;
margin-right: 40px;
//margin-right: 40px;
margin-right: 32px;
}
.box-card-add {
width: 500px;
//width: 500px;
width: 450px;
background: #f3f8fd;
border: 2px dashed #d9d9d9;
border-radius: 4px;
......@@ -89,7 +119,7 @@ export default {
}
.box-card,
.box-card-add {
flex: 0 0 500px; // 不允许子元素在主轴方向上伸缩
flex: 0 0 450px; // 不允许子元素在主轴方向上伸缩
height: 201px;
}
.select-group {
......@@ -101,7 +131,8 @@ export default {
}
::v-deep.el-select,
.el-input {
width: 463.44px;
//width: 463.44px;
width: 400px;
}
::v-deep.el-form-item {
margin-bottom: 0;
......
This diff is collapsed.
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