|
@@ -26,7 +26,7 @@
|
|
|
<picker
|
|
|
@change="(e) => selectProject(item.key, e)"
|
|
|
:range="projectList"
|
|
|
- range-key="Name"
|
|
|
+ range-key="project_name"
|
|
|
>
|
|
|
<view class="select" v-if="item.project_name">
|
|
|
{{ item.project_name }}
|
|
@@ -110,8 +110,6 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
- onLoad() {
|
|
|
- },
|
|
|
onLoad(options) {
|
|
|
this.queryProjectList();
|
|
|
if (options.id) {
|
|
@@ -133,16 +131,13 @@ export default {
|
|
|
},
|
|
|
selectProject(key, e) {
|
|
|
const select = this.projectList[e.target.value];
|
|
|
- const idx = this.formData.findIndex((item) => item.key == key);
|
|
|
- const item = this.formData[idx];
|
|
|
- const resultData = JSON.parse(JSON.stringify(this.formData));
|
|
|
- resultData[idx] = {
|
|
|
- ...item,
|
|
|
- code_id: select.ID,
|
|
|
- project_name: select.Name,
|
|
|
- };
|
|
|
+ const item = this.formData.find((item) => item.key == key);
|
|
|
+ item.code_id = select.id
|
|
|
+ item.project_name = select.project_name
|
|
|
+
|
|
|
+ console.log(this.formData)
|
|
|
|
|
|
- this.formData = resultData;
|
|
|
+ // this.formData = [...this.formData];
|
|
|
},
|
|
|
addFormData() {
|
|
|
this.formData.push({
|