Kaynağa Gözat

应收收款逾期调整单

qymljy 2 yıl önce
ebeveyn
işleme
f5581f637c

+ 2 - 2
src/Form/accountsOverdueAdjustment/add.vue

@@ -9,7 +9,7 @@
         :show-close="false"
         append-to-body
         @close="onClose(dialogVisible = false)">
-      <div class="drawer__panel">
+      <div class="drawer__panel" style="margin-bottom: 0 !important;">
         <el-row :gutter="20">
           <el-form :model="form" :rules="rules" ref="form" label-width="90px" label-position="right" size="mini">
             <el-col :span="12">
@@ -48,7 +48,7 @@
             </el-col>
             <el-col :span="24">
               <el-form-item label="订单行" prop="orderRow">
-                <tableTemplate :checkbox="true" ref="orderRow" :param="orderRow.param" :layout="orderRow.tablecols" height="280px" :custom="true" :width="true" @selectionChange="orderRowSelect">
+                <tableTemplate :checkbox="true" ref="orderRow" :param="orderRow.param" :layout="orderRow.tablecols" height="calc(100vh - 295px)" :custom="true" :width="true" @selectionChange="orderRowSelect">
                   <template v-slot:customcol="scope">
                     <div v-if="scope.column.columnname === 'amount'">
                       <el-input  v-model="scope.column.data.amount" autocomplete="off" placeholder="请输入" @change="orderRowChange(scope.column.data)"></el-input>

+ 4 - 2
src/SDrpManagement/accountsOverdueAdjustment/details/index.vue

@@ -23,7 +23,8 @@
             keyName="sa_overdueadjustid"
             :id="$route.query.id"
             @onSuccess="queryMainData"
-            class="inline-16"
+            :class="mainData.status == '审核'?'inline-16':''"
+            v-if="mainData.status == '新建' && tool.checkAuth($route.name,'check')"
         />
         <customBtn
             btnName="反审核"
@@ -34,10 +35,11 @@
             @onSuccess="queryMainData"
             class="inline-16"
             style="margin-right: 0 !important;"
+            v-if="mainData.status == '审核' && tool.checkAuth($route.name,'reCheck')"
         />
       </div>
       <div slot="slot0">
-        <orderRows></orderRows>
+        <orderRows :data="mainData"></orderRows>
       </div>
     </basicDetails>
   </div>

+ 129 - 0
src/SDrpManagement/accountsOverdueAdjustment/modules/addOrderRows.vue

@@ -0,0 +1,129 @@
+<template>
+  <div>
+    <el-button type="primary" size="small" @click="addShow(dialogVisible = true)" v-if="data.status === '新建'">新增</el-button>
+    <el-drawer
+        title="新建订单行"
+        :visible.sync="dialogVisible"
+        size="75%"
+        direction="rtl"
+        :show-close="false"
+        append-to-body
+        @close="onClose(dialogVisible = false)">
+      <div class="drawer__panel" style="margin-bottom: 0 !important;">
+        <tableTemplate :checkbox="true" ref="orderRow" :param="param" :layout="tablecols" height="calc(100vh - 245px)" :custom="true" :width="true" @selectionChange="orderRowSelect">
+          <template v-slot:customcol="scope">
+            <div v-if="scope.column.columnname === 'amount'">
+              <el-input  v-model="scope.column.data.amount" autocomplete="off" placeholder="请输入" @change="orderRowChange(scope.column.data)"></el-input>
+            </div>
+            <div v-else-if="scope.column.columnname === 'intoaccountdate'">
+              <el-date-picker
+                  style="width: 100%"
+                  v-model="scope.column.data.intoaccountdate"
+                  value-format="yyyy-MM-dd"
+                  format="yyyy-MM-dd"
+                  type="date"
+                  @change="orderRowChange(scope.column.data)"
+                  placeholder="选择日期">
+              </el-date-picker>
+            </div>
+            <p v-else>{{scope.column.data[scope.column.columnname]}}</p>
+          </template>
+        </tableTemplate>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="dialogVisible = false" class="normal-btn-width">取 消</el-button>
+        <el-button size="small" type="primary" @click="onSubmit" :loading="loading" class="normal-btn-width">确 定</el-button>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import tableTemplate from '@/template/tableTemplate/index'
+export default {
+  name: "addOrderRows",
+  props:['data'],
+  components:{tableTemplate},
+  data(){
+    return {
+      dialogVisible:false,
+      show:false,
+      loading:false,
+      tablecols:[],
+      param:{
+        "id": 20240319155104,
+        "content": {
+          "sa_orderid": "",
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where": {
+            "condition": ""
+          }
+        }
+      },
+      form:[],
+      orderInfo:[]
+    }
+  },
+  methods:{
+    addShow(){
+      this.param.content.sa_orderid = this.data.sa_orderid
+      this.$nextTick(()=>{
+        this.$refs.orderRow.listData()
+      })
+
+    },
+    orderRowChange(item){
+      this.orderInfo.forEach(row=>{
+        if (row.rowindex === item.rowindex){
+          row.amount = item.amount
+          row.intoaccountdate = item.intoaccountdate
+        }
+      })
+    },
+    /*可选订单行*/
+    orderRowSelect(item){
+      console.log(item)
+      this.form = item
+      this.orderInfo = []
+      this.orderInfo = this.form.map(item=>{
+        return {
+          "sa_orderitemsid": item.sa_orderitemsid,
+          "sa_overdueadjustitemsid": "0",
+          "oldintoaccountdate": item.oldintoaccountdate,
+          "point": item.point,
+          "intoaccountdate": item.intoaccountdate,
+          "ownertable": item.ownertable,
+          "ownerid": item.ownerid,
+          "amount": item.amount,
+          "rowindex":item.rowindex
+        }
+      })
+      console.log(this.orderInfo,'orderInfo')
+    },
+    async onSubmit(){
+      const res = await this.$api.requested({
+        "id": "20240319154904",
+        "content": {
+          "sa_overdueadjustid": this.$route.query.id,
+          "overdueadjustitems": this.orderInfo
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.dialogVisible = false
+        this.form = []
+        this.orderInfo = []
+        this.$emit('addSuccess')
+      })
+    },
+    onClose(){}
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).orderRowTable.tablecols
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 22 - 2
src/SDrpManagement/accountsOverdueAdjustment/modules/orderRows.vue

@@ -1,18 +1,38 @@
 <template>
   <div>
-    <tableTemplate ref="orderRow" :layout="tablecols" :param="param" height="calc(100vh - 305px)" fixedName="operation" :width="true" :custom="true">
+    <tableTemplate ref="orderRow" :layout="tablecols" :param="param" height="calc(100vh - 335px)" fixedName="operation" :width="true" :custom="true">
+      <template v-slot:add>
+        <add class="inline-16" :data="data" @addSuccess="$refs.orderRow.listData()"></add>
+      </template>
       <template v-slot:customcol="scope">
         <p >{{scope.column.data[scope.column.columnname] || scope.column.columnname === 'operation'?scope.column.data[scope.column.columnname]:'--'}}</p>
       </template>
+      <template v-slot:opreation="scope">
+        <customBtn
+            btnName="删除"
+            message="确认删除当前订单行吗?"
+            idName="20240319155004"
+            keyName="sa_overdueadjustitemsids"
+            type="text"
+            :idIsArr="true"
+            :id="scope.data.sa_overdueadjustitemsid"
+            @onSuccess="$refs.orderRow.listData()"
+            class="inline-16"
+            style="margin-right: 0 !important;"
+            :disabled="data.status === '审核'"
+        />
+      </template>
     </tableTemplate>
   </div>
 </template>
 
 <script>
 import tableTemplate from '@/template/tableTemplate/index'
+import add from '../modules/addOrderRows'
 export default {
   name: "orderRows",
-  components:{tableTemplate},
+  props:['data'],
+  components:{tableTemplate,add},
   data(){
     return {
       param:{

+ 7 - 4
src/template/tableTemplate/index.vue

@@ -1,13 +1,16 @@
 <template>
   <div>
     <!-- :header-cell-style="{background:'#EEEEEE',color:'#333'}" -->
-    <el-table ref="table" :row-class-name="tableClassName" highlight-current-row :data="list"  size="mini" :height="height ? height : list.length <= 5?'280px':'calc(100vh - 268px)'"  @row-click="rowClick" style="width:100%;" :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}"
+    <slot name="add"></slot>
+    <el-input  style="width:200px;" placeholder="搜索" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+    </el-input>
+    <el-table ref="table" :row-class-name="tableClassName" highlight-current-row :data="list"  size="mini" :height="height ? height : list.length <= 5?'280px':'calc(100vh - 268px)'"  @row-click="rowClick" style="width:100%;margin-top: 10px" :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}"
               :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}" border @selection-change="selectionChange">
       <el-table-column
           type="selection"
           width="35" fixed v-if="checkbox">
       </el-table-column>
-      <el-table-column show-overflow-tooltip v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title" :width="width ? col.width : 150" :fixed="fixedName ? fixedName.indexOf(col.columnname)!= -1?redirect ? redirect : 'right' :false : false">
+      <el-table-column ref="table" show-overflow-tooltip v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title" :width="width ? col.width : 150" :fixed="fixedName ? fixedName.indexOf(col.columnname)!= -1?redirect ? redirect : 'right' :false : false">
         <template v-slot:header="{ column,$index }" v-if="customHeader">
           <slot name="header" :data="column"></slot>
         </template>
@@ -23,7 +26,7 @@
         </template>
       </el-table-column>
     </el-table>
-    <div class="container normal-panel" style="text-align:right">
+    <div class="container normal-panel" style="text-align:right;padding-bottom: 5px !important;">
       <el-pagination
           background
           @size-change="handleSizeChange"
@@ -62,7 +65,7 @@ export default {
     })
   },
   watch:{
-    data(val){
+    list(val){
       this.doLayout()
     }
   },