Browse Source

搬运工对账单

jbb 2 years ago
parent
commit
cd14bada02
2 changed files with 49 additions and 48 deletions
  1. 17 45
      src/views/oa/SyCarryList.vue
  2. 32 3
      src/views/oa/SyCottonYarnList.vue

+ 17 - 45
src/views/oa/SyCarryList.vue

@@ -64,7 +64,6 @@
         :loading="loading"
         :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         @change="handleTableChange">
-        state
          <span slot="state" slot-scope="text, record">
            <span v-if="record.state == '0'">草稿</span>
            <span v-if="record.state == '1'">计划签字中</span>
@@ -86,8 +85,8 @@
                   <a>删除</a>
                 </a-popconfirm>
                 <a @click='plannerSubmit(record,1)' v-if="record.state == '0'">计划员提交</a>
-                <a @click='plannerSubmit(record,2)' v-if="record.state == '1'">人事行政审批</a>
-                <!-- <a @click='plannerSubmit(record,3)'>财务经理审批</a> -->
+                <a @click='plannerSubmit(record,2)' v-if="record.state == '2'">人事行政审批</a>
+                <a @click='plannerSubmit(record,3)' v-if="record.state == '3'">财务经理审批</a>
               </a-menu-item>
             </a-menu>
           </a-dropdown>
@@ -99,7 +98,7 @@
 
     <!-- 表单区域 -->
     <syCarry-modal ref="modalForm" @ok="modalFormOk" @close='getList'/>
-    <sy-carry-detail-modal ref="syCarryDetailModal"></sy-carry-detail-modal>
+    <sy-carry-detail-modal ref="syCarryDetailModal" @close='getList'></sy-carry-detail-modal>
 
   </a-card>
 </template>
@@ -201,8 +200,7 @@
       plannerSubmit(record,state){
          getAction('/oa/syCarry/commitBatch', {ids:record.id,state:state}).then((res) => {
           if(res.success){
-            this.getAction()
-            this.$forceUpdate()
+            this.getList()
           }else{
             this.$message.warning(res.message)
           }
@@ -212,49 +210,23 @@
        this.queryParam={}
        this.getList()
       },
-      async handleEdit(record,data){
-        var zhuId = ''
-        await getAction('/oa/syCarry/queryById', {id:record.id}).then((res) => {
-          if(res.success){
-             if(data == '0'){
-               this.$refs.modalForm.formState=res.result //编辑
-             }else{
-               this.$refs.syCarryDetailModal.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.syCarryBTable.dataSource = res.result
-          }else{
-            this.$refs.syCarryDetailModal.visible = true
-              res.result.map(item =>{
-              if(item.orderDate !==''&& item.orderDate){
-                item.orderDate = moment(item.orderDate)
-              }
-            })
-            this.$refs.syCarryDetailModal.syCarryBTable.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.syCarryDetailModal.visible = true
+           this.$refs.syCarryDetailModal.getHeaderList(record.id)
+         }
       },
 
 
       initDictConfig() {
-      }
+      },
+    //   handleTableChange(pagination, filters, sorter) {
+    //   this.queryParam.pageNo = pagination.current
+    //   this.getList()
+    // },
 
     }
   }

+ 32 - 3
src/views/oa/SyCottonYarnList.vue

@@ -65,18 +65,31 @@
         :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         @change="handleTableChange">
 
+        <span slot="state" slot-scope="text, record">
+           <span v-if="record.state == '0'">草稿</span>
+           <span v-if="record.state == '1'">计划签字中</span>
+           <span v-if="record.state == '2'">人事行政审批中</span>
+           <span v-if="record.state == '3'">财务经理审批中</span>
+           <span v-if="record.state == '4'">已完成</span>
+         </span>
+
+
         <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record,'0')">编辑</a>
+          <a @click="handleEdit(record,'0')" v-if="record.state == '0'">编辑</a>
 
+          <a-divider type="vertical"  v-if="record.state == '0'"/>
+          <a @click="handleEdit(record,'1')">详情</a>
           <a-divider type="vertical" />
           <a-dropdown>
             <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
             <a-menu slot="overlay">
               <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)" v-if="record.state == '0'">
                   <a>删除</a>
                 </a-popconfirm>
-                 <a @click="handleEdit(record,'1')">详情</a>
+                 <a @click='plannerSubmit(record,1)' v-if="record.state == '0'">计划员提交</a>
+                 <a @click='plannerSubmit(record,2)' v-if="record.state == '2'">人事行政审批</a>
+                 <a @click='plannerSubmit(record,3)' v-if="record.state == '3'">财务经理审批</a>
               </a-menu-item>
             </a-menu>
           </a-dropdown>
@@ -134,6 +147,12 @@
             align:"center",
             dataIndex: 'code'
           },
+          {
+            title: '状态',
+            align:"center",
+            dataIndex: 'state',
+            scopedSlots: { customRender: 'state' },
+          },
           {
             title: '备注',
             align:"center",
@@ -174,6 +193,16 @@
           }
         })
       },
+      // 计划员提交
+      plannerSubmit(record,state){
+         getAction('/oa/syCottonYarn/commitBatch', {ids:record.id,state:state}).then((res) => {
+          if(res.success){
+            this.getList()
+          }else{
+            this.$message.warning(res.message)
+          }
+        })
+      },
       searchQuery(){
         this.getList()
       },