qymljy преди 1 година
родител
ревизия
83f093e3ab

+ 30 - 10
src/Form/salerExpenditure/add.vue

@@ -43,7 +43,7 @@
             </el-col>
             <el-col :span="24">
               <el-form-item label="账户类型:" prop="sa_hraccountclassid">
-                <el-select v-model="form.sa_hraccountclassid" placeholder="请选择账户类型" style="width: 100%">
+                <el-select v-model="form.sa_hraccountclassid" placeholder="请选择账户类型" style="width: 100%" @change="incomeData">
                   <el-option
                       v-for="item in accountData"
                       :key="item.sa_hraccountclassid"
@@ -60,7 +60,7 @@
             </el-col>
             <el-col :span="24">
               <el-form-item label="收入凭证:" prop="source_hrcashbill">
-                <tableNewLayout :checkbox="true" :layout="income.tablecols" :data="income.list" :opwidth="200" height="400px" :width="true" :custom="true" >
+                <tableNewLayout ref="tableRef" :checkbox="true" :layout="income.tablecols" :data="income.list" :opwidth="200" height="400px" :width="true" :custom="true" @selectionChange="selectionChange">
                   <template v-slot:customcol="scope">
                     <div>
                       {{scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation'?scope.column.data[[scope.column.columnname]]:'--'}}
@@ -101,15 +101,13 @@ export default {
         "hrid": '',
         "name":'',
         "sa_hraccountclassid": "",
-        "type": "1", //1收 0支
+        "type": "0", //1收 0支
         "billdate": new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
         "class": "",
         "subclass": "",
         "remarks": "",
         "amount": "",
-        "source_hrcashbill": [  //用于建支出凭证时传选择的收入凭证信息
-
-        ]
+        "source_hrcashbill": [ ] //用于建支出凭证时传选择的收入凭证信息
       },
       rules:{
         hrid:[
@@ -119,7 +117,7 @@ export default {
           { required: true, message: '未选择账户类型', trigger: 'change'},
         ],
         source_hrcashbill:[
-          { required: true, message: '未选择收入凭证', trigger: 'change'},
+          { required: true, message: '未选择收入凭证', trigger: 'blur'},
         ],
         amount:[
           { required: true, message: '金额不可为空', trigger: 'change'},
@@ -153,6 +151,7 @@ export default {
           "content": {
             "pageNumber": 1,
             "pageSize": 999,
+            "sa_hraccountclassid":"",
             "hrid":"",
             "where": {
               "condition": ""
@@ -172,10 +171,19 @@ export default {
     },
     /*可选收入凭证*/
     async incomeData(){
+      this.income.param.content.hrid = this.form.hrid
+      this.income.param.content.sa_hraccountclassid = this.form.sa_hraccountclassid
       const res = await this.$api.requested(this.income.param)
       this.income.list = res.data
     },
-    onClose(){},
+    onClose(){
+      this.dialogVisible = false
+      this.income.list = []
+      this.form.name = ''
+      this.form.hrid = ''
+      this.$refs.tableRef.$refs.table.clearSelection()
+      this.$refs.formRef.resetFields()
+    },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
       this.param.content.pageSize = val
@@ -190,8 +198,9 @@ export default {
       this.isShow = false
       this.form.name = row.name
       this.form.hrid = row.hrid
-      this.income.param.content.hrid = row.hrid
-      this.incomeData()
+      if (this.form.sa_hraccountclassid !== ''){
+        this.incomeData()
+      }
     },
     onSubmit(){
       this.$refs.formRef.validate(async (valid)=>{
@@ -202,6 +211,8 @@ export default {
         })
         this.tool.showMessage(res,()=>{
           this.dialogVisible = false
+          this.income.list = []
+          this.$refs.tableRef.$refs.table.clearSelection()
           this.$refs.formRef.resetFields()
           this.form.name = ''
           this.form.hrid = ''
@@ -213,6 +224,15 @@ export default {
     async queryAccountType(){
       const res = await this.$api.requested(this.accountType)
       this.accountData = res.data
+    },
+    /*已选业务员*/
+    selectionChange(row){
+      this.form.source_hrcashbill =  row.map(item =>{
+        return {
+          "ownerid":item.sa_hrcashbillid,
+          "amount":item.amount
+        }
+      })
     }
   },
   mounted() {

+ 248 - 2
src/Form/salerExpenditure/edit.vue

@@ -1,10 +1,256 @@
 <template>
-
+  <div>
+    <el-button size="small" :type="data.status !== '新建'?'':'primary'"   @click="onShow(dialogVisible = true)" :disabled="data.status !== '新建'">编 辑</el-button>
+    <el-drawer
+        title="编辑支出凭证"
+        :visible.sync="dialogVisible"
+        size="600px"
+        direction="rtl"
+        append-to-body
+        @close="onClose">
+      <div class="drawer__panel">
+        <el-row :gutter="20">
+          <el-form :model="form" :rules="rules" ref="formRef" label-width="90px" label-position="right" size="mini">
+            <el-col :span="24">
+              <el-form-item label="业务员:" prop="hrid">
+                <el-popover
+                    placement="bottom"
+                    v-model="isShow"
+                    width="600"
+                    trigger="click">
+                  <tableNewLayout :layout="tablecols" :data="list" :opwidth="200" height="400px" :width="true" :custom="true" @rowClick="rowClick">
+                    <template v-slot:customcol="scope">
+                      <div>
+                        {{scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation'?scope.column.data[[scope.column.columnname]]:'--'}}
+                      </div>
+                    </template>
+                  </tableNewLayout>
+                  <div  class="container normal-panel" style="text-align:right">
+                    <el-pagination
+                        background
+                        @size-change="handleSizeChange"
+                        @current-change="handleCurrentChange"
+                        :current-page="currentPage"
+                        :page-sizes="[20, 50, 100, 200]"
+                        :page-size="20"
+                        layout="total,sizes, prev, pager, next, jumper"
+                        :total="total">
+                    </el-pagination>
+                  </div>
+                  <el-input slot="reference" v-model="form.name" placeholder="请选择业务员" readonly @focus="listData" disabled></el-input>
+                </el-popover>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="账户类型:" prop="sa_hraccountclassid">
+                <el-select v-model="form.sa_hraccountclassid" placeholder="请选择账户类型" style="width: 100%" @change="incomeData" disabled>
+                  <el-option
+                      v-for="item in accountData"
+                      :key="item.sa_hraccountclassid"
+                      :label="item.hraccountname"
+                      :value="item.sa_hraccountclassid">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="金额:" prop="amount">
+                <el-input v-model="form.amount" placeholder="请填写金额"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="收入凭证:" prop="source_hrcashbill">
+                <tableNewLayout ref="tableRef" :checkbox="false" :layout="income.tablecols" :data="income.list" :opwidth="200" height="400px" :width="true" :custom="true" @selectionChange="selectionChange">
+                  <template v-slot:customcol="scope">
+                    <div v-if="scope.column.columnname === 'amount'">
+                      {{tool.formatAmount(scope.column.data[[scope.column.columnname]],2)}}
+                    </div>
+                    <div v-else>
+                      {{scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation'?scope.column.data[[scope.column.columnname]]:'--'}}
+                    </div>
+                  </template>
+                </tableNewLayout>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="备注:" prop="remarks">
+                <el-input v-model="form.remarks" type="textarea" rows="5" placeholder="请输入备注信息"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
+        <el-button size="small" type="primary"  @click="onSubmit" class="normal-btn-width">确 定</el-button>
+      </div>
+    </el-drawer>
+  </div>
 </template>
 
 <script>
 export default {
-  name: "edit"
+  name: "edit",
+  props:['data'],
+  data(){
+    return {
+      dialogVisible:false,
+      isShow:false,
+      tablecols:[],
+      list:[],
+      currentPage:0,
+      total:0,
+      form:{
+        "sa_hrcashbillid": "0",
+        "hrid": '',
+        "name":'',
+        "sa_hraccountclassid": "",
+        "type": "0", //1收 0支
+        "billdate": new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
+        "class": "",
+        "subclass": "",
+        "remarks": "",
+        "amount": "",
+        "source_hrcashbill": [ ] //用于建支出凭证时传选择的收入凭证信息
+      },
+      rules:{
+        hrid:[
+          { required: true, message: '未选择业务员', trigger: 'change'},
+        ],
+        sa_hraccountclassid:[
+          { required: true, message: '未选择账户类型', trigger: 'change'},
+        ],
+        source_hrcashbill:[
+          { required: true, message: '未选择收入凭证', trigger: 'blur'},
+        ],
+        amount:[
+          { required: true, message: '金额不可为空', trigger: 'change'},
+          { pattern:/^[0-9]+\.{0,1}[0-9]{0,6}$/,message: '输入不合法,请输入数值',trigger: 'change'},
+        ],
+      },
+      param:{
+        "id": 20240111143104,
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where": {
+            "condition": ""
+          }
+        }
+      },
+      accountType:{
+        "id": 20240111085104,
+        "content": {
+          "pageSize": 9999,
+          "pageNumber": 1,
+          "where": {}
+        }
+      },
+      accountData:[],
+      income:{
+        tablecols:[],
+        list:[],
+        param:{
+          "id": 20240111143204,
+          "content": {
+            "pageNumber": 1,
+            "pageSize": 999,
+            "sa_hraccountclassid":"",
+            "hrid":"",
+            "where": {
+              "condition": ""
+            }
+          }
+        }
+      }
+    }
+  },
+  methods:{
+    onShow(){
+      this.form = Object.assign({},this.form,this.data)
+      this.income.list = this.data.source_hrcashbill
+    },
+    /*可选业务员*/
+    async listData(){
+      const res = await this.$api.requested(this.param)
+      this.list = res.data
+      this.currentPage = res.pageNumber
+      this.total = res.total
+    },
+    /*可选收入凭证*/
+    async incomeData(){
+      this.income.param.content.hrid = this.form.hrid
+      this.income.param.content.sa_hraccountclassid = this.form.sa_hraccountclassid
+      const res = await this.$api.requested(this.income.param)
+      this.income.list = res.data
+    },
+    onClose(){
+      this.dialogVisible = false
+      this.income.list = []
+      this.form.name = ''
+      this.form.hrid = ''
+      this.$refs.tableRef.$refs.table.clearSelection()
+      this.$refs.formRef.resetFields()
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+    rowClick(row){
+      this.isShow = false
+      this.form.name = row.name
+      this.form.hrid = row.hrid
+      if (this.form.sa_hraccountclassid !== ''){
+        this.incomeData()
+      }
+    },
+    onSubmit(){
+      console.log(this.form)
+      this.$refs.formRef.validate(async (valid)=>{
+        if (!valid) return false
+        const res = await this.$api.requested({
+          "id": 20240111085604,
+          "content": this.form
+        })
+        this.tool.showMessage(res,()=>{
+          this.dialogVisible = false
+          this.income.list = []
+          this.$refs.tableRef.$refs.table.clearSelection()
+          this.$refs.formRef.resetFields()
+          this.form.name = ''
+          this.form.hrid = ''
+          this.$emit('onSuccess')
+        })
+      })
+    },
+    /*获取账户类型*/
+    async queryAccountType(){
+      const res = await this.$api.requested(this.accountType)
+      this.accountData = res.data
+    },
+    /*已选业务员*/
+    selectionChange(row){
+      this.form.source_hrcashbill =  row.map(item =>{
+        return {
+          "ownerid":item.sa_hrcashbillid,
+          "amount":item.amount
+        }
+      })
+    }
+  },
+  mounted() {
+    this.queryAccountType()
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).salerSelectTable.tablecols
+    this.income.tablecols = this.tool.tabelCol(this.$route.name).incomeSelectTable.tablecols
+  }
 }
 </script>
 

+ 4 - 4
src/Form/salerIncome/edit.vue

@@ -1,8 +1,8 @@
 <template>
   <div>
-    <el-button size="small" type="primary"  @click="onShow(dialogVisible = true)">编 辑</el-button>
+    <el-button size="mini" :type="data.status !== '新建'?'':'primary'"  @click="onShow(dialogVisible = true)" :disabled="data.status !== '新建'">编 辑</el-button>
     <el-drawer
-        title="新建收入凭证"
+        title="编辑收入凭证"
         :visible.sync="dialogVisible"
         size="600px"
         direction="rtl"
@@ -37,13 +37,13 @@
                         :total="total">
                     </el-pagination>
                   </div>
-                  <el-input slot="reference" v-model="form.name" placeholder="请选择业务员" readonly @focus="listData"></el-input>
+                  <el-input slot="reference" v-model="form.name" placeholder="请选择业务员" readonly @focus="listData" disabled></el-input>
                 </el-popover>
               </el-form-item>
             </el-col>
             <el-col :span="24">
               <el-form-item label="账户类型:" prop="sa_hraccountclassid">
-                <el-select v-model="form.sa_hraccountclassid" placeholder="请选择账户类型" style="width: 100%">
+                <el-select v-model="form.sa_hraccountclassid" placeholder="请选择账户类型" style="width: 100%" disabled>
                   <el-option
                       v-for="item in accountData"
                       :key="item.sa_hraccountclassid"

+ 123 - 0
src/SDrpManagement/salerExpenditure/detail/components/income.vue

@@ -0,0 +1,123 @@
+<template>
+  <div>
+    <div class="flex-align-stretch">
+      <div class="mt-10">
+        <label  class="search__label">状态:</label>
+        <el-select class="inline-16" v-model="param.content.where.status" placeholder="请选择状态" @change="selectChange" size="small" clearable>
+          <el-option label="新建" value="新建"></el-option>
+          <el-option label="审核" value="审核"></el-option>
+        </el-select>
+      </div>
+      <div class="mt-10 inline-16">
+        <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>
+      </div>
+    </div>
+    <tableNewLayout :layout="tablecols" :data="list" :opwidth="200" height="calc(100vh - 376px)" :width="true" :custom="true" fixedName="operation">
+      <template v-slot:customcol="scope">
+        <div v-if="scope.column.columnname === 'remarks'">
+          {{scope.column.data.sourcenote !== '' && scope.column.data.remarks !== ''?'系统备注:' + scope.column.data.sourcenote + ';人工备注:' + scope.column.data.remarks :
+            scope.column.data.sourcenote !== ''?'系统备注:' + scope.column.data.sourcenote : scope.column.data.remarks !== ''?'人工备注:' + scope.column.data.remarks:'--'}}
+        </div>
+        <div v-else-if="scope.column.columnname === 'relaamount'">
+          {{tool.formatAmount(scope.column.data[[scope.column.columnname]],2)}}
+        </div>
+        <div v-else>
+          {{scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation'?scope.column.data[[scope.column.columnname]]:'--'}}
+        </div>
+      </template>
+      <template v-slot:opreation="scope">
+        <el-button type="text" size="mini" @click="goDetail(scope.data)">详 情</el-button>
+      </template>
+    </tableNewLayout>
+    <div  class="container normal-panel" style="text-align:right">
+      <el-pagination
+          background
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="currentPage"
+          :page-sizes="[20, 20, 100, 200]"
+          :page-size="20"
+          layout="total,sizes, prev, pager, next, jumper"
+          :total="total">
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "income",
+  data(){
+    return {
+      param:{
+        "id": 20240111090204,
+        "content": {
+          "sa_hrcashbillid":"",
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where": {
+            "condition": "",
+            "begdate":"",
+            "enddate":"",
+            "status":""
+          }
+        }
+      },
+      tablecols:[],
+      list:[],
+      total:0,
+      currentPage:0
+    }
+  },
+  methods:{
+    async listData(){
+      this.param.content.sa_hrcashbillid = this.$route.query.id
+      const res = await this.$api.requested(this.param)
+      this.list = res.data
+      this.total = res.total
+      this.currentPage = res.pageNumber
+    },
+    selectChange(){
+      this.listData()
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+    goDetail(val){
+      console.log(val)
+      this.$store.dispatch('changeDetailDrawer',false)
+      this.$nextTick(()=>{
+        let route = this.$route
+        if (route.path !== 'salerIncomeDetail') {
+          this.oldRoute = {path:route.path,query:route.query}
+          this.$store.dispatch('setHistoryRouter',this.oldRoute)
+        }
+
+        this.$router.push({
+          path:'/salerIncomeDetail',
+          query:{id:val.ownerid}
+        })
+        this.$store.dispatch('changeDetailDrawer',true)
+      })
+    }
+  },
+  mounted() {
+    this.listData()
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).incomeTable.tablecols
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 153 - 2
src/SDrpManagement/salerExpenditure/detail/index.vue

@@ -1,10 +1,161 @@
 <template>
-
+  <div>
+    <basicDetails
+        ref="details"
+        formPath="salerExpenditure"
+        turnPageId="20240111085804"
+        idname="sa_hrcashbillid"
+        ownertable="sa_hrcashbill"
+        :isBatch="false"
+        :delApiId="20240111090104"
+        :editData="mainData"
+        :mainAreaData="mainAreaData"
+        :titleText="mainData.billno"
+        @pageChange="pageChange"
+        :tabs="['收入','详细信息']"
+        @onEditSuccess="queryMainData"
+        :statusCheck="[{key:'status',value:'审核'}]"
+    >
+      <div slot="customOperation">
+        <toExamine class="inline-16" v-if="tool.checkAuth($route.name,'toExamine')" @examineSuccess="queryMainData" :status="mainData.status"></toExamine>
+      </div>
+      <div slot="slot0" class="normal-panel">
+        <income></income>
+      </div>
+      <div slot="slot1" class="normal-panel">
+        <baseInfo  :detailInfo="detailInfo"></baseInfo>
+      </div>
+    </basicDetails>
+  </div>
 </template>
 
 <script>
+import baseInfo from '@/components/baseInfo/index.vue'
+import income from './components/income.vue'
+import toExamine from './modules/toExamine.vue'
 export default {
-  name: "index"
+  name: "index",
+  components:{baseInfo,income,toExamine},
+  data(){
+    return {
+      mainData:[],
+      mainAreaData:[],
+      detailInfo:''
+    }
+  },
+  methods:{
+    async queryMainData(){
+      const res = await this.$api.requested({
+        "id": "20240111085704",
+        "content": {
+          "sa_hrcashbillid":this.$route.query.id
+        }
+      })
+      this.mainData = res.data
+      this.changeDataStructure()
+    },
+    // 监听切换数据,上一页,下一页
+    pageChange (id,rowindex) {
+      this.$router.replace({path:'/salerExpenditureDetail',query:{id:id,rowindex:rowindex}})
+      this.queryMainData(id)
+    },
+    changeDataStructure(){
+      this.mainAreaData = [
+        {
+          label:'单号',
+          value:this.mainData.billno
+        },
+        {
+          label:'账户类型',
+          value:this.mainData.hraccountname
+        },
+        {
+          label:'状态',
+          value:this.mainData.status
+        },
+        {
+          label:'业务员',
+          value:this.mainData.name
+        },
+        {
+          label:'部门',
+          value:this.mainData.depname
+        },
+        {
+          label:'金额',
+          value:this.tool.formatAmount(this.mainData.amount,2)
+        },
+        {
+          label:'备注',
+          value:this.mainData.sourcenote !== '' && this.mainData.remarks !== ''?'系统备注:' + this.mainData.sourcenote + ';人工备注:' + this.mainData.remarks : this.mainData.sourcenote !== ''?'系统备注:' + this.mainData.sourcenote :
+              this.mainData.remarks !== ''?'人工备注:' + this.mainData.remarks:'--'
+        },
+      ]
+      this.detailInfo = {
+        baseInfo: [
+          {
+            label:'单号',
+            value:this.mainData.billno
+          },
+          {
+            label:'账户类型',
+            value:this.mainData.hraccountname
+          },
+          {
+            label:'状态',
+            value:this.mainData.status
+          },
+          {
+            label:'业务员',
+            value:this.mainData.name
+          },
+          {
+            label:'部门',
+            value:this.mainData.depname
+          },
+          {
+            label:'金额',
+            value:this.tool.formatAmount(this.mainData.amount,2)
+          },
+          {
+            label:'备注',
+            value:this.mainData.sourcenote !== '' && this.mainData.remarks !== ''?'系统备注:' + this.mainData.sourcenote + ';人工备注:' + this.mainData.remarks : this.mainData.sourcenote !== ''?'系统备注:' + this.mainData.sourcenote :
+                this.mainData.remarks !== ''?'人工备注:' + this.mainData.remarks:'--'
+          },
+        ],
+        systemInfo: [
+          {
+            label:'创建人',
+            value:this.mainData.createby
+          },
+          {
+            label:'创建时间',
+            value:this.mainData.createdate
+          },
+          {
+            label:'最近编辑人',
+            value:this.mainData.changeby
+          },
+          {
+            label:'最近编辑时间',
+            value:this.mainData.changedate
+          },
+          {
+            label:'审核人',
+            value:this.mainData.checkby
+          },
+          {
+            label:'审核时间',
+            value:this.mainData.checkdate
+          },
+        ]
+      }
+
+    }
+  },
+  mounted() {
+    this.queryMainData()
+  }
 }
 </script>
 

+ 45 - 0
src/SDrpManagement/salerExpenditure/detail/modules/toExamine.vue

@@ -0,0 +1,45 @@
+<template>
+  <div>
+    <el-button size="mini" :type="status !== '新建'?'':'primary'"  @click="onExamine" :disabled="status !== '新建'">审 核</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "toExamine",
+  props:["status"],
+  data(){
+    return {
+
+    }
+  },
+  methods:{
+    onExamine(){
+      this.$confirm('确定通过当前支出凭证的审核吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        const res = await this.$api.requested({
+          "id": "20240111085904",
+          "content": {
+            "sa_hrcashbillid":this.$route.query.id
+          }
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('examineSuccess')
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消审核'
+        });
+      });
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 34 - 3
src/SDrpManagement/salerExpenditure/index.vue

@@ -4,10 +4,11 @@
         ref="basicLayout"
         formPath="salerExpenditure"
         tableName="expenditureTable"
-        idName="sa_hraccountclassid"
+        idName="sa_hrcashbillid"
         :apiId="{query:20240111085804,del:''}"
         :isExport="false"
         :autoQuery="false"
+        :detail-path="{path:'/salerExpenditureDetail'}"
     >
       <template #custom >
         <div class="mt-10">
@@ -17,9 +18,30 @@
             <el-option label="审核" value="审核"></el-option>
           </el-select>
         </div>
+        <div class="mt-10">
+          <el-date-picker
+              v-model="selectDate"
+              size="small"
+              style="margin-right: 24px!important;"
+              value-format="yyyy-MM-dd"
+              format="yyyy-MM-dd"
+              type="daterange"
+              @change="selectChange"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期">
+          </el-date-picker>
+        </div>
       </template>
       <template v-slot:tbList="scope">
-        <div>
+        <div v-if="scope.data.column.columnname === 'remarks'">
+          {{scope.data.column.data.sourcenote !== '' && scope.data.column.data.remarks !== ''?'系统备注:' + scope.data.column.data.sourcenote + ';人工备注:' + scope.data.column.data.remarks :
+            scope.data.column.data.sourcenote !== ''?'系统备注:' + scope.data.column.data.sourcenote : scope.data.column.data.remarks !== ''?'人工备注:' + scope.data.column.data.remarks:'--'}}
+        </div>
+        <div v-else-if="scope.data.column.columnname === 'amount'">
+          {{tool.formatAmount(scope.data.column.data[[scope.data.column.columnname]],2)}}
+        </div>
+        <div v-else>
           {{scope.data.column.data[[scope.data.column.columnname]] && scope.data.column.columnname !== 'operation'?scope.data.column.data[[scope.data.column.columnname]]:'--'}}
         </div>
       </template>
@@ -33,6 +55,7 @@ export default {
   data(){
     return {
       status:'',
+      selectDate:[]
     }
   },
   methods:{
@@ -41,7 +64,15 @@ export default {
       this.$refs.basicLayout.listData()
     },
     selectChange(){
-
+      this.$refs.basicLayout.param.content.where.status = this.status
+      if (this.selectDate){
+        this.$refs.basicLayout.param.content.where.begdate = this.selectDate[0]
+        this.$refs.basicLayout.param.content.where.enddate = this.selectDate[1]
+      }else {
+        this.$refs.basicLayout.param.content.where.begdate = ''
+        this.$refs.basicLayout.param.content.where.enddate = ''
+      }
+      this.listData()
     }
   },
   mounted() {

+ 36 - 2
src/SDrpManagement/salerIncome/detail/components/expenditure.vue

@@ -14,7 +14,21 @@
       </div>
     </div>
     <tableNewLayout :layout="tablecols" :data="list" :opwidth="200" height="calc(100vh - 376px)" :width="true" :custom="true" fixedName="operation">
-
+      <template v-slot:customcol="scope">
+        <div v-if="scope.column.columnname === 'remarks'">
+          {{scope.column.data.sourcenote !== '' && scope.column.data.remarks !== ''?'系统备注:' + scope.column.data.sourcenote + ';人工备注:' + scope.column.data.remarks :
+            scope.column.data.sourcenote !== ''?'系统备注:' + scope.column.data.sourcenote : scope.column.data.remarks !== ''?'人工备注:' + scope.column.data.remarks:'--'}}
+        </div>
+        <div v-else-if="scope.column.columnname === 'relaamount'">
+          {{tool.formatAmount(scope.column.data[[scope.column.columnname]],2)}}
+        </div>
+        <div v-else>
+          {{scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation'?scope.column.data[[scope.column.columnname]]:'--'}}
+        </div>
+      </template>
+      <template v-slot:opreation="scope">
+        <el-button type="text" size="mini" @click="goDetail(scope.data)">详 情</el-button>
+      </template>
     </tableNewLayout>
     <div  class="container normal-panel" style="text-align:right">
       <el-pagination
@@ -77,9 +91,29 @@ export default {
       this.param.content.pageNumber = val
       this.listData()
     },
+    goDetail(val){
+      console.log(val)
+      this.$store.dispatch('changeDetailDrawer',false)
+      this.$nextTick(()=>{
+        let route = this.$route
+        if (route.path !== 'salerExpenditureDetail') {
+          this.oldRoute = {path:route.path,query:route.query}
+          this.$store.dispatch('setHistoryRouter',this.oldRoute)
+        }
+
+        this.$router.push({
+          path:'/salerExpenditureDetail',
+          query:{id:val.ownerid}
+        })
+        this.$store.dispatch('changeDetailDrawer',true)
+      })
+    }
+  },
+  mounted() {
+    this.listData()
   },
   created() {
-    this.tablecols = this.tool.tabelCol(this.$route.name).incomeTable.tablecols
+    this.tablecols = this.tool.tabelCol(this.$route.name).expenditureTable.tablecols
   }
 }
 </script>

+ 15 - 6
src/SDrpManagement/salerIncome/detail/index.vue

@@ -6,13 +6,19 @@
         turnPageId="20240111085804"
         idname="sa_hrcashbillid"
         ownertable="sa_hrcashbill"
+        :isBatch="false"
+        :delApiId="20240111090104"
         :editData="mainData"
         :mainAreaData="mainAreaData"
         :titleText="mainData.billno"
         @pageChange="pageChange"
         :tabs="['支出','详细信息']"
+        @onEditSuccess="queryMainData"
+        :statusCheck="[{key:'status',value:'审核'}]"
     >
-
+      <div slot="customOperation">
+        <toExamine class="inline-16" v-if="tool.checkAuth($route.name,'toExamine')" @examineSuccess="queryMainData" :status="mainData.status"></toExamine>
+      </div>
       <div slot="slot0" class="normal-panel">
         <expenditure></expenditure>
       </div>
@@ -26,9 +32,10 @@
 <script>
 import baseInfo from '@/components/baseInfo/index.vue'
 import expenditure from './components/expenditure.vue'
+import toExamine from './modules/toExamine.vue'
 export default {
   name: "index",
-  components:{baseInfo,expenditure},
+  components:{baseInfo,expenditure,toExamine},
   data(){
     return {
       mainData:[],
@@ -76,11 +83,12 @@ export default {
         },
         {
           label:'金额',
-          value:this.mainData.amount
+          value:this.tool.formatAmount(this.mainData.amount,2)
         },
         {
           label:'备注',
-          value:this.mainData.remarks
+          value:this.mainData.sourcenote !== '' && this.mainData.remarks !== ''?'系统备注:' + this.mainData.sourcenote + ';人工备注:' + this.mainData.remarks : this.mainData.sourcenote !== ''?'系统备注:' + this.mainData.sourcenote :
+              this.mainData.remarks !== ''?'人工备注:' + this.mainData.remarks:'--'
         },
       ]
       this.detailInfo = {
@@ -107,11 +115,12 @@ export default {
           },
           {
             label:'金额',
-                value:this.mainData.amount
+            value:this.tool.formatAmount(this.mainData.amount,2)
           },
           {
             label:'备注',
-                value:this.mainData.remarks
+            value:this.mainData.sourcenote !== '' && this.mainData.remarks !== ''?'系统备注:' + this.mainData.sourcenote + ';人工备注:' + this.mainData.remarks : this.mainData.sourcenote !== ''?'系统备注:' + this.mainData.sourcenote :
+                this.mainData.remarks !== ''?'人工备注:' + this.mainData.remarks:'--'
           },
         ],
         systemInfo: [

+ 45 - 0
src/SDrpManagement/salerIncome/detail/modules/toExamine.vue

@@ -0,0 +1,45 @@
+<template>
+  <div>
+    <el-button size="mini" :type="status !== '新建'?'':'primary'"  @click="onExamine" :disabled="status !== '新建'">审 核</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "toExamine",
+  props:["status"],
+  data(){
+    return {
+
+    }
+  },
+  methods:{
+    onExamine(){
+      this.$confirm('确定通过当前收入凭证的审核吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        const res = await this.$api.requested({
+          "id": "20240111085904",
+          "content": {
+            "sa_hrcashbillid":this.$route.query.id
+          }
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('examineSuccess')
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消审核'
+        });
+      });
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 8 - 1
src/SDrpManagement/salerIncome/index.vue

@@ -34,7 +34,14 @@
         </div>
       </template>
       <template v-slot:tbList="scope">
-        <div>
+        <div v-if="scope.data.column.columnname === 'remarks'">
+          {{scope.data.column.data.sourcenote !== '' && scope.data.column.data.remarks !== ''?'系统备注:' + scope.data.column.data.sourcenote + ';人工备注:' + scope.data.column.data.remarks :
+            scope.data.column.data.sourcenote !== ''?'系统备注:' + scope.data.column.data.sourcenote : scope.data.column.data.remarks !== ''?'人工备注:' + scope.data.column.data.remarks:'--'}}
+        </div>
+        <div v-else-if="scope.data.column.columnname === 'amount'">
+          {{tool.formatAmount(scope.data.column.data[[scope.data.column.columnname]],2)}}
+        </div>
+        <div v-else>
           {{scope.data.column.data[[scope.data.column.columnname]] && scope.data.column.columnname !== 'operation'?scope.data.column.data[[scope.data.column.columnname]]:'--'}}
         </div>
       </template>

+ 16 - 11
src/components/normal-basic-layout/details/index.vue

@@ -101,7 +101,7 @@ import taskTemp from './modules/task/index.vue'
 import reportCenter from '../reportCenter/index'
 import {mapGetters} from 'vuex'
 export default {
-  props:['titleText','mainAreaData','turnPageId','delApiId','idname','ownertable','formPath','oldFormPath','editData','tags','tabs','statusCheck','pageChange','justsaler','mainData','status','typeTask','isGroup'],
+  props:['titleText','mainAreaData','turnPageId','delApiId','idname','ownertable','formPath','oldFormPath','editData','tags','tabs','statusCheck','pageChange','justsaler','mainData','status','typeTask','isGroup','isBatch'],
   data () {
     return {
       isTop:true,
@@ -279,17 +279,22 @@ export default {
           "id": this.delApiId,
           "content":{}
         }
-        if (this.idname instanceof Array) { //判断传入的类型是多个还是单个idname
-          let obj = {}
-          this.idname.forEach(e=>{
-            obj[e] = ''
-          })
-          param.content[`${this.idname[0]}s`] =  [Object.keys(obj).map((key,item)=>{
-            obj[key] = this.editData[key]
-          })]
-        } else {
-          param.content[`${this.idname}s`] = [this.editData[this.idname]]
+        if (this.isBatch === false){
+          param.content[`${this.idname}`] = this.editData[this.idname]
+        }else {
+          if (this.idname instanceof Array) { //判断传入的类型是多个还是单个idname
+            let obj = {}
+            this.idname.forEach(e=>{
+              obj[e] = ''
+            })
+            param.content[`${this.idname[0]}s`] =  [Object.keys(obj).map((key,item)=>{
+              obj[key] = this.editData[key]
+            })]
+          } else {
+            param.content[`${this.idname}s`] = [this.editData[this.idname]]
+          }
         }
+
         const res = await this.$api.requested(param)
         this.tool.showMessage(res,()=>{
           this.$store.dispatch('changeDetailDrawer',false)