浏览代码

2022-12-16 17:00

codeMan 2 年之前
父节点
当前提交
8e60fa88a1

+ 144 - 0
src/HDrpManagement/writeoffbill/components/add.vue

@@ -0,0 +1,144 @@
+<template>
+  <div>
+    <el-button size="mini" type="primary" @click="dialogFormVisible = true">新 建</el-button>
+    <el-drawer title="新 建" append-to-body :visible.sync="dialogFormVisible" size="30%">
+      <div slot="title" style="font-size: 15px">
+        新建核销单
+      </div>
+      <div class="drawer__panel">
+        <el-row>
+          <el-form :model="form" :rules="rules" ref="form" label-width="90px" label-position="right" size="mini">
+            <el-col :span="24">
+              <el-form-item label="企业:" prop="sys_enterpriseid">
+                <selectEnterprise ref="ent" @rowClick="entRowClick"></selectEnterprise>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="账户类型" prop="sa_accountclassid">
+                <el-select v-model="form.sa_accountclassid" placeholder="请选择账户类型" @change="accountChange" size="small">
+                  <el-option
+                    v-for="item in accountType"
+                    :key="item.sa_accountclassid"
+                    :label="item.accountname"
+                    :value="item.sa_accountclassid">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="凭证" prop="sa_cashbillid">
+                <selectVoucher ref="voucher" :sys_enterpriseid="form.sys_enterpriseid" :sa_accountclassid="form.sa_accountclassid" @rowClick="voucherRowClick"></selectVoucher>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="核销金额" prop="writeoffamount">
+                <el-input size="small" placeholder="请输入核销金额" v-model.number="form.writeoffamount"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="dialogFormVisible = false" 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>
+import selectEnterprise from './selectEnterprise'
+import selectVoucher from './selectVoucher'
+export default {
+  name: "add",
+  components:{selectEnterprise,selectVoucher},
+  data(){
+    return {
+      dialogFormVisible:false,
+      accountType:[],
+      form:{
+        "sa_writeoffbillid":0,
+        "sys_enterpriseid": "",
+        "sa_accountclassid": "",
+        "sa_cashbillid":"",
+        "remarks":"",
+        "writeoffamount":''  //新增时可不传
+      },
+      rules:{
+        sys_enterpriseid:[
+          { required: true, message: '请选择企业', trigger: 'blur'},
+        ],
+        sa_accountclassid:[
+          { required: true, message: '请选择账户类型', trigger: 'blur'}
+        ],
+        sa_cashbillid:[
+          { required: true, message: '请选择支出或收入凭证', trigger: 'blur'}
+        ],
+        writeoffamount:[
+          { message: '请填写正确金额', trigger: 'change',type:'number'}
+        ],
+      }
+    }
+  },
+  created () {
+    this.getAccountType()
+  },
+  watch: {
+    dialogFormVisible (val) {
+      if(!val) {
+        this.$refs.ent.form.enterprisename = ''
+        this.$refs.form.resetFields()
+      }
+    }
+  },
+  methods:{
+    onSubmit(){
+      console.log(this.form)
+      this.$refs['form'].validate(async (valid) => {
+        if (!valid) return false
+        const res = await this.$api.requested({
+          "id": "20221124090204",
+          "version":1,
+          "content": this.form
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('onSuccess')
+          this.dialogFormVisible = false
+        })
+      })
+    },
+    entRowClick (data) {
+      this.$refs.voucher.form.billno = ''
+      this.form.sa_cashbillid = ''
+      this.form.sys_enterpriseid = data.sys_enterpriseid
+    },
+    voucherRowClick (data) {
+      this.form.sa_cashbillid = data.sa_cashbillid
+    },
+    async getAccountType () {
+      let res = await this.$api.requested({
+        "id":20221124090604,
+        "content": {
+
+        }
+      })
+      this.accountType = res.data
+      console.log(this.accountType);
+      
+    },
+    accountChange (val) {
+      this.$refs.voucher.form.billno = ''
+      this.form.sa_cashbillid = ''
+    }
+  }
+}
+</script>
+
+<style scoped>
+.dialog-footer {
+  margin-top: 0;
+}
+.el-select {
+  width: 100%;
+}
+</style>

+ 45 - 0
src/HDrpManagement/writeoffbill/components/check.vue

@@ -0,0 +1,45 @@
+<template>
+  <div>
+    <el-button type="primary" size="mini" v-if="data.status == '新建' && tool.checkAuth($route.name,'check')" @click="check('审核')">审 核</el-button>
+    <el-button type="primary" size="mini" @click="check('反审核')" v-else-if="data.status == '审核' && tool.checkAuth($route.name,'reverseCheck')">反 审 核</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['data'],
+  name: '',
+  data() {
+    return {
+    };
+  },
+  computed:{
+  },
+  watch:{
+  },
+  methods: {
+    async check (title) {
+      this.$confirm(`确定${title}当前核销单吗?`,'提示',{
+        "confirmButtonText":'确定',
+        "cancelButtonText":'取消'
+      }).then( async () => {
+        let res = await this.$api.requested({
+        "id":20221124090404,
+          "content": {
+            sa_writeoffbillid:this.$route.query.id
+          }
+        })
+        this.tool.showMessage(res,() => {
+          this.$emit('onSuccess')
+        })
+      })
+
+      
+    }
+  },
+};
+</script>
+
+<style scoped>
+
+</style>

+ 157 - 0
src/HDrpManagement/writeoffbill/components/edit.vue

@@ -0,0 +1,157 @@
+<template>
+  <div>
+    <el-button size="mini" type="primary" :disabled="disabled" @click="editBtn">编 辑</el-button>
+    <el-drawer title="新 建" append-to-body :visible.sync="dialogFormVisible" size="30%">
+      <div slot="title" style="font-size: 15px">
+        编辑核销单
+      </div>
+      <div class="drawer__panel">
+        <el-row>
+          <el-form :model="form" :rules="rules" ref="form" label-width="90px" label-position="right" size="mini">
+            <el-col :span="24">
+              <el-form-item label="企业:" prop="sys_enterpriseid">
+                <selectEnterprise ref="ent" @rowClick="entRowClick"></selectEnterprise>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="账户类型" prop="sa_accountclassid">
+                <el-select v-model="form.sa_accountclassid" placeholder="请选择账户类型" @change="accountChange" size="small">
+                  <el-option
+                    v-for="item in accountType"
+                    :key="item.sa_accountclassid"
+                    :label="item.accountname"
+                    :value="item.sa_accountclassid">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="凭证" prop="sa_cashbillid">
+                <selectVoucher ref="voucher" :sys_enterpriseid="form.sys_enterpriseid" :sa_accountclassid="form.sa_accountclassid" @rowClick="voucherRowClick"></selectVoucher>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="核销金额" prop="writeoffamount">
+                <el-input size="small" placeholder="请输入核销金额" v-model.number="form.writeoffamount"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="dialogFormVisible = false" 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>
+import selectEnterprise from './selectEnterprise'
+import selectVoucher from './selectVoucher'
+export default {
+  name: "add",
+  props:['data','disabled'],
+  components:{selectEnterprise,selectVoucher},
+  data(){
+    return {
+      dialogFormVisible:false,
+      accountType:[],
+      form:{
+        "sa_writeoffbillid":0,
+        "sys_enterpriseid": "",
+        "sa_accountclassid": "",
+        "sa_cashbillid":"",
+        "remarks":"",
+        "writeoffamount":''  //新增时可不传
+      },
+      rules:{
+        sys_enterpriseid:[
+          { required: true, message: '请选择企业', trigger: 'blur'},
+        ],
+        sa_accountclassid:[
+          { required: true, message: '请选择账户类型', trigger: 'blur'}
+        ],
+        sa_cashbillid:[
+          { required: true, message: '请选择支出或收入凭证', trigger: 'blur'}
+        ],
+        writeoffamount:[
+          { message: '请填写正确金额', trigger: 'change',type:'number'}
+        ],
+      }
+    }
+  },
+  created () {
+    this.getAccountType()
+  },
+  watch: {
+    dialogFormVisible (val) {
+      if(!val) {
+        this.$refs.ent.form.enterprisename = ''
+        this.$refs.form.resetFields()
+      }
+    }
+  },
+  methods:{
+    editBtn () {
+      this.form = Object.assign({},this.form,this.data)
+      console.log(this.form);
+      
+      this.$nextTick(() => {
+        this.$refs.ent.form.enterprisename = this.form.enterprisename
+        this.$refs.voucher.form.billno = this.form.cashbillidbillno
+        console.log(this.$refs.ent.form);
+        
+      })
+      this.dialogFormVisible = true
+    },
+    onSubmit(){
+      console.log(this.form)
+      this.$refs['form'].validate(async (valid) => {
+        if (!valid) return false
+        const res = await this.$api.requested({
+          "id": "20221124090204",
+          "version":1,
+          "content": this.form
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('onSuccess')
+          this.dialogFormVisible = false
+        })
+      })
+    },
+    entRowClick (data) {
+      this.$refs.voucher.form.billno = ''
+      this.form.sa_cashbillid = ''
+      this.form.sys_enterpriseid = data.sys_enterpriseid
+    },
+    voucherRowClick (data) {
+      this.form.sa_cashbillid = data.sa_cashbillid
+    },
+    async getAccountType () {
+      let res = await this.$api.requested({
+        "id":20221124090604,
+        "content": {
+
+        }
+      })
+      this.accountType = res.data
+      console.log(this.accountType);
+      
+    },
+    accountChange (val) {
+      this.$refs.voucher.form.billno = ''
+      this.form.sa_cashbillid = ''
+    }
+  }
+}
+</script>
+
+<style scoped>
+.dialog-footer {
+  margin-top: 0;
+}
+.el-select {
+  width: 100%;
+}
+</style>

+ 114 - 0
src/HDrpManagement/writeoffbill/components/selectEnterprise.vue

@@ -0,0 +1,114 @@
+<template>
+  <div>
+    <el-popover
+      placement="bottom"
+      width="100%"
+      v-model="visible">
+      <div>
+        <div class="flex-align-center flex-between" style="margin-bottom:10px">
+          <el-input style="width:200px" suffix-icon="el-icon-search" size="small" v-model="params.content.where.condition" placeholder="输入企业信息" @keyup.enter.native="queryEnterpriseArchives(params.content.pageNumber = 1)" @clear="queryEnterpriseArchives(params.content.pageNumber = 1)" clearable></el-input>
+        </div>
+        <el-table
+          :data="ENlist"
+          size="small"
+          stripe
+          style="width: 100%"
+          height="300"
+          border>
+          <el-table-column
+            prop="enterprisename"
+            label="企业名称"
+            width="180">
+          </el-table-column>
+          <el-table-column
+            prop="contact"
+            label="联系人"
+            width="180">
+          </el-table-column>
+          <el-table-column
+            prop="phone"
+            label="联系电话">
+          </el-table-column>
+          <el-table-column>
+            <template slot-scope="scope">
+              <el-button size="mini" type="text" @click="rowClick(scope.row)">选 择</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <div style="margin-top:16px;text-align:right">
+          <el-pagination
+            background
+            small
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-size="params.content.pageSize"
+            layout="total, prev, pager, next, jumper"
+            :total="total">
+          </el-pagination>
+        </div>
+      </div>
+      <el-input :validate-event="false" slot="reference" v-model="form.enterprisename" @focus="queryEnterpriseArchives"  placeholder="输入企业名称" readonly></el-input>
+    </el-popover>
+  </div>
+</template>
+
+<script>
+export default {
+  components:{
+  },
+  data () {
+    return {
+      ENlist:[],
+      total:0,
+      currentPage:0,
+      form:{
+        enterprisename:''
+      },
+      params:{
+        "id": 20221124090504,
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 10,
+          "where": {
+            "condition": '',
+          },
+        }
+      },
+      visible:false
+    }
+  },
+  methods:{
+    async queryEnterpriseArchives () {
+      const res = await this.$api.requested(this.params)
+      this.ENlist = res.data
+      this.total = res.total
+      this.currentPage = res.pageNumber
+    },
+    handleSizeChange(val) {
+      this.params.content.pageSize = val
+      this.queryEnterpriseArchives()
+    },
+    handleCurrentChange(val) {
+      this.params.content.pageNumber = val
+      this.queryEnterpriseArchives()
+    },
+    rowClick (row) {
+      this.visible = false
+      this.form.enterprisename = row.enterprisename
+      this.$emit('rowClick',row)
+    },
+    onSuccess () {
+      this.queryEnterpriseArchives()
+      this.form.enterprisename = this.ENlist[0].enterprisename
+      this.$emit('rowClick',this.ENlist[0])
+    }
+  },
+  mounted () {
+    // this.queryEnterpriseArchives()
+  }
+}
+
+</script>
+<style>
+</style>

+ 143 - 0
src/HDrpManagement/writeoffbill/components/selectVoucher.vue

@@ -0,0 +1,143 @@
+<template>
+  <div>
+    <el-popover
+      placement="bottom"
+      width="100%"
+      v-model="visible">
+      <div>
+        <div class="flex-align-center flex-between" style="margin-bottom:10px">
+          <el-input style="width:200px" suffix-icon="el-icon-search" size="small" v-model="params.content.where.condition" placeholder="输入凭证信息" @keyup.enter.native="queryEnterpriseArchives(params.content.pageNumber = 1)" @clear="queryEnterpriseArchives(params.content.pageNumber = 1)" clearable></el-input>
+        </div>
+        <el-table
+          :data="ENlist"
+          size="small"
+          stripe
+          style="width: 100%"
+          height="300"
+          border>
+          <el-table-column
+            prop="billno"
+            label="凭证单号"
+            width="180">
+          </el-table-column>
+          <el-table-column
+            prop="accountname"
+            label="账户类型"
+            width="180">
+          </el-table-column>
+          <!-- <el-table-column
+            prop="billno"
+            label="经销商">
+          </el-table-column> -->
+          <el-table-column
+            prop="amount"
+            label="支出金额">
+          </el-table-column>
+          <el-table-column
+            prop="source"
+            label="凭证来源">
+          </el-table-column>
+          <el-table-column
+            prop="status"
+            label="状态">
+          </el-table-column>
+          <el-table-column>
+            <template slot-scope="scope">
+              <el-button size="mini" type="text" @click="rowClick(scope.row)">选 择</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <div style="margin-top:16px;text-align:right">
+          <el-pagination
+            background
+            small
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-size="params.content.pageSize"
+            layout="total, prev, pager, next, jumper"
+            :total="total">
+          </el-pagination>
+        </div>
+      </div>
+      <el-input :validate-event="false" :disabled="!sys_enterpriseid || !sa_accountclassid" slot="reference" v-model="form.billno" @focus="queryEnterpriseArchives"  placeholder="请选择支出或收入凭证"></el-input>
+    </el-popover>
+  </div>
+</template>
+
+<script>
+import { log } from '@antv/g2plot/lib/utils'
+export default {
+  props:['sys_enterpriseid','sa_accountclassid'],
+  components:{
+  },
+  data () {
+    return {
+      ENlist:[],
+      total:0,
+      currentPage:0,
+      form:{
+        billno:''
+      },
+      params:{
+        "id": 20221124090704,
+        "content": {
+            "pageNumber": 1,
+            "pageSize": 20,
+            "sys_enterpriseid":1,
+            "sa_accountclassid":9,
+            "where": {
+                "condition": ""
+            }
+        }
+      },
+      visible:false
+    }
+  },
+  watch: {
+    sa_accountclassid (val) {
+      if( this.form.sa_accountclassid != this.sa_accountclassid && this.sys_enterpriseid) {
+        this.queryEnterpriseArchives()
+      }
+    }
+  },
+  methods:{
+    async queryEnterpriseArchives () {
+      if (!this.sa_accountclassid || !this.sys_enterpriseid) return
+      if(this.params.content.sa_accountclassid == this.sa_accountclassid && this.params.content.sys_enterpriseid == this.sys_enterpriseid) return
+      this.params.content.sa_accountclassid = this.sa_accountclassid
+      this.params.content.sys_enterpriseid = this.sys_enterpriseid
+      const res = await this.$api.requested(this.params)
+      this.ENlist = res.data
+      this.total = res.total
+      console.log(this.ENlist);
+      
+      this.currentPage = res.pageNumber
+    },
+    handleSizeChange(val) {
+      this.params.content.pageSize = val
+      this.queryEnterpriseArchives()
+    },
+    handleCurrentChange(val) {
+      this.params.content.pageNumber = val
+      this.queryEnterpriseArchives()
+    },
+    rowClick (row) {
+      this.visible = false
+      this.form.billno = row.billno
+      this.$emit('rowClick',row)
+    },
+    onSuccess () {
+      this.queryEnterpriseArchives()
+      this.form.billno = this.ENlist[0].billno
+      this.$emit('rowClick',this.ENlist[0])
+    }
+  },
+  mounted () {
+    // this.queryEnterpriseArchives()
+  }
+}
+
+</script>
+<style>
+</style>

+ 53 - 0
src/HDrpManagement/writeoffbill/index.vue

@@ -0,0 +1,53 @@
+
+<template>
+  <div>
+    <basicLayout 
+      ref="basicLayout" 
+      :oldFormPath="{
+        add:'HDrpManagement/writeoffbill/components'
+      }"
+      tableName="writeoffbillTable" 
+      idName="sa_writeoffbillid" 
+      :apiId="{query:20221124090104,del:20221124090304}"
+      :options="options"
+      :detailPath="{
+        path:'/writeoffbillDetail'
+      }"
+      @listData="listData">
+      <div slot="custom"></div>
+      <template v-slot:tbList="scope">
+        <div v-if="scope.data.column.columnname == 'status'">
+          <span style="color:#333333" v-if="scope.data.column.data[[scope.data.column.columnname]] == '新建'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
+          <span style="color:#3874f6" v-else-if="scope.data.column.data[[scope.data.column.columnname]] == '审核'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
+        </div>
+        <div v-else>
+          {{scope.data.column.data[[scope.data.column.columnname]]}}
+        </div>
+        <div v-if="!scope.data.column.data[[scope.data.column.columnname]] && scope.data.column.data[[scope.data.column.columnname]] !== 0">--</div>
+      </template>
+      <template v-slot:tbOpreation="scope">
+      </template>
+    </basicLayout>
+  </div>
+</template>
+
+<script>
+import { log } from '@antv/g2plot/lib/utils'
+export default {
+  data () {
+    return {
+      options:[]
+      
+    }
+  },
+  methods:{
+    listData (data) {
+      console.log(data);
+      
+    }
+  }
+}
+
+</script>
+<style>
+</style>

+ 217 - 0
src/HDrpManagement/writeoffbill/modules/detail.vue

@@ -0,0 +1,217 @@
+<template>
+  <div>
+    <basicDetails
+        ref="details"
+        :titleText="mainData.writeoffbillidbillno"
+        :editData="mainData"
+        :mainAreaData="mainAreaData"
+        turnPageId="20221124090104"
+        idname="sa_writeoffbillid"
+        ownertable="sa_writeoffbill"
+        delApiId="20221124090304"
+        :statusCheck="[{key:'status',value:'审核'}]"
+        tags=""
+        :tabs="['订单','详细信息']"
+        @pageChange="pageChange"
+
+        @onEditSuccess="queryMainData($route.query.id)">
+      <div slot="tags">
+      </div>
+      <div slot="customOperation" >
+        <edit class="inline-16" :disabled="isUse" :data="mainData" @onSuccess="queryMainData" v-if="tool.checkAuth($route.name,'update')"></edit>
+        <check :disabled="isUse" class="inline-16" v-if="mainData" @onSuccess="queryMainData" :data="mainData"/>
+        <calc :disabled="isUse" v-if="tool.checkAuth($route.name,'calc')" class="inline-16" @onSuccess="queryMainData;$refs.orderTable.listData()"/>
+      </div>
+      <div slot="slot0" >
+        <order-table ref="orderTable" @onSuccess="queryMainData" v-if="mainData">
+          <add-order :disabled="isUse" v-if="tool.checkAuth($route.name,'addOrder')" slot="addOrder" :data="mainData" @onSuccess="$refs.orderTable.listData()"></add-order>
+          <template v-slot:editOrder="scope">
+              <el-button class="inline-16" :disabled="isUse" v-if="tool.checkAuth($route.name,'editOrder')" type="text" size="mini" @click="$refs.orderTable.currentItem=scope.data">编 辑</el-button>
+          </template>
+          <template v-slot:delOrder="scope">
+            <Del :data="scope.data" v-if="tool.checkAuth($route.name,'delOrder')" @onSuccess="$refs.orderTable.listData()" :disabled="isUse"></Del>
+          </template>
+        </order-table>
+      </div>
+      <div slot="slot1" >
+        <base-info v-if="detailInfo" :detailInfo="detailInfo"></base-info>
+      </div>
+    </basicDetails>
+  </div>
+</template>
+
+<script>
+import BaseInfo from '@/HDrpManagement/projectChange/modules/modules/baseInfo/baseInfo'
+import check from '../components/check'
+import edit from '../components/edit'
+import orderTable from './order/index'
+import calc from './order/calc'
+import addOrder from './order/addOrder'
+import Del from './order/delete'
+export default {
+  name: "detail",
+  data() {
+    return {
+      mainData:'',
+      mainAreaData:{},
+      detailInfo:'',
+      /* 是否能操作 */
+      isUse:false,
+    }
+  },
+  components:{
+    BaseInfo,
+    check,
+    orderTable,
+    addOrder,
+    calc,
+    edit,
+    Del
+  },
+  watch: {
+    mainData: {
+      handler (val) {
+        val.status == '新建' ? this.isUse = false : this.isUse = true
+      },
+      immediate:true
+    }
+  },
+  methods:{
+    async queryMainData(id) {
+      const res = await this.$api.requested({
+        "id":20221124090804,
+        "content": {
+          "sa_writeoffbillid": this.$route.query.id
+        }
+      })
+      this.mainData = res.data[0]
+      console.log(this.mainData);
+      this.changeDataStructure()
+    },
+    changeDataStructure() {
+      let that = this
+      this.mainAreaData = [
+        {
+          label:'核销单号',
+          value:this.mainData.writeoffbillidbillno
+        },
+        {
+          label:'凭证单号',
+          value:this.mainData.cashbillidbillno
+        },
+        {
+          label:'企业名称',
+          value:this.mainData.enterprisename
+        },
+        {
+          label:'账户类型',
+          value:this.mainData.accountname
+        },
+        
+        {
+          label:'未核销金额',
+          value:this.mainData.unwriteoffamount
+        },
+        {
+          label:'本次核销金额',
+          value:this.mainData.writeoffamount
+        },
+        {
+          label:'创建人',
+          value:this.mainData.createby
+        },
+        {
+          label:'审核人',
+          value:this.mainData.checkby
+        },
+        {
+          label:'状态',
+          value:this.mainData.status,
+          style:function () {
+            let style = {}
+            switch (that.mainData.status) {
+              case '审核':
+                style = {color: '#3874f6'}
+                break;
+              case '新建':
+                style = {color: '#333333'}
+                break;
+              default:
+                break;
+            }
+            return style
+          }
+        },
+      ],
+      this.detailInfo = {
+        baseInfo: [
+          {
+            label:'核销单号',
+            value:this.mainData.writeoffbillidbillno
+          },
+          {
+            label:'凭证单号',
+            value:this.mainData.cashbillidbillno
+          },
+          {
+            label:'企业名称',
+            value:this.mainData.enterprisename
+          },
+          {
+            label:'账户类型',
+            value:this.mainData.accountname
+          },
+          
+          {
+            label:'未核销金额',
+            value:this.mainData.unwriteoffamount
+          },
+          {
+            label:'本次核销金额',
+            value:this.mainData.writeoffamount
+          },
+          {
+            label:'创建人',
+            value:this.mainData.createby
+          },
+          {
+            label:'审核人',
+            value:this.mainData.checkby
+          },
+          {
+            label:'状态',
+            value:this.mainData.status
+          },
+        ],
+        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},
+        ]
+      }
+    },
+    // 监听切换数据,上一页,下一页
+    pageChange (id,rowindex) {
+      this.$router.replace({path:'/writeoffbillDetail',query:{id:id,rowindex:rowindex}})
+      this.queryMainData(id)
+    },
+    onSuccess(){
+      this.visible = false
+      this.queryMainData(this.$route.query.id)
+      this.$emit('onSuccess')
+    }
+  },
+  mounted () {
+    this.queryMainData(this.$route.query.id)
+  },
+  created() {
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 140 - 0
src/HDrpManagement/writeoffbill/modules/order/addOrder.vue

@@ -0,0 +1,140 @@
+<template>
+  <div>
+    <el-button size="mini" type="primary" :disabled="disabled" @click="dialogFormVisible = true">添 加</el-button>
+    <el-drawer append-to-body :visible.sync="dialogFormVisible" size="60%">
+      <div slot="title" style="font-size: 15px">
+        添加订单
+      </div>
+      <div class="drawer__panel">
+        <el-input style="width:250px;margin-bottom:10px" size="small" placeholder="请输入搜索内容" clearable @clear="getOrderList(params.content.pageNumber=1)" v-model="params.content.where.condition" @keyup.enter.native="getOrderList(params.content.pageNumber=1)"></el-input>
+        <selectOrder ref="table" v-model="result" :layout="tablecols" :data="orderList" :custom="true" height="500px"  @upDateData="upDateData">
+          <template v-slot:customcol="scope">
+              <div v-if="scope.column.columnname=='cover'">
+                <previewImage style="width:38px;height:38px;margin:0px" v-if="scope.column.data.attinfos[0] && scope.column.data.attinfos[0].url"  :image="scope.column.data.attinfos[0]" :deletebtn="false"></previewImage>
+              </div>
+              <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
+          </template>
+        </selectOrder>
+        <div class="container normal-panel" style="text-align:right">
+          <el-pagination
+              style="text-align:right"
+              background
+              small
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="params.content.pageNumber"
+              :page-sizes="[20, 50, 100, 200]"
+              layout="total,sizes, prev, pager, next, jumper"
+              :total="total">
+          </el-pagination>
+        </div>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="dialogFormVisible = false" 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>
+import selectOrder from './selectOrder'
+import { log } from '@antv/g2plot/lib/utils'
+export default {
+  name: "add",
+  props:['data','disabled'],
+  components:{selectOrder},
+  data(){
+    return {
+      result:[],
+      dialogFormVisible:false,
+      orderList:[],
+      tablecols:[],
+      total:0,
+      params: {
+        "id": 20221124091104,
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 20,
+          "sys_enterpriseid":'',
+          "sa_accountclassid":'',
+          "sa_writeoffbillid":'',
+          "where": {
+              "condition": ""
+          }
+        }
+      }
+    }
+  },
+  created () {
+    this.getOrderList()
+    this.tablecols = this.tool.tabelCol(this.$route.name).addOrderTable.tablecols
+  },
+  watch: {
+    dialogFormVisible (val) {
+      if(!val) {
+        this.$refs.table.allArr = []
+      }
+    }
+  },
+  methods:{
+    async onSubmit(){
+      let result = this.$refs.table.allArr.map(item => {
+        return {
+          "sa_writeoffbill_orderid": 0,
+          "sa_orderid":item.sa_orderid,
+          "sa_orderitemsid":item.sa_orderitemsid,
+          "writeoffamount":0,
+          "remarks":""
+        }
+      })
+      const res = await this.$api.requested({
+        "id": "20221124090904",
+        "version":1,
+        "content": {
+          sa_writeoffbillid:this.$route.query.id,
+          writeoffbillOrder:result
+        }
+      })
+      console.log(res,'新增结果');
+      
+      this.tool.showMessage(res,()=>{
+        this.$emit('onSuccess')
+        this.dialogFormVisible = false
+      })
+    },
+    async getOrderList () {
+      this.params.content.sys_enterpriseid = this.data.sys_enterpriseid
+      this.params.content.sa_accountclassid = this.data.sa_accountclassid
+      this.params.content.sa_writeoffbillid = this.data.sa_writeoffbillid
+      let res = await this.$api.requested(this.params)
+      this.orderList = res.data
+      this.total = res.total
+      console.log(res);
+      
+    },
+    upDateData (data) {
+
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.params.content.pageSize = val
+      this.getOrderList()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.params.content.pageNumber = val
+      this.getOrderList()
+    },
+  }
+}
+</script>
+
+<style scoped>
+.dialog-footer {
+  margin-top: 0;
+}
+.el-select {
+  width: 100%;
+}
+</style>

+ 44 - 0
src/HDrpManagement/writeoffbill/modules/order/calc.vue

@@ -0,0 +1,44 @@
+<template>
+  <div>
+    <el-button type="primary" size="mini" :disabled="disabled" @click="calc">分 摊</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['disabled'],
+  name: '',
+  data() {
+    return {
+    };
+  },
+  computed:{
+  },
+  watch:{
+  },
+  methods: {
+    async calc () {
+      this.$confirm(`确定分摊计算当前核销单吗?`,'提示',{
+        "confirmButtonText":'确定',
+        "cancelButtonText":'取消'
+      }).then( async () => {
+        let res = await this.$api.requested({
+        "id":20221125113104,
+          "content": {
+            sa_writeoffbillid:this.$route.query.id
+          }
+        })
+        this.tool.showMessage(res,() => {
+          this.$emit('onSuccess')
+        })
+      })
+
+      
+    }
+  },
+};
+</script>
+
+<style scoped>
+
+</style>

+ 42 - 0
src/HDrpManagement/writeoffbill/modules/order/delete.vue

@@ -0,0 +1,42 @@
+<template>
+  <div class="inline-16">
+    <el-popconfirm title="确定删除当前订单吗?" @confirm="deleteRow()">
+      <el-button slot="reference" type="text" size="mini" :disabled="disabled">删 除</el-button>
+    </el-popconfirm>
+  </div>
+</template>
+
+<script>
+import { log } from '@antv/g2plot/lib/utils'
+/* 
+id:数据id
+nameId:接口id
+nameKey:接口字段
+ */
+export default {
+  props: ['disabled','data'],
+  data () {
+    return {
+
+    }
+  },
+  methods: {
+    async deleteRow() {
+      let res = await this.$api.requested({
+        "id": 20221124091004,
+        "content": {
+            "sa_writeoffbillid":this.$route.query.id,
+            "sa_writeoffbill_orderids":[this.data.sa_writeoffbill_orderid]
+        }
+      })
+      this.tool.showMessage(res,() => {
+        this.$emit('onSuccess')
+      })
+    },
+  },
+  created () {
+    this.$emit('deleteCreate',this.param)
+  }
+}
+
+</script>

+ 145 - 0
src/HDrpManagement/writeoffbill/modules/order/index.vue

@@ -0,0 +1,145 @@
+
+<template>
+  <div>
+    <div style="display:flex;align-items:center">
+      <el-input
+          placeholder="请输入搜索内容"
+          suffix-icon="el-icon-search"
+          v-model="params.content.where.condition"
+          style="width:200px"
+          size="small"
+          class="input-with-select inline-16"
+          @keyup.native.enter="listData(params.content.pageNumber=1)"
+          @clear="clearData"
+          clearable>
+      </el-input>
+      <slot name="addOrder"></slot>
+    </div>
+    <div style="margin-top: 15px">
+      <tableLayout :layout="tablecols" :data="list" :opwidth="200"  :custom="true" :width="true"  :height="tableHieght" fixedName="operation writeoffamount unwriteoffamount">
+        <template v-slot:customcol="scope">
+          <div v-if="scope.column.columnname == 'writeoffamount'">
+            <el-input size="small" v-if="currentItem.sa_writeoffbill_orderid == scope.column.data.sa_writeoffbill_orderid" v-model="scope.column.data.writeoffamount"></el-input>
+            <span v-else>{{scope.column.data.writeoffamount}}</span>
+          </div>
+          <p v-else>{{scope.column.data[scope.column.columnname]}}</p>
+          <p v-if="!scope.column.data[scope.column.columnname] && scope.column.data[scope.column.columnname] !== 0 && scope.column.columnname != 'operation'">--</p>
+        </template>
+        <template v-slot:opreation="scope">
+          <el-button type="text" size="mini" @click="save(scope.data)" v-if="currentItem.sa_writeoffbill_orderid == scope.data.sa_writeoffbill_orderid">保 存</el-button>
+          <slot name="editOrder" :data="scope.data" v-else></slot>
+          <slot name="delOrder" :data="scope.data"></slot>
+        </template>
+      </tableLayout>
+    </div>
+    <div style="margin-top:16px;text-align:right">
+      <el-pagination
+          background
+          small
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="params.content.pageNumber"
+          :page-size="params.content.pageSize"
+          layout="total, prev, pager, next, jumper"
+          :total="total">
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+import { log } from '@antv/g2plot/lib/utils'
+export default {
+  props:["data"],
+  data () {
+    return {
+      tableHieght:"600px",
+      tablecols:[],
+      list:[],
+      total:0,
+      search:'',
+      params:{
+        "id": 20221208091504,
+        "version": 1,
+        "content": {
+            "nocache": true,
+            "pageNumber": 1,
+            "pageSize":20,
+            "sa_writeoffbillid": '',
+            "where": {
+                "condition": ""
+            }
+        },
+      },
+      options:[
+      ],
+      productList:'',
+      /* 当前正在编辑的数据信息 */
+      currentItem:''
+    }
+  },
+  provide () {
+    return {
+    }
+  },
+  methods:{
+    async save (data) {
+      let res = await this.$api.requested({
+        "id":20221124090904,
+        "content": {
+          sa_writeoffbillid:this.$route.query.id,
+          writeoffbillOrder: [
+            {
+              "sa_writeoffbill_orderid": data.sa_writeoffbill_orderid,
+                "sa_orderid":data.sa_orderid,
+                "sa_orderitemsid":data.sa_orderitemsid,
+                "writeoffamount":data.writeoffamount,
+                "remarks":""
+            }
+          ]
+        }
+      })
+      console.log(res);
+      this.tool.showMessage(res,() => {
+        this.$emit('onSuccess')
+        this.listData()
+        this.currentItem = ''
+      })
+    },
+    async listData(){
+      this.params.content.sa_writeoffbillid = this.$route.query.id
+      const res = await this.$api.requested(this.params)
+      this.list = res.data
+      this.total = res.total
+      console.log(this.list)
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.params.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.params.content.pageNumber = val
+      this.listData()
+    },
+    clearData(){
+      this.search = ""
+      this.params.content.where.condition = this.search
+      this.listData()
+    },
+    queryClick(){
+      this.params.content.where.condition = this.search
+      this.listData()
+    }
+  },
+  created() {
+    this.listData()
+    this.tablecols = this.tool.tabelCol(this.$route.name).writeOffOrderTable.tablecols
+  }
+}
+
+</script>
+<style scoped>
+
+</style>

+ 95 - 0
src/HDrpManagement/writeoffbill/modules/order/selectOrder.vue

@@ -0,0 +1,95 @@
+<template>
+  <div>
+    <el-table ref="tables"  @select="aaaa" @select-all="selectAll" v-loading="loading" highlight-current-row :data="data" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini" :height="height" style="width:100%"  border>
+        <el-table-column
+        type="selection"
+        width="45"
+        align="center"
+        fixed>
+      </el-table-column>
+      <el-table-column v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title" :width="col.width" :fixed="col.columnname === fixedName?'right':false">
+        <template slot-scope="scope">
+          <!-- 自定义表格显示内容 -->
+          <slot v-if="custom" name="customcol" :column="{data:scope.row,columnname:col.columnname}"></slot>
+          <!-- 否则就是默认 -->
+          <span v-else>{{scope.row[col.columnname]}}</span>
+          <!-- 操作结构内容 -->
+          <slot v-if="col.columnname === 'operation'" name="opreation" :data="scope.row"></slot>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import {mapGetters} from "vuex"
+export default {
+  /*
+    layout:表结构数据;
+    data:表渲染数据;
+    custom:是否启用自定义结构;
+    opwidth:操作列宽度
+  */
+  props:['layout','data','custom','height','fixedName','idName'],
+  data () {
+    return {
+      list:[],
+      allArr:[]
+    }
+  },
+  computed:{
+    ...mapGetters({
+      loading:'loading'
+    })
+  },
+  watch: {
+    data (val) {
+      console.log(val);
+      
+      this.data.forEach((row) => {
+        this.allArr.forEach(item => {
+          if (row.sa_orderitemsid == item.sa_orderitemsid) {
+            this.$nextTick(() => {
+              this.$refs["tables"].toggleRowSelection(row, true);
+            })
+          }
+        })
+      });    
+    },
+    allArr (val) {
+      this.$emit('upDateData',val)
+    }
+  },
+  methods:{
+    aaaa(e,a) {
+      let index = this.allArr.findIndex(v=>v.sa_orderitemsid == a.sa_orderitemsid)
+      if(index == -1) {
+        this.allArr.push(a)
+      } else {
+        this.allArr.splice(index,1)
+      }
+      console.log(this.allArr);
+      
+    },
+    selectAll (val) {
+      if (val.length == 0) {
+        this.data.forEach(item => {
+          this.allArr.splice(item,1)
+        })
+      } else {
+        val.forEach(item => {
+          let res = this.allArr.every(item2 => item.sa_orderitemsid != item2.sa_orderitemsid)
+          res ? this.allArr.push(item) : ''
+        })
+      }
+    },
+  },
+}
+
+</script>
+<style scoped>
+
+/deep/.el-table__header .DisableSelection > .cell {
+  display: none !important;
+}
+</style>

+ 2 - 2
src/components/normal-basic-layout/index.vue

@@ -51,8 +51,8 @@
            
             <template v-slot:opreation="scope">
               <drawerTemp class="inline-16" v-if="detailPath" :data="scope.data" :detailPath="detailPath" :idName="idName" @onSuccess="listData"></drawerTemp>
-
-              <reportCenter class="inline-16" :data="reportCenterLsit" v-if="reportCenterLsit.length > 0">
+              <!--systemappid != 163 排除报表应用-->
+              <reportCenter class="inline-16" :data="reportCenterLsit" v-if="reportCenterLsit.length > 0 && systemappid != 163">
                 <template v-slot:print="scope2">
                   <el-button @click="printBtn(scope.data,scope2.data)" type="text" size="mini">打 印</el-button>
                 </template>

+ 0 - 1
src/components/normal-basic-layout/modules/cpEdit.vue

@@ -28,7 +28,6 @@ export default {
     }
   },
   mounted () {
-    
   }
 }
 

+ 21 - 0
src/router/HDrpManagement.js

@@ -478,6 +478,27 @@ const HDrpManagement = [
         component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/contractModel/modules/detail')
       },
     ]
+  },{
+    path: '/writeoffbill',
+    name:'writeoffbill',
+    meta: {
+      title: '订单核销',
+      ast_nav: true,
+      keeproute: true,
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/writeoffbill/index'),
+    children: [
+      {
+        path: '/writeoffbillDetail',
+        name:'writeoffbill',
+        meta: {
+          title: '详情',
+          ast_nav: true,
+          keeproute: true,
+        },
+        component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/writeoffbill/modules/detail')
+      },
+    ]
   },
   
 ];