|
@@ -1,92 +1,96 @@
|
|
|
<template>
|
|
|
-
|
|
|
- <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
|
|
|
- <a-table
|
|
|
- :columns="columns"
|
|
|
- :dataSource="data"
|
|
|
- :pagination="false"
|
|
|
- >
|
|
|
-
|
|
|
-
|
|
|
- <template v-for="(col, i) in ['yangpinKeyId', 'testItems', 'standardRequirement','judgementBasis','beizhu']"
|
|
|
- :slot="col" slot-scope="text, record, index">
|
|
|
-
|
|
|
-
|
|
|
- <a-select
|
|
|
- :key="col"
|
|
|
- v-if="record.editable && col==='yangpinKeyId'"
|
|
|
- style="margin: -5px 0"
|
|
|
- :value="text"
|
|
|
- :placeholder="columns[i].title"
|
|
|
-
|
|
|
- @change="e => handleChange(e, record.key, col)">
|
|
|
-
|
|
|
- <a-select-option v-for="d in yangpins" :key="d.key">
|
|
|
- {{ d.sampleName }}
|
|
|
- </a-select-option>
|
|
|
- </a-select>
|
|
|
-
|
|
|
-
|
|
|
- <a-input
|
|
|
- :key="col"
|
|
|
- v-if="record.editable && col==='testItems'"
|
|
|
- style="margin: -5px 0"
|
|
|
- :value="text"
|
|
|
- :placeholder="columns[i].title"
|
|
|
- @change="e => handleChange(e.target.value, record.key, col)"></a-input>
|
|
|
-
|
|
|
-
|
|
|
- <j-search-select-tag
|
|
|
- :key="col"
|
|
|
- v-if="record.editable && col==='standardRequirement'"
|
|
|
- style="margin: -5px 0"
|
|
|
- :value="text"
|
|
|
- :placeholder="columns[i].title" @change="e=>handleChange(e, record.key, col)"
|
|
|
- dict="itdm_weituo_yiju,name,name" />
|
|
|
-
|
|
|
- <a-input
|
|
|
- :key="col"
|
|
|
- v-if="record.editable && col==='judgementBasis'"
|
|
|
- style="margin: -5px 0"
|
|
|
- :value="text"
|
|
|
- :placeholder="columns[i].title"
|
|
|
- @change="e => handleChange(e.target.value, record.key, col)"></a-input>
|
|
|
-
|
|
|
-
|
|
|
- <a-input
|
|
|
- :key="col"
|
|
|
- v-if="record.editable && col==='beizhu'"
|
|
|
- style="margin: -5px 0"
|
|
|
- :value="text"
|
|
|
- :placeholder="columns[i].title"
|
|
|
- @change="e => handleChange(e.target.value, record.key, col)"></a-input>
|
|
|
-
|
|
|
-
|
|
|
- </template>
|
|
|
-
|
|
|
- <template slot="operation" slot-scope="text, record, index">
|
|
|
+ <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
|
|
|
+ <a-table
|
|
|
+ :columns="columns"
|
|
|
+ :dataSource="data"
|
|
|
+ :pagination="false"
|
|
|
+ >
|
|
|
+
|
|
|
+
|
|
|
+ <template v-for="(col, i) in ['yangpinKeyId', 'testItems', 'standardRequirement','judgementBasis','beizhu']"
|
|
|
+ :slot="col" slot-scope="text, record, index">
|
|
|
+
|
|
|
+
|
|
|
+ <a-select
|
|
|
+ :disabled="formDisabled"
|
|
|
+ :key="col"
|
|
|
+ v-if="record.editable && col==='yangpinKeyId'"
|
|
|
+ style="margin: -5px 0"
|
|
|
+ :value="text"
|
|
|
+ :placeholder="columns[i].title"
|
|
|
+
|
|
|
+ @change="e => handleChange(e, record.key, col)">
|
|
|
+
|
|
|
+ <a-select-option v-for="d in yangpins" :key="d.key">
|
|
|
+ {{ d.sampleName }}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+
|
|
|
+
|
|
|
+ <a-input
|
|
|
+ :disabled="formDisabled"
|
|
|
+ :key="col"
|
|
|
+ v-if="record.editable && col==='testItems'"
|
|
|
+ style="margin: -5px 0"
|
|
|
+ :value="text"
|
|
|
+ :placeholder="columns[i].title"
|
|
|
+ @change="e => handleChange(e.target.value, record.key, col)"></a-input>
|
|
|
+
|
|
|
+
|
|
|
+ <j-search-select-tag
|
|
|
+ :disabled="formDisabled"
|
|
|
+ :key="col"
|
|
|
+ v-if="record.editable && col==='standardRequirement'"
|
|
|
+ style="margin: -5px 0"
|
|
|
+ :value="text"
|
|
|
+ :placeholder="columns[i].title" @change="e=>handleChange(e, record.key, col)"
|
|
|
+ dict="itdm_weituo_yiju,name,name" />
|
|
|
+
|
|
|
+ <a-input
|
|
|
+ :disabled="formDisabled"
|
|
|
+ :key="col"
|
|
|
+ v-if="record.editable && col==='judgementBasis'"
|
|
|
+ style="margin: -5px 0"
|
|
|
+ :value="text"
|
|
|
+ :placeholder="columns[i].title"
|
|
|
+ @change="e => handleChange(e.target.value, record.key, col)"></a-input>
|
|
|
+
|
|
|
+
|
|
|
+ <a-input
|
|
|
+ :disabled="formDisabled"
|
|
|
+ :key="col"
|
|
|
+ v-if="record.editable && col==='beizhu'"
|
|
|
+ style="margin: -5px 0"
|
|
|
+ :value="text"
|
|
|
+ :placeholder="columns[i].title"
|
|
|
+ @change="e => handleChange(e.target.value, record.key, col)"></a-input>
|
|
|
+
|
|
|
+
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template slot="operation" slot-scope="text, record, index">
|
|
|
<span>
|
|
|
<a-divider type="vertical" />
|
|
|
- <a-popconfirm title="是否要删除此行?" @confirm="remove(record.key)">
|
|
|
+ <a-popconfirm :disabled="formDisabled" title="是否要删除此行?" @confirm="remove(record.key)">
|
|
|
<a>删除</a>
|
|
|
</a-popconfirm>
|
|
|
</span>
|
|
|
- </template>
|
|
|
+ </template>
|
|
|
|
|
|
|
|
|
- </a-table>
|
|
|
- <a-button style="width: 100%; margin-top: 16px; margin-bottom: 8px" type="dashed" icon="plus" @click="newMember">
|
|
|
- 新增成员
|
|
|
- </a-button>
|
|
|
+ </a-table>
|
|
|
+ <a-button :disabled="formDisabled" style="width: 100%; margin-top: 16px; margin-bottom: 8px" type="dashed" icon="plus" @click="newMember">
|
|
|
+ 新增成员
|
|
|
+ </a-button>
|
|
|
|
|
|
|
|
|
- <a-form-item :wrapperCol="{span: 19, offset: 5}">
|
|
|
- <a-button style="margin-left: 8px" @click="prevStep">上一步</a-button>
|
|
|
- <a-button v-if="!disabled" style="margin-left: 8px" @click="submitForm">提交</a-button>
|
|
|
+ <a-form-item :wrapperCol="{span: 19, offset: 5}">
|
|
|
+ <a-button style="margin-left: 8px" @click="prevStep">上一步</a-button>
|
|
|
+ <a-button v-if="!disabled" style="margin-left: 8px" @click="submitForm">提交</a-button>
|
|
|
|
|
|
|
|
|
- </a-form-item>
|
|
|
- </a-form-model>
|
|
|
+ </a-form-item>
|
|
|
+ </a-form-model>
|
|
|
|
|
|
|
|
|
</template>
|
|
@@ -159,12 +163,16 @@ export default {
|
|
|
data: []
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ computed: {
|
|
|
+ formDisabled() {
|
|
|
+ return this.disabled
|
|
|
+ }
|
|
|
+ },
|
|
|
created() {
|
|
|
const data = JSON.parse(sessionStorage.getItem('yangpinkz'))
|
|
|
|
|
|
if (data != null) {
|
|
|
- for (let xx of data) {
|
|
|
+ for (let xx of data) {
|
|
|
this.data.push({
|
|
|
key: xx.key,
|
|
|
yangpinKeyId: xx.yangpinKeyId,
|
|
@@ -187,7 +195,6 @@ export default {
|
|
|
|
|
|
this.count = sessionStorage.getItem('count1') != null ? Number(sessionStorage.getItem('count1')) : 1
|
|
|
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
@@ -229,7 +236,6 @@ export default {
|
|
|
submitForm() {
|
|
|
sessionStorage.setItem('yangpinkz', JSON.stringify(this.data))
|
|
|
|
|
|
-
|
|
|
// this.$refs.form.validate(valid => {
|
|
|
// if (valid) {
|
|
|
this.$emit('submitForm')
|