user5 hace 3 años
padre
commit
a07158c857

+ 116 - 0
src/views/modules/reimbursementSys/wuHanReimbursementForm.vue

@@ -0,0 +1,116 @@
+<template>
+  <el-dialog
+    :title="title"
+    :close-on-click-modal="false"
+     v-dialogDrag
+    :visible.sync="visible">
+    <el-form size="small" :model="inputForm" ref="inputForm" @keyup.enter.native="doSubmit()"
+             label-width="120px" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'" @submit.native.prevent>
+      <el-row :gutter="15">
+        <el-col :span="12">
+          <el-form-item label="随机业务编码" prop="randomType">
+            <el-radio-group v-model="inputForm.randomType" @change="changeRadio(inputForm.randomType)">
+              <el-radio label="1">是</el-radio>
+              <el-radio label="0">否</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12"  v-if="this.isShow">
+          <el-form-item label="业务编码" prop="businessCode" :rules=" [{required: true ,max: 50, message: '业务编号不能为空', trigger: 'blur'}]">
+            <el-input v-model="inputForm.businessCode" placeholder="业务编码"></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" v-if="method != 'view'" type="primary" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+  import ReimbursementSys from '@/api/reimbursementSys/wuHanReimbursementSysService'
+  export default {
+    data () {
+      return {
+        isShow: false,
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          id: '',
+          name: '',
+          randomType: '',
+          parent: {
+            id: ''
+          },
+          businessCode: '' // 业务编码
+        }
+      }
+    },
+    reimbursementSys: null,
+    created () {
+      this.reimbursementSys = new ReimbursementSys()
+    },
+    methods: {
+      init (method, obj) {
+        this.method = method
+        if (method === 'editBusiness') {
+          this.title = '修改业务编码'
+        } else if (method === 'view') {
+          this.title = '查看业务编码'
+        }
+        this.visible = true
+        this.$nextTick(() => {
+          this.$refs['inputForm'].resetFields()
+          this.inputForm.id = obj.id
+          this.inputForm.parent.id = obj.parent.id
+          this.inputForm.parent.name = obj.parent.name
+          if (method === 'editBusiness' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.reimbursementSys.queryBusinessById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              if (this.inputForm.randomType === '1') {
+                this.isShow = false
+              } else {
+                this.isShow = true
+              }
+              this.loading = false
+            })
+          }
+        })
+      },
+      changeRadio (randomType) {
+        if (randomType === '1') {
+          this.isShow = false
+        } else {
+          this.isShow = true
+        }
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            this.reimbursementSys.saveBusiness(this.inputForm).then(({data}) => {
+              this.loading = false
+              this.$message({
+                message: '操作成功',
+                type: 'success',
+                duration: 1500
+              })
+              this.visible = false
+              this.$emit('refreshDataList')
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      }
+    }
+  }
+</script>

+ 92 - 0
src/views/modules/reimbursementSys/wuHanReimbursementGatheringTimeForm.vue

@@ -0,0 +1,92 @@
+<template>
+  <el-dialog
+    :title="title"
+    :close-on-click-modal="false"
+     v-dialogDrag
+    :visible.sync="visible">
+    <el-form size="small" :model="inputForm" ref="inputForm" @keyup.enter.native="doSubmit()"
+             label-width="80px" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'" @submit.native.prevent>
+      <el-row :gutter="15">
+
+        <el-col :span="12">
+          <el-form-item label="收款日期" prop="gatheringTime"
+                        :rules="[
+                  {required: true, message:'收款日期不能为空', trigger:'blur'}
+                 ]">
+            <el-date-picker
+              style="width: 100%;"
+              v-model="inputForm.gatheringTime"
+              type="datetime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              placeholder="选择日期时间">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" v-if="method != 'view'" type="primary" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+  import ReimbursementSys from '@/api/reimbursementSys/wuHanReimbursementSysService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          id: '',
+          name: '',
+          parent: {
+            id: ''
+          },
+          gatheringTime: '' // 业务编码
+        }
+      }
+    },
+    reimbursementSys: null,
+    created () {
+      this.reimbursementSys = new ReimbursementSys()
+    },
+    methods: {
+      init (method, obj) {
+        this.method = method
+        if (method === 'edit') {
+          this.title = '修改收款日期'
+        }
+        this.visible = true
+        this.$nextTick(() => {
+          this.$refs['inputForm'].resetFields()
+          this.inputForm.id = obj.id
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            this.reimbursementSys.saveGatheringTime(this.inputForm).then(({data}) => {
+              this.loading = false
+              this.$message({
+                message: '操作成功',
+                type: 'success',
+                duration: 1500
+              })
+              this.visible = false
+              this.$emit('refreshDataList')
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      }
+    }
+  }
+</script>

+ 185 - 0
src/views/modules/reimbursementSys/wuHanReimbursementInvoiceModify.vue

@@ -0,0 +1,185 @@
+<template>
+  <el-dialog
+    :title="title"
+    :close-on-click-modal="false"
+     v-dialogDrag
+    :visible.sync="visible">
+    <el-form size="small" :model="inputForm" ref="inputForm" @keyup.enter.native="doSubmit()"
+             label-width="80px" v-loading="loading" :class="method==='viewInvoice'?'readonly':''" :disabled="method==='viewInvoice'" @submit.native.prevent>
+      <el-row :gutter="15">
+        <el-col :span="12">
+          <el-form-item label="业务编号" prop="businessCode" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.businessCode" placeholder="业务编号" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="业务类型" prop="businessType" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.businessType" placeholder="业务类型" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="发票代码" prop="invoiceCode" :rules=" [{required: true, message: '发票代码不能为空', trigger: 'blur'}]">
+            <el-input v-model="inputForm.invoiceCode" placeholder="发票代码" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="发票号码" prop="invoiceNumber" :rules=" [{required: true, message: '发票号码不能为空', trigger: 'blur'}]">
+            <el-input v-model="inputForm.invoiceNumber" placeholder="发票号码" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="购方企业名称" prop="firmName" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.firmName" placeholder="购方企业名称" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="开票日期" prop="makeTime"
+                        :rules="[
+                  {trigger:'blur'}
+                 ]">
+            <el-date-picker
+              style="width: 100%;"
+              v-model="inputForm.makeTime"
+              type="datetime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              :disabled="true"
+              placeholder="选择日期时间">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="商品名称" prop="name" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.name" placeholder="商品名称" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="金额" prop="money" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.money" placeholder="金额" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="税额" prop="tax" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.tax" placeholder="税额" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="收入" prop="income" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.income" placeholder="收入" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="项目经理" prop="proposer" :rules="[{max: 50, required: true, message:'项目经理不能为空', trigger: 'blur'}]">
+            <el-input v-model="inputForm.proposer" placeholder="项目经理" ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="部门" prop="partner" :rules="[{max: 50, required: true, message:'部门不能为空', trigger: 'blur'}]">
+            <el-input v-model="inputForm.partner" placeholder="部门" ></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="收款日期" prop="gatheringTime"
+                        :rules="[
+                  {trigger:'blur'}
+                 ]">
+            <el-date-picker
+              style="width: 100%;"
+              v-model="inputForm.gatheringTime"
+              type="datetime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              :disabled="true"
+              placeholder="选择日期时间">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" v-if="method != 'viewInvoice'" type="primary" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+  import ReimbursementSys from '@/api/reimbursementSys/wuHanReimbursementSysService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          id: '',
+          parent: {
+            id: ''
+          },
+          businessCode: '', // 业务编号
+          invoiceCode: '', // 发票代码
+          invoiceNumber: '', // 发票号码
+          firmName: '', // 购方企业名称
+          makeTime: '', // 开票日期
+          name: '', // 商品名称
+          money: '', // 金额
+          tax: '', // 税额
+          income: '', // 收入
+          proposer: '', // 申请人
+          partner: '', // 合伙人
+          businessType: '', // 业务类型
+          gatheringTime: '' // 收款日期
+        }
+      }
+    },
+    reimbursementSys: null,
+    created () {
+      this.reimbursementSys = new ReimbursementSys()
+    },
+    methods: {
+      init (method, obj) {
+        this.method = method
+        if (method === 'modifyInvoice') {
+          this.title = '修改发票信息'
+        } else if (method === 'viewInvoice') {
+          this.title = '查看发票信息'
+        }
+        this.visible = true
+        this.$nextTick(() => {
+          this.$refs['inputForm'].resetFields()
+          this.inputForm.id = obj.id
+          this.inputForm.parent.id = obj.parent.id
+          this.inputForm.parent.name = obj.parent.name
+          if (method === 'modifyInvoice' || method === 'viewInvoice') { // 修改或者查看
+            this.loading = true
+            this.reimbursementSys.queryInvoiceById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.loading = false
+            })
+          }
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            this.reimbursementSys.modifyInvoice(this.inputForm).then(({data}) => {
+              this.loading = false
+              this.$message({
+                message: '操作成功',
+                type: 'success',
+                duration: 1500
+              })
+              this.visible = false
+              this.$emit('refreshDataList')
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      }
+    }
+  }
+</script>

+ 4 - 4
src/views/modules/reimbursementSys/wuHanReimbursementList.vue

@@ -184,11 +184,11 @@
 <script>
 import ReimbursementSys from '@/api/reimbursementSys/wuHanReimbursementSysService'
 import XEUtils from 'xe-utils'
-import reimbursementForm from './reimbursementForm'
-import reimbursementGatheringTimeForm from './reimbursementGatheringTimeForm'
-import reimbursementRatioForm from './reimbursementRatioForm'
+import reimbursementForm from './wuHanReimbursementForm'
+import reimbursementGatheringTimeForm from './wuHanReimbursementGatheringTimeForm'
+import reimbursementRatioForm from './wuHanReimbursementRatioForm'
 import reimbursementInvoiceForm from './wuHanReimbursementInvoiceForm'
-import reimbursementInvoiceModify from './reimbursementInvoiceModify'
+import reimbursementInvoiceModify from './wuHanReimbursementInvoiceModify'
 import reimbursementBusinessForm from './wuHanReimbursementBusinessForm'
 export default {
   data () {

+ 129 - 0
src/views/modules/reimbursementSys/wuHanReimbursementRatioForm.vue

@@ -0,0 +1,129 @@
+<template>
+  <el-dialog
+    :title="title"
+    :close-on-click-modal="false"
+     v-dialogDrag
+    :visible.sync="visible">
+    <el-form size="small" :model="inputForm" ref="inputForm" @keyup.enter.native="doSubmit()"
+             label-width="80px" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'" @submit.native.prevent>
+      <el-row :gutter="15">
+
+        <el-col :span="12">
+          <el-form-item label="业务编码" prop="businessCode" :rules=" [{required: true,max: 50, message: '业务编号不能为空', trigger: 'blur'}]">
+            <el-input v-model="inputForm.businessCode" placeholder="业务编码" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="报销比例(%)" prop="reimbursementRatio":rules="[{required: true, max: 10, message:'报销比例不能为空', trigger:'blur'}]">
+            <el-input v-model="inputForm.reimbursementRatio" class="bg-grey" size="small" placeholder="报销比例(%)" style="width: 100%;" @keyup.native="inputForm.reimbursementRatio = checkInputs(inputForm.reimbursementRatio)">
+                </el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" v-if="method != 'view'" type="primary" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+  import ReimbursementSys from '@/api/reimbursementSys/wuHanReimbursementSysService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          id: '',
+          name: '',
+          parent: {
+            id: ''
+          },
+          businessCode: '', // 业务编码
+          reimbursementRatio: '' // 报销比例
+        }
+      }
+    },
+    reimbursementSys: null,
+    created () {
+      this.reimbursementSys = new ReimbursementSys()
+    },
+    methods: {
+      checkInputs (num) {
+        let str = num.toString()
+        var len1 = str.substr(0, 1)
+        var len2 = str.substr(1, 1)
+        // eslint-disable-next-line eqeqeq
+        if (str.length > 1 && len1 == 0 && len2 != '.') {
+          str = str.substr(1, 1)
+        }
+        // eslint-disable-next-line eqeqeq
+        if (len1 == '.') {
+          str = ''
+        }
+        // eslint-disable-next-line eqeqeq
+        if (str.indexOf('.') != -1) {
+          var str_ = str.substr(str.indexOf('.') + 1)
+          // eslint-disable-next-line eqeqeq
+          if (str_.indexOf('.') != -1) {
+            str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1)
+          }
+          if (str_.length > 2) {
+            this.$message.warning(`金额小数点后只能输入两位,请正确输入!`)
+            return (str = '')
+          }
+        }
+        // eslint-disable-next-line no-useless-escape
+        str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
+        return str
+      },
+      init (method, obj) {
+        this.method = method
+        if (method === 'editBusinessRatio') {
+          this.title = '修改报销比例'
+        } else if (method === 'view') {
+          this.title = '查看业务编码'
+        }
+        this.visible = true
+        this.$nextTick(() => {
+          this.$refs['inputForm'].resetFields()
+          this.inputForm.id = obj.id
+          this.inputForm.parent.id = obj.parent.id
+          this.inputForm.parent.name = obj.parent.name
+          if (method === 'editBusinessRatio' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.reimbursementSys.queryBusinessById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.loading = false
+            })
+          }
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            this.reimbursementSys.updateReimbursementRatio(this.inputForm).then(({data}) => {
+              this.loading = false
+              this.$message({
+                message: '操作成功',
+                type: 'success',
+                duration: 1500
+              })
+              this.visible = false
+              this.$emit('refreshDataList')
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      }
+    }
+  }
+</script>