|
@@ -68,10 +68,14 @@
|
|
|
<el-button type="primary" icon="el-icon-plus" size="small" @click.stop="addRow">录入明细
|
|
|
</el-button>
|
|
|
</template>
|
|
|
- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
|
|
|
+ <template v-if="!row.$cellEdit" slot-scope="{type,size,row,index,disabled}" slot="menu">
|
|
|
+ <!--<el-button :size="size" :disabled="disabled" :type="type"-->
|
|
|
+ <!-- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="$refs.crud.rowEdit(row, index)">{{-->
|
|
|
+ <!-- row.$cellEdit ? '确认' : '修改' }}-->
|
|
|
+ <!--</el-button>-->
|
|
|
<el-button :size="size" :disabled="disabled" :type="type"
|
|
|
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="$refs.crud.rowEdit(row, index)">{{
|
|
|
- row.$cellEdit ? '确认' : '修改' }}
|
|
|
+ :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="$refs.crud.rowCell(row, index)">{{
|
|
|
+ row.$cellEdit ? '确认' : '修改' }}
|
|
|
</el-button>
|
|
|
<el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type" @click="rowDel(row, index)">删除
|
|
|
</el-button>
|
|
@@ -717,12 +721,16 @@ export default {
|
|
|
}
|
|
|
,
|
|
|
addRow() {
|
|
|
- console.log('1234');
|
|
|
- this.data.push({
|
|
|
- $cellEdit: true,
|
|
|
- contacts:this.data[this.data.length - 1].contacts,
|
|
|
- tel:this.data[this.data.length - 1].tel,
|
|
|
- })
|
|
|
+ if (this.data.length > 0) {
|
|
|
+ this.data.push({
|
|
|
+ $cellEdit: true,
|
|
|
+ contacts:this.data[this.data.length - 1].contacts,
|
|
|
+ tel:this.data[this.data.length - 1].tel,
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ this.data.push({ $cellEdit: true })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
,
|
|
|
rowCell(row, index) {
|
|
@@ -918,7 +926,9 @@ export default {
|
|
|
,
|
|
|
//新增客户联系人保存触发
|
|
|
rowSave(row, done, loading) {
|
|
|
- console.log(row,913)
|
|
|
+ if(this.data.length == 1) {
|
|
|
+ this.$set(row,'defaultAddres','1')
|
|
|
+ }
|
|
|
done(row);
|
|
|
}
|
|
|
,
|