|
@@ -50,18 +50,23 @@ Page({
|
|
|
onClick(data) {
|
|
|
let item = data.currentTarget.dataset.item
|
|
|
let form = getApp().globalData.formData
|
|
|
- form.data.formLayoutData.formInfo.unshift({
|
|
|
- label: '经销商', //标题
|
|
|
- type: 'cell', //表单类型 text,upload,picker,datepicker
|
|
|
- id: 'enterprisename', //表单id
|
|
|
- placeholder: '', //设置文本框默认提示
|
|
|
- inputValue: item.enterprisename,
|
|
|
- data: [], //填充表单的数据 例如下拉框
|
|
|
- role: {
|
|
|
- type: 'reg',
|
|
|
- },
|
|
|
- force: false, //是否必输入
|
|
|
- })
|
|
|
+ let index = form.data.formLayoutData.formInfo.findIndex(v => v.label == '经销商');
|
|
|
+ if (index == -1) {
|
|
|
+ form.data.formLayoutData.formInfo.unshift({
|
|
|
+ label: '经销商', //标题
|
|
|
+ type: 'cell', //表单类型 text,upload,picker,datepicker
|
|
|
+ id: 'enterprisename', //表单id
|
|
|
+ placeholder: '', //设置文本框默认提示
|
|
|
+ inputValue: item.enterprisename,
|
|
|
+ data: [], //填充表单的数据 例如下拉框
|
|
|
+ role: {
|
|
|
+ type: 'reg',
|
|
|
+ },
|
|
|
+ force: false, //是否必输入
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ form.data.formLayoutData.formInfo[index].inputValue = item.enterprisename;
|
|
|
+ }
|
|
|
form.data.formLayoutData.formInfo.forEach(e => {
|
|
|
if (e.id === 'sys_enterpriseid') {
|
|
|
e.inputValue = item.sys_enterpriseid
|