jbb 2 years ago
parent
commit
77cc844088

+ 10 - 39
src/views/oa/SyCottonYarnList.vue

@@ -101,7 +101,7 @@
 
     <!-- 表单区域 -->
     <syCottonYarn-modal ref="modalForm" @ok="modalFormOk"  @close="getList"/>
-    <sy-cotton-yarn-detail-modal ref="syCottonYarnDetailModal"></sy-cotton-yarn-detail-modal>
+    <sy-cotton-yarn-detail-modal ref="syCottonYarnDetailModal" @close="getList"></sy-cotton-yarn-detail-modal>
 
   </a-card>
 </template>
@@ -210,44 +210,15 @@
        this.queryParam={}
        this.getList()
       },
-      async handleEdit(record,data){
-        var zhuId = ''
-        await getAction('/oa/syCottonYarn/queryById', {id:record.id}).then((res) => {
-          if(res.success){
-             if(data == '0'){
-               this.$refs.modalForm.formState=res.result //编辑
-             }else{
-               this.$refs.syCottonYarnDetailModal.formState=res.result //详情
-             }
-            zhuId = res.result.id
-          }else{
-            this.$message.warning(res.message)
-          }
-        })
-        getAction(this.url.editListUrl, {id:zhuId}).then((res) => {
-          if(res.success){
-            if(data == '0'){
-              this.$refs.modalForm.visible = true
-              this.$refs.modalForm.defultMethods = 'edit'
-              res.result.map(item =>{
-              if(item.orderDate !==''&& item.orderDate){
-                item.orderDate = moment(item.orderDate)
-              }
-            })
-            this.$refs.modalForm.syCottonYarnBTable.dataSource = res.result
-          }else{
-            this.$refs.syCottonYarnDetailModal.visible = true
-              res.result.map(item =>{
-              if(item.orderDate !==''&& item.orderDate){
-                item.orderDate = moment(item.orderDate)
-              }
-            })
-            this.$refs.syCottonYarnDetailModal.syCottonYarnBTable.dataSource = res.result
-          }
-          }else{
-            this.$message.warning(res.message)
-          }
-        })
+       handleEdit(record,data){
+        if(data == '0'){
+           this.$refs.modalForm.visible = true
+            this.$refs.modalForm.getHeaderList(record.id)
+         }else{
+           this.$refs.syCottonYarnDetailModal.visible = true
+           this.$refs.syCottonYarnDetailModal.getHeaderList(record.id)
+         }
+       
       },
 
 

+ 40 - 2
src/views/oa/modules/SyCottonYarnDetailModal.vue

@@ -82,7 +82,7 @@
   import pick from 'lodash.pick'
   import { FormTypes } from '@/utils/JEditableTableUtil'
   import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
-  import { putAction,postAction } from '@/api/manage'
+  import { putAction,postAction,getAction } from '@/api/manage'
 
   export default {
     name: 'SyCottonYarnDetailModal',
@@ -96,6 +96,7 @@
         refKeys: ['syCottonYarnB', ],
         activeKey: 'syCottonYarnB',
         formState:{},
+        zhuId:'',
         // 搬运装卸费用-棉纱-子表
         syCottonYarnBTable: {
           loading: false,
@@ -191,8 +192,42 @@
       }
     },
     methods: {
+       // 获取表头信息
+      getHeaderList(id){
+        this.zhuId = id
+        getAction('/oa/syCottonYarn/queryById', {id:id}).then((res) => {
+          if(res.success){
+            var zhuId
+             this.formState=res.result //详情
+             zhuId = res.result.id
+             this.getTable(zhuId)
+          }else{
+            this.$message.warning(res.message)
+          }
+        })
+      },
+      getTable(id){
+        getAction('/oa/syCottonYarn/querySyCottonYarnBByMainId', {id:id}).then((res) => {
+          if(res.success){
+              res.result.map(item =>{
+              if(item.orderDate !==''&& item.orderDate){
+                item.orderDate = moment(item.orderDate)
+              }
+            })
+            this.syCottonYarnBTable.dataSource = res.result
+          }else{
+            this.$message.warning(res.message)
+          }
+        })
+      },
       handelAutograph(record){
-          record.jhyName = this.$store.getters.nickname
+           getAction('/oa/syCottonYarn/signPlan', {id:record.id}).then((res) => {
+          if(res.success){
+            this.getHeaderList(this.zhuId)
+          }else{
+            this.$message.warning(res.message)
+          }
+        })
         
       },
         //关闭
@@ -200,7 +235,10 @@
         this.syCottonYarnBTable.dataSource=[]
         this.formState = {}
         this.visible = false
+        this.zhuId = ''
+        this.$emit('close')
       },
+      
     }
   }
 </script>

+ 31 - 1
src/views/oa/modules/SyCottonYarnModal.vue

@@ -113,7 +113,7 @@
   import pick from 'lodash.pick'
   import { FormTypes } from '@/utils/JEditableTableUtil'
   import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
-  import { putAction,postAction } from '@/api/manage'
+  import { putAction,postAction,getAction } from '@/api/manage'
 
   export default {
     name: 'SyCottonYarnModal',
@@ -128,6 +128,7 @@
         activeKey: 'syCottonYarnB',
         formState:{},
         defultMethods:'add',
+        zhuId:'',
         // 搬运装卸费用-棉纱-子表
         syCottonYarnBTable: {
           loading: false,
@@ -215,6 +216,33 @@
       }
     },
     methods: {
+      // 获取表头信息
+      getHeaderList(id){
+        getAction('/oa/syCottonYarn/queryById', {id:id}).then((res) => {
+          if(res.success){
+            var zhuId = '' //主表id
+             this.formState=res.result //详情
+             zhuId = res.result.id
+             this.getTable(zhuId)
+          }else{
+            this.$message.warning(res.message)
+          }
+        })
+      },
+      getTable(id){
+        getAction('/oa/syCottonYarn/querySyCottonYarnBByMainId', {id:id}).then((res) => {
+          if(res.success){
+              res.result.map(item =>{
+              if(item.orderDate !==''&& item.orderDate){
+                item.orderDate = moment(item.orderDate)
+              }
+            })
+            this.syCottonYarnBTable.dataSource = res.result
+          }else{
+            this.$message.warning(res.message)
+          }
+        })
+      },
       addList(){
         this.syCottonYarnBTable.dataSource.push({})
       },
@@ -294,6 +322,8 @@
         this.formState = {}
         this.visible = false
         this.defultMethods='add'
+        this.zhuId = ''
+        this.$emit('close')
       },
     }
   }