|
@@ -5,6 +5,9 @@
|
|
:dataSource="model.list"
|
|
:dataSource="model.list"
|
|
:pagination="false"
|
|
:pagination="false"
|
|
:customRow="clickThenCheck"
|
|
:customRow="clickThenCheck"
|
|
|
|
+ ref="table"
|
|
|
|
+ bordered
|
|
|
|
+ class="u-edit-table"
|
|
>
|
|
>
|
|
|
|
|
|
|
|
|
|
@@ -43,7 +46,7 @@
|
|
<!-- 为了解决下拉框显示不全的问题,原来的没有对应参数配置 -->
|
|
<!-- 为了解决下拉框显示不全的问题,原来的没有对应参数配置 -->
|
|
<a-select
|
|
<a-select
|
|
:disabled="formDisabled"
|
|
:disabled="formDisabled"
|
|
- v-model="record.standardRequirement"
|
|
|
|
|
|
+ v-model="record.standardRequirementQ"
|
|
allowClear
|
|
allowClear
|
|
optionFilterProp="label"
|
|
optionFilterProp="label"
|
|
:dropdownMatchSelectWidth="false"
|
|
:dropdownMatchSelectWidth="false"
|
|
@@ -151,7 +154,7 @@ export default {
|
|
dataIndex: 'yangpinKeyId',
|
|
dataIndex: 'yangpinKeyId',
|
|
key: 'yangpinKeyId',
|
|
key: 'yangpinKeyId',
|
|
align: 'center',
|
|
align: 'center',
|
|
- width: '15%',
|
|
|
|
|
|
+ width: '12%',
|
|
scopedSlots: { customRender: 'yangpinKeyId' }
|
|
scopedSlots: { customRender: 'yangpinKeyId' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -159,7 +162,7 @@ export default {
|
|
dataIndex: 'sampleModelSpecification',
|
|
dataIndex: 'sampleModelSpecification',
|
|
key: 'sampleModelSpecification',
|
|
key: 'sampleModelSpecification',
|
|
align: 'center',
|
|
align: 'center',
|
|
- width: '15%',
|
|
|
|
|
|
+ width: '12%',
|
|
scopedSlots: { customRender: 'sampleModelSpecification' }
|
|
scopedSlots: { customRender: 'sampleModelSpecification' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -167,7 +170,7 @@ export default {
|
|
dataIndex: 'testItems',
|
|
dataIndex: 'testItems',
|
|
key: 'testItems',
|
|
key: 'testItems',
|
|
align: 'center',
|
|
align: 'center',
|
|
- width: '15%',
|
|
|
|
|
|
+ width: '12%',
|
|
scopedSlots: { customRender: 'testItems' }
|
|
scopedSlots: { customRender: 'testItems' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -175,7 +178,7 @@ export default {
|
|
dataIndex: 'standardRequirement',
|
|
dataIndex: 'standardRequirement',
|
|
key: 'standardRequirement',
|
|
key: 'standardRequirement',
|
|
align: 'center',
|
|
align: 'center',
|
|
- width: '20%',
|
|
|
|
|
|
+ width: '15%',
|
|
scopedSlots: { customRender: 'standardRequirement' }
|
|
scopedSlots: { customRender: 'standardRequirement' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -183,14 +186,14 @@ export default {
|
|
dataIndex: 'judgementBasis',
|
|
dataIndex: 'judgementBasis',
|
|
key: 'judgementBasis',
|
|
key: 'judgementBasis',
|
|
align: 'center',
|
|
align: 'center',
|
|
- width: '25%',
|
|
|
|
|
|
+ width: '15%',
|
|
scopedSlots: { customRender: 'judgementBasis' }
|
|
scopedSlots: { customRender: 'judgementBasis' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '检测依据文件',
|
|
title: '检测依据文件',
|
|
dataIndex: 'yijufile',
|
|
dataIndex: 'yijufile',
|
|
key: 'yijufile',
|
|
key: 'yijufile',
|
|
- width: '15%',
|
|
|
|
|
|
+ width: '12%',
|
|
align: 'center',
|
|
align: 'center',
|
|
scopedSlots: { customRender: 'yijufile' }
|
|
scopedSlots: { customRender: 'yijufile' }
|
|
},
|
|
},
|
|
@@ -199,7 +202,7 @@ export default {
|
|
title: '备注',
|
|
title: '备注',
|
|
dataIndex: 'beizhu',
|
|
dataIndex: 'beizhu',
|
|
key: 'beizhu',
|
|
key: 'beizhu',
|
|
- width: '15%',
|
|
|
|
|
|
+ width: '7%',
|
|
align: 'center',
|
|
align: 'center',
|
|
scopedSlots: { customRender: 'beizhu' }
|
|
scopedSlots: { customRender: 'beizhu' }
|
|
},
|
|
},
|
|
@@ -207,6 +210,7 @@ export default {
|
|
title: '操作',
|
|
title: '操作',
|
|
key: 'action',
|
|
key: 'action',
|
|
align: 'center',
|
|
align: 'center',
|
|
|
|
+ width: '5%',
|
|
scopedSlots: { customRender: 'operation' }
|
|
scopedSlots: { customRender: 'operation' }
|
|
}
|
|
}
|
|
],
|
|
],
|
|
@@ -216,29 +220,48 @@ export default {
|
|
computed: {
|
|
computed: {
|
|
formDisabled() {
|
|
formDisabled() {
|
|
return this.disabled
|
|
return this.disabled
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ yangpinInfos() {
|
|
|
|
+ return this.$store.getters.yangpinInfos
|
|
|
|
+ },
|
|
|
|
+ shiyanInfos() {
|
|
|
|
+ return this.$store.getters.shiyanInfos
|
|
|
|
+ },
|
|
|
|
+ // count() {
|
|
|
|
+ // return this.$store.getters.countSy
|
|
|
|
+ // },
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.getYijuLists()
|
|
this.getYijuLists()
|
|
- console.log(JSON.parse(sessionStorage.getItem('yangpin')))
|
|
|
|
- console.log(JSON.parse(sessionStorage.getItem('yangpinkz')))
|
|
|
|
- const data = JSON.parse(sessionStorage.getItem('yangpinkz'))
|
|
|
|
- if (data != null) {
|
|
|
|
- this.model.list=data
|
|
|
|
-
|
|
|
|
|
|
+ // console.log(JSON.parse(sessionStorage.getItem('yangpin')))
|
|
|
|
+ // console.log(JSON.parse(sessionStorage.getItem('yangpinkz')))
|
|
|
|
+ // const data = JSON.parse(sessionStorage.getItem('yangpinkz'))
|
|
|
|
+ if (this.shiyanInfos.length > 0) {
|
|
|
|
+ this.model.list = this.shiyanInfos.map((item, index) => {
|
|
|
|
+ // console.log(!item.standardRequirement)
|
|
|
|
+ // console.log(item.standardRequirement)
|
|
|
|
+ if(!item.standardRequirement){
|
|
|
|
+ item.standardRequirementQ = []
|
|
|
|
+ } else {
|
|
|
|
+ item.standardRequirementQ = item.standardRequirement.split(',')
|
|
|
|
+ }
|
|
|
|
+ item.key = (index+1) + ''
|
|
|
|
+ item.editable = true
|
|
|
|
+ return item
|
|
|
|
+ })
|
|
|
|
+ this.count = this.shiyanInfos.length + 1
|
|
|
|
+ console.log(this.model.list)
|
|
|
|
+
|
|
}else{
|
|
}else{
|
|
this.newMember()
|
|
this.newMember()
|
|
}
|
|
}
|
|
|
|
|
|
- console.log(2323,sessionStorage.getItem('yangpin'))
|
|
|
|
- const yangpins = JSON.parse(sessionStorage.getItem('yangpin'))
|
|
|
|
|
|
+ // console.log(2323,sessionStorage.getItem('yangpin'))
|
|
|
|
+ // const yangpins = JSON.parse(sessionStorage.getItem('yangpin'))
|
|
|
|
|
|
- if (yangpins != null) {
|
|
|
|
- this.yangpins = yangpins
|
|
|
|
- console.log(this.yangpins)
|
|
|
|
- }
|
|
|
|
|
|
+ this.yangpins = this.yangpinInfos
|
|
|
|
|
|
- this.count = sessionStorage.getItem('count1') != null ? Number(sessionStorage.getItem('count1')) : 1
|
|
|
|
|
|
+ // this.count = sessionStorage.getItem('count1') != null ? Number(sessionStorage.getItem('count1')) : 1
|
|
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -264,10 +287,12 @@ export default {
|
|
// 获得选中项信息
|
|
// 获得选中项信息
|
|
handleChange2(value,optipn) {
|
|
handleChange2(value,optipn) {
|
|
console.log(777,value,optipn);
|
|
console.log(777,value,optipn);
|
|
- const a = optipn.data.attrs.channel
|
|
|
|
- console.log(a)
|
|
|
|
- this.model.list[this.clickIndex].sampleModelSpecification = a.sampleModelSpecification
|
|
|
|
- console.log(this.model)
|
|
|
|
|
|
+ if(value){
|
|
|
|
+ const a = optipn.data.attrs.channel
|
|
|
|
+ // console.log(a)
|
|
|
|
+ this.$set(this.model.list[this.clickIndex], 'sampleModelSpecification', a.sampleModelSpecification )
|
|
|
|
+ this.$set(this.model.list[this.clickIndex], 'yangpinKeyId', a.sampleName )
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
// 多选依据
|
|
// 多选依据
|
|
@@ -280,7 +305,8 @@ export default {
|
|
key: this.count + '',
|
|
key: this.count + '',
|
|
yangpinKeyId: '',
|
|
yangpinKeyId: '',
|
|
testItems: '',
|
|
testItems: '',
|
|
- standardRequirement: [],
|
|
|
|
|
|
+ standardRequirementQ: [], // 前端用来下拉选择的,直接standardRequirement赋值standardRequirement会有问题
|
|
|
|
+ standardRequirement: '',
|
|
judgementBasis: '',
|
|
judgementBasis: '',
|
|
yijufile: '',
|
|
yijufile: '',
|
|
beizhu: '',
|
|
beizhu: '',
|
|
@@ -289,7 +315,7 @@ export default {
|
|
})
|
|
})
|
|
|
|
|
|
this.count++
|
|
this.count++
|
|
- sessionStorage.setItem('count1', this.count)
|
|
|
|
|
|
+ // sessionStorage.setItem('count1', this.count)
|
|
|
|
|
|
},
|
|
},
|
|
remove(key) {
|
|
remove(key) {
|
|
@@ -312,19 +338,20 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
submitForm() {
|
|
submitForm() {
|
|
- sessionStorage.setItem('yangpinkz', JSON.stringify(this.model.list))
|
|
|
|
- // sessionStorage.setItem('yangpin', JSON.stringify(this.model.list))
|
|
|
|
-
|
|
|
|
|
|
+ // sessionStorage.setItem('yangpinkz', JSON.stringify(this.model.list))
|
|
|
|
+ this.$store.commit('SET_SHIYANINFO', this.model.list);
|
|
|
|
+
|
|
this.$refs.form.validate(valid => {
|
|
this.$refs.form.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
-
|
|
|
|
|
|
+
|
|
this.$emit('submitForm')
|
|
this.$emit('submitForm')
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
prevStep() {
|
|
prevStep() {
|
|
- sessionStorage.setItem('yangpinkz', JSON.stringify(this.model.list))
|
|
|
|
|
|
+ // sessionStorage.setItem('yangpinkz', JSON.stringify(this.model.list))
|
|
|
|
+ this.$store.commit('SET_SHIYANINFO', this.model.list);
|
|
|
|
|
|
this.$emit('prevStep')
|
|
this.$emit('prevStep')
|
|
},
|
|
},
|
|
@@ -333,6 +360,38 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
|
|
+.u-edit-table{
|
|
|
|
+ margin-top: 12px;
|
|
|
|
+ .ant-form-item{
|
|
|
|
+ margin-bottom: 0;
|
|
|
|
+ }
|
|
|
|
+ /deep/.ant-table-tbody .ant-table-row td {
|
|
|
|
+ padding-top: 2px !important;
|
|
|
|
+ padding-bottom: 2px !important;
|
|
|
|
+ }
|
|
|
|
+ .ant-input{
|
|
|
|
+ // padding: 0;
|
|
|
|
+ border: none;
|
|
|
|
+ }
|
|
|
|
+ .ant-table-tbody > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) .ant-input{
|
|
|
|
+ background: #e6f7ff;
|
|
|
|
+ }
|
|
|
|
+ // .ant-input:hover{
|
|
|
|
+ // background: #e6f7ff;
|
|
|
|
+ // }
|
|
|
|
+ .ant-input:focus{
|
|
|
|
+ box-shadow: none;
|
|
|
|
+ }
|
|
|
|
+ /deep/.ant-select-selection{
|
|
|
|
+ border: none;
|
|
|
|
+ }
|
|
|
|
+ /deep/.ant-select-selection:focus{
|
|
|
|
+ box-shadow: none;
|
|
|
|
+ }
|
|
|
|
+ .ant-table-tbody > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) .ant-select-selection{
|
|
|
|
+ background: #e6f7ff;
|
|
|
|
+ }
|
|
|
|
+}
|
|
.card {
|
|
.card {
|
|
margin-bottom: 24px;
|
|
margin-bottom: 24px;
|
|
}
|
|
}
|