Browse Source

面损列表-审批状态

jbb 2 years ago
parent
commit
701eef8ca7

+ 6 - 6
src/views/cost-allocation-total/fabricLossesSummary.vue

@@ -100,11 +100,10 @@
         @change="handleTableChange"
       >
       <span slot="action" slot-scope="text, record">
-          <a @click="handleApply(record)" v-if="apply == 1 && (record.status=='保存' ||record.status=='完成'|| record.status=='' || record.status==undefined)">发起申请</a>
-          <a-divider type="vertical"  v-if="apply == 1 && (record.status=='保存' ||record.status=='完成'|| record.status=='' || record.status==undefined)"/>
+          <!-- <a @click="handleApply(record)" v-if="apply == 1 && (record.status=='保存' ||record.status=='完成'|| record.status=='' || record.status==undefined)">发起申请</a>
+          <a-divider type="vertical"  v-if="apply == 1 && (record.status=='保存' ||record.status=='完成'|| record.status=='' || record.status==undefined)"/> -->
           <a @click="openAppendixList(record)" v-if="record.attachs!==''&&record.attachs">附件</a>
-          <a @click="cancelSumit(record)">取消提交</a>
-          <!-- <a-divider v-if="record.attachs!==''&&record.attachs"/>
+          <a-divider v-if="record.attachs!==''&&record.attachs"/>
           <a-dropdown>
           <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
             <a-menu slot="overlay" >
@@ -112,7 +111,7 @@
               <a-menu-item><a @click="details(record)">详情</a></a-menu-item>
               <a-menu-item><a @click="approvalHistory(record)">审批历史</a></a-menu-item>
             </a-menu>
-            </a-dropdown>                   -->
+            </a-dropdown>                  
         </span>
       </a-table>
     </a-card>
@@ -121,7 +120,7 @@
     <!-- <costDetail-drawer ref="costDetailDrawer" :fatherList="getCostList" @ok="modalFormOk"></costDetail-drawer> -->
     <attachment   ref="attachment"></attachment>
     <history-modal ref="historyModal"></history-modal>
-    <detail-fabric-loss-table ref="detailFabricLossTable"></detail-fabric-loss-table>
+    <detail-fabric-loss-table ref="detailFabricLossTable"  @close="getCostList"></detail-fabric-loss-table>
   </div>
 </template>
 
@@ -290,6 +289,7 @@ export default {
     },
     details(record){
       this.$refs.detailFabricLossTable.detailModVis = true
+      this.$refs.detailFabricLossTable.status = record.status
       this.$refs.detailFabricLossTable.onSearch(record.ccode,'0')
     },
     searchQuery() {

+ 291 - 0
src/views/cost-allocation-total/modal/SelectUserModal.vue

@@ -0,0 +1,291 @@
+<template>
+  <div>
+    <a-modal
+      centered
+      :title="title"
+      :width="1000"
+      :visible="visible"
+      @ok="handleOk"
+      @cancel="handleCancel"
+      cancelText="关闭">
+
+      <!-- 查询区域 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="searchQuery">
+          <a-row :gutter="24">
+            <a-col :span="8">
+              <a-form-item label="用户名称">
+                <a-input placeholder="请输入用户名称" v-model="queryParam.realname"></a-input>
+              </a-form-item>
+            </a-col>
+            <a-col :span="8">
+              <a-form-item label="用户账号">
+                <a-input placeholder="请输入用户账号" v-model="queryParam.username"></a-input>
+              </a-form-item>
+            </a-col>
+            <a-col :span="8">
+              <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+                <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+                <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              </span>
+            </a-col>
+
+          </a-row>
+        </a-form>
+      </div>
+      <!-- table区域-begin -->
+      <div>
+        <a-table
+          size="small"
+          bordered
+          rowKey="id"
+          :columns="columns1"
+          :dataSource="dataSource1"
+          :pagination="ipagination"
+          :loading="loading"
+          :scroll="{ y: 240 }"
+          :rowSelection="{selectedRowKeys: selectedRowKeys,onSelectAll:onSelectAll,onSelect:onSelect,onChange: onSelectChange}"
+          @change="handleTableChange">
+
+        </a-table>
+      </div>
+      <!-- table区域-end -->
+
+    </a-modal>
+  </div>
+</template>
+
+<script>
+  import { filterObj } from '@/utils/util'
+  import { getAction } from '@/api/manage'
+
+  export default {
+    name: 'SelectUserModal',
+    data() {
+      return {
+        title: '添加已有用户',
+        names: [],
+        visible: false,
+        placement: 'right',
+        description: '',
+        // 查询条件
+        queryParam: {},
+        // 表头
+        columns1: [
+          {
+            title: '#',
+            dataIndex: '',
+            key: 'rowIndex',
+            width: 50,
+            align: 'center',
+            customRender: function (t, r, index) {
+              return parseInt(index) + 1
+            }
+          },
+          {
+            title: '用户账号',
+            align: 'center',
+            sorter: true,
+            width: 100,
+            dataIndex: 'username'
+          },
+          {
+            title: '用户名称',
+            align: 'center',
+            width: 100,
+            dataIndex: 'realname'
+          },
+          {
+            title: '性别',
+            align: 'center',
+            width: 100,
+            dataIndex: 'sex_dictText'
+          },
+          {
+            title: '电话',
+            align: 'center',
+            width: 100,
+            dataIndex: 'phone'
+          },
+          {
+            title: '部门',
+            align: 'center',
+            width: 150,
+            dataIndex: 'orgCode'
+          }
+        ],
+        columns2: [
+          {
+            title: '用户账号',
+            align: 'center',
+            dataIndex: 'username'
+
+          },
+          {
+            title: '用户名称',
+            align: 'center',
+            dataIndex: 'realname'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align: 'center',
+            width: 100,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        // 数据集
+        dataSource1: [],
+        dataSource2: [],
+        // 分页参数
+        ipagination: {
+          current: 1,
+          pageSize: 10,
+          pageSizeOptions: ['10', '20', '30'],
+          showTotal: (total, range) => {
+            return range[0] + '-' + range[1] + ' 共' + total + '条'
+          },
+          showQuickJumper: true,
+          showSizeChanger: true,
+          total: 0
+        },
+        isorter: {
+          column: 'createTime',
+          order: 'desc'
+        },
+        loading: false,
+        selectedRowKeys: [],
+        selectedRows: [],
+        url: {
+          list: '/sys/user/list'
+        }
+      }
+    },
+    created() {
+      this.loadData()
+    },
+    methods: {
+      searchQuery() {
+        this.loadData(1)
+      },
+      searchReset() {
+        this.queryParam = {}
+        this.loadData(1)
+      },
+      handleCancel() {
+        this.visible = false
+        this.selectedRowKeys=[]
+      },
+      handleOk() {
+        this.dataSource2 = this.selectionRows
+        var name = []
+        this.selectionRows.map(item=>name.push(item.realname))
+        this.$emit('selectFinished', name.toString())
+        this.visible = false
+      },
+      add() {
+        this.visible = true
+      },
+      loadData(arg) {
+        // 加载数据 若传入参数1则加载第一页的内容
+        if (arg === 1) {
+          this.ipagination.current = 1
+        }
+        var params = this.getQueryParams()// 查询条件
+        getAction(this.url.list, params).then((res) => {
+          if (res.success) {
+            this.dataSource1 = res.result.records
+            this.ipagination.total = res.result.total
+          }
+        })
+      },
+      getQueryParams() {
+        var param = Object.assign({}, this.queryParam, this.isorter)
+        param.field = this.getQueryField()
+        param.pageNo = this.ipagination.current
+        param.pageSize = this.ipagination.pageSize
+        return filterObj(param)
+      },
+      getQueryField() {
+        // todo 字段权限控制
+      },
+      onSelectAll(selected, selectedRows, changeRows) {
+        if (selected === true) {
+          for (var a = 0; a < changeRows.length; a++) {
+            this.dataSource2.push(changeRows[a])
+          }
+        } else {
+          for (var b = 0; b < changeRows.length; b++) {
+            this.dataSource2.splice(this.dataSource2.indexOf(changeRows[b]), 1)
+          }
+        }
+        // console.log(selected, selectedRows, changeRows);
+      },
+      onSelect(record, selected) {
+        if (selected === true) {
+          this.dataSource2.push(record)
+        } else {
+          var index = this.dataSource2.indexOf(record)
+          // console.log();
+          if (index >= 0) {
+            this.dataSource2.splice(this.dataSource2.indexOf(record), 1)
+          }
+        }
+      },
+      onSelectChange(selectedRowKeys, selectedRows) {
+        this.selectedRowKeys = selectedRowKeys
+        this.selectionRows = selectedRows
+      },
+      onClearSelected() {
+        this.selectedRowKeys = []
+        this.selectionRows = []
+      },
+      handleDelete: function (record) {
+        this.dataSource2.splice(this.dataSource2.indexOf(record), 1)
+      },
+      handleTableChange(pagination, filters, sorter) {
+        // 分页、排序、筛选变化时触发
+        console.log(sorter)
+        // todo 筛选
+        if (Object.keys(sorter).length > 0) {
+          this.isorter.column = sorter.field
+          this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
+        }
+        this.ipagination = pagination
+        this.loadData()
+      }
+    }
+  }
+</script>
+<style lang="less" scoped>
+  .ant-card-body .table-operator {
+    margin-bottom: 18px;
+  }
+
+  .ant-table-tbody .ant-table-row td {
+    padding-top: 15px;
+    padding-bottom: 15px;
+  }
+
+  .anty-row-operator button {
+    margin: 0 5px
+  }
+
+  .ant-btn-danger {
+    background-color: #ffffff
+  }
+
+  .ant-modal-cust-warp {
+    height: 100%
+  }
+
+  .ant-modal-cust-warp .ant-modal-body {
+    height: calc(100% - 110px) !important;
+    overflow-y: auto
+  }
+
+  .ant-modal-cust-warp .ant-modal-content {
+    height: 90% !important;
+    overflow-y: hidden
+  }
+</style>

+ 112 - 5
src/views/cost-allocation-total/modal/detailFabricLossTable.vue

@@ -5,23 +5,27 @@
     :confirmLoading="confirmLoading"
     width="86%"
     style="top:330px;left:100px;"
+    @cancel="handlecLose"
   >
   <template slot="footer">
-        <a-button >
+        <a-button @click="Submit" :disabled="!(status=='保存'||status=='返单')">
           提交
         </a-button>
-        <a-button >
+        <a-button @click="assign" :disabled="!(status=='提交')">
          指派
         </a-button>
-        <a-button >
+        <a-button @click="Approved" :disabled="!(status=='已指派')">
          审批通过
         </a-button>
-        <a-button >
+        <a-button @click="reject" :disabled="!(status=='已指派')">
          驳回
         </a-button>
-        <a-button >
+        <a-button @click="revokeApproval" :disabled="!(status=='完成')">
          撤销审批
         </a-button>
+        <a-button  @click="handlecLose">
+          取消
+        </a-button>
       </template>
   <!-- 面料损耗表 -->
   <div id="fabricLossTable" >
@@ -319,6 +323,10 @@
   </div>
    <!-- 附件 -->
    <attachment-display ref="attachmentDisplay"></attachment-display>
+   <!-- 提交信息 -->
+   <submit-information ref="submitInformation" @close="closeInformation"></submit-information>
+   <!-- 选择指派人员 -->
+   <select-user-modal ref="SelectUserModal" @selectFinished="selectFinished"></select-user-modal>
   </div>
   </a-modal>
 </template>
@@ -336,12 +344,15 @@
 // import iquantityMoreLessModal from '@views/reportForms/fabric-loss-table/iquantityMoreLessModal.vue'
 // import otherYarnsInModal from '@views/reportForms/fabric-loss-table/otherYarnsInModal.vue'
 import AttachmentDisplay from '@views/reportForms/fabric-loss-table/attachment-display.vue'
+import submitInformation from '@views/cost-allocation-total/modal/submitInformation.vue'
+import SelectUserModal from '@views/cost-allocation-total/modal/SelectUserModal.vue'
 import { getFabricLossDatas,saveFabricLossData,fileDetail,deleteFileDetail } from '@api/reportForms/fabric-loss-table'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import JUpload from '@/components/jeecg/JUpload'
 import moment from 'moment'
 import { runInThisContext } from 'vm'
+import {cancelSubmit } from '@api/document/fabricLossesSummary.js'
 
 export default {
   name: 'FabricLossTable', // 面料损耗表
@@ -362,6 +373,8 @@ export default {
     moment,
     JUpload,
     AttachmentDisplay,
+    submitInformation,
+    SelectUserModal,
     accessory2:[],
   },
   data() {
@@ -653,6 +666,7 @@ export default {
       noteOne: '', // 备注 1
       noteTwo: '', // 备注 2
       dd:0,
+      status:'',
       detailModVis:false 
     }
   },
@@ -931,6 +945,99 @@ export default {
       this.$refs.attachmentDisplay.attachmentData =  attachList;
      
     },
+    //提交
+    Submit(){
+      this.$refs.submitInformation.submitInformationModVis = true
+      this.$refs.submitInformation.text = '提交'
+
+    },
+    assign(){
+      this.$refs.SelectUserModal.visible = true
+    },
+    handlecLose(){
+         this.detailModVis = false
+         this.fabricLoss={fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[],fabricCostAssistList:[],fabricCostClothList:[],fabricCostClothesList:[],fabricCostInvoiceList:[],fabricExpensesList:[],fabricAccidentList:[]}
+    },
+    closeInformation(data,text){
+      var syApprovalHistory={
+        stuta:text,
+        plan_no:this.planNO,
+        processing_opinion:data,
+        processed_by:this.$store.getters.userInfo.realname,
+        processing_time:moment(new Date()).format('YYYY-MM-DD hh:mm:ss'),
+        assigned_by:''
+      }
+      cancelSubmit({planNum:this.planNO,status:this.status,currentState:text,syApprovalHistory:syApprovalHistory}).then(res => {
+          if (res.success) {
+            this.$message.success(text+'成功')
+            this.handlecLose()
+            this.$emit('close')
+          }else{
+            this.$message.error(res.message);
+          }
+        })
+    },
+    selectFinished(data){
+      var syApprovalHistory={
+        stuta:'已指派',
+        plan_no:this.planNO,
+        processing_opinion:'',
+        processed_by:this.$store.getters.userInfo.realname,
+        processing_time:moment(new Date()).format('YYYY-MM-DD hh:mm:ss'),
+        assigned_by:data
+      }
+      cancelSubmit({planNum:this.planNO,status:this.status,currentState:'已指派',syApprovalHistory:syApprovalHistory}).then(res => {
+          if (res.success) {
+            this.$message.success('指派成功')
+            this.handlecLose()
+            this.$emit('close')
+          }else{
+            this.$message.error(res.message);
+          }
+        })
+    },
+    Approved(){
+      var syApprovalHistory={
+        stuta:'完成',
+        plan_no:this.planNO,
+        processing_opinion:'',
+        processed_by:this.$store.getters.userInfo.realname,
+        processing_time:moment(new Date()).format('YYYY-MM-DD hh:mm:ss'),
+        assigned_by:''
+      }
+      cancelSubmit({planNum:this.planNO,status:this.status,currentState:'完成',syApprovalHistory:syApprovalHistory}).then(res => {
+          if (res.success) {
+            this.$message.success('审批通过')
+            this.handlecLose()
+            this.$emit('close')
+          }else{
+            this.$message.error(res.message);
+          }
+        })
+    },
+    reject(){
+      this.$refs.submitInformation.submitInformationModVis = true
+      this.$refs.submitInformation.text = '返单'
+    },
+    revokeApproval(){
+      var syApprovalHistory={
+        stuta:'保存',
+        plan_no:this.planNO,
+        processing_opinion:'',
+        processed_by:this.$store.getters.userInfo.realname,
+        processing_time:moment(new Date()).format('YYYY-MM-DD hh:mm:ss'),
+        assigned_by:''
+      }
+      cancelSubmit({planNum:this.planNO,status:this.status,currentState:'保存',syApprovalHistory:syApprovalHistory}).then(res => {
+          if (res.success) {
+            this.$message.success('撤销审批成功')
+            this.handlecLose()
+            this.$emit('close')
+          }else{
+            this.$message.error(res.message);
+          }
+        })
+    },
 
   
     // father

+ 75 - 0
src/views/cost-allocation-total/modal/submitInformation.vue

@@ -0,0 +1,75 @@
+<template>
+    <a-modal
+      :title="text+'信息'"
+      v-model="submitInformationModVis"
+      width="50%"
+      @ok="ok"
+      cancelText="取消"
+      @cancel="close"
+    >
+    <div>
+      
+     <a-textarea
+      v-model="value"
+      placeholder="请输入"
+      :auto-size="{ minRows: 3, maxRows: 15 }"
+    />
+    </div>
+    </a-modal>
+  </template>
+  
+  <script>
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import JEllipsis from '@/components/jeecg/JEllipsis'
+  import { downFile } from '@/api/manage'
+  export default {
+    name: 'submitInformation', // 反馈信息 弹窗
+    mixins: [JeecgListMixin],
+    components: { JEllipsis},
+    data() {
+      return {      
+        submitInformationModVis : false,
+         value:'',
+         text:''
+      }
+    },
+    watch:{
+    },
+   
+    methods: {
+        ok(){
+          this.$emit('close',this.value,this.text)
+          this.close()
+        },
+        close(){
+            this.submitInformationModVis = false
+            this.value = ''
+        }
+   },
+  }
+  </script>
+  <style lang="less" scoped>
+  @import '~@assets/less/common.less';
+  @import '~@assets/less/overwriter.less';
+  // /deep/ .ant-table-thead > tr > th {
+  //   text-align: center;
+  //   // font-weight: 700;
+  // }
+  
+  // /deep/ .ant-table-tbody {
+  //   text-align: center;
+  // }
+  //  /deep/ .ant-table-footer .ant-table-body {
+  //     overflow: hidden !important;
+  //   }
+  // /deep/ th.replacecolor {
+  //   background-color: #ccc;
+  // }
+  /deep/ .ant-modal-body {
+    height: 100% !important;
+  }
+  /deep/ .ant-modal-content{
+    overflow: auto;
+  }
+  </style>
+