|
@@ -97,6 +97,7 @@
|
|
|
import breadcrumb from '@c/common/breadcrumb.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: car } = createNamespacedHelpers('car');
|
|
|
+const { mapActions: repair } = createNamespacedHelpers('repair');
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
@@ -111,15 +112,23 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
+ async created() {
|
|
|
+ await this.search1();
|
|
|
+ },
|
|
|
methods: {
|
|
|
...car({ newquery: 'query', newfetch: 'fetch', newdelete: 'delete', newcreate: 'create', newupdate: 'update' }),
|
|
|
+ ...repair(['query', 'create', 'delete', 'update', 'fetch']),
|
|
|
//查询信息
|
|
|
async search1() {
|
|
|
+ console.log(this.id);
|
|
|
+ console.log('hhh');
|
|
|
if (this.id) {
|
|
|
- const res = await this.newfetch(this.id);
|
|
|
+ let res = await this.newfetch(this.id);
|
|
|
+ // let arr = await this.query({ uid: this.id });
|
|
|
+
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$set(this, `form`, res.data);
|
|
|
+ // this.$set(this.formData, `tableData`, arr.data);
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.errmsg,
|
|
@@ -128,6 +137,28 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ // async search2() {
|
|
|
+ // if (this.id) {
|
|
|
+ // console.log(this.id);
|
|
|
+ // const res = await this.query(this.id);
|
|
|
+ // console.log(res);
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ //查询维修单信息
|
|
|
+ // async search2({ data }) {
|
|
|
+ // console.log(data);
|
|
|
+ // if (this.id) {
|
|
|
+ // const res = await this.fetch(this.id);
|
|
|
+ // if (this.$checkRes(res)) {
|
|
|
+ // this.$set(this, `formData.tableData`, res.data);
|
|
|
+ // } else {
|
|
|
+ // this.$message({
|
|
|
+ // message: res.errmsg,
|
|
|
+ // type: 'error',
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
//添加
|
|
|
addData() {
|
|
|
this.formData.tableData.push({
|
|
@@ -161,7 +192,7 @@ export default {
|
|
|
back() {
|
|
|
// this.$set(this, `form`, {});
|
|
|
this.$router.push({ path: '/user' });
|
|
|
- this.search1();
|
|
|
+ // this.search1();
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
@@ -173,15 +204,16 @@ export default {
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
|
},
|
|
|
- watch: {
|
|
|
- id: {
|
|
|
- deep: true,
|
|
|
- immediate: true,
|
|
|
- handler(val) {
|
|
|
- this.search1();
|
|
|
- },
|
|
|
- },
|
|
|
- },
|
|
|
+ // watch: {
|
|
|
+ // id: {
|
|
|
+ // deep: true,
|
|
|
+ // immediate: true,
|
|
|
+ // handler(val) {
|
|
|
+ // this.search1();
|
|
|
+ // this.search2();
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // },
|
|
|
};
|
|
|
</script>
|
|
|
|