|
|
@@ -120,7 +120,7 @@
|
|
|
v-if="tabList.length"
|
|
|
ref="reportRef"
|
|
|
:is="componentName"
|
|
|
- :key="activeName"
|
|
|
+ :key="activeName + isUpdate"
|
|
|
:infoData="infoData"
|
|
|
:taskInfo="{
|
|
|
...tabList[activeName],
|
|
|
@@ -162,6 +162,7 @@
|
|
|
data () {
|
|
|
return {
|
|
|
infoData: {},
|
|
|
+ isUpdate: true,
|
|
|
descriptionsShow: true,
|
|
|
activeName: '0',
|
|
|
tabList: [],
|
|
|
@@ -203,7 +204,7 @@
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
- this.getDetail(this.$route.query.id);
|
|
|
+ this.init();
|
|
|
},
|
|
|
methods: {
|
|
|
handleReport () {
|
|
|
@@ -232,15 +233,25 @@
|
|
|
].code,
|
|
|
...data
|
|
|
};
|
|
|
- await report(params);
|
|
|
+ await report(params).then((res) => {
|
|
|
+ this.$message.success('报工成功!');
|
|
|
+ this.getDetail();
|
|
|
+ this.isUpdate = !this.isUpdate;
|
|
|
+ return res;
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
- async getDetail (id) {
|
|
|
- const res = await getById(id);
|
|
|
-
|
|
|
+ async init () {
|
|
|
+ await this.getDetail();
|
|
|
+ await this._getTaskListById();
|
|
|
+ },
|
|
|
+ async getDetail () {
|
|
|
+ const res = await getById(this.$route.query.id);
|
|
|
this.infoData = res;
|
|
|
+ },
|
|
|
+ async _getTaskListById () {
|
|
|
// 获取工序
|
|
|
- const res1 = await getTaskListById(res.produceVersionId);
|
|
|
+ const res1 = await getTaskListById(this.infoData.produceVersionId);
|
|
|
|
|
|
this.tabList = res1;
|
|
|
this.activeName = '0';
|