wangqiang 2 rokov pred
rodič
commit
cd08bcc7b4

+ 14 - 0
src/api/cw/reimbursementApproval/ReimbursementApprovalTypeService.js

@@ -8,6 +8,20 @@ export default class ReimbursementApprovalTypeService {
       params: param
     })
   }
+  bxList (param) {
+    return request({
+      url: '/reimbursementApproval/type/bxList',
+      method: 'get',
+      params: param
+    })
+  }
+  cgList (param) {
+    return request({
+      url: '/reimbursementApproval/type/cgList',
+      method: 'get',
+      params: param
+    })
+  }
   save (param) {
     return request({
       url: '/reimbursementApproval/type/save',

+ 47 - 0
src/api/materialManagement/MaterialManagementService.js

@@ -0,0 +1,47 @@
+import request from '@/utils/httpRequest'
+
+export default class MaterialManagementService {
+  list (param) {
+    return request({
+      url: '/material/management/list',
+      method: 'get',
+      params: param
+    })
+  }
+  save (param) {
+    return request({
+      url: '/material/management/save',
+      method: 'post',
+      data: param
+    })
+  }
+  findById (id) {
+    return request({
+      url: '/material/management/findById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  remove (id) {
+    return request({
+      url: '/material/management/remove',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  updateStatusById (param) {
+    return request({
+      url: '/material/management/updateStatusById',
+      method: 'post',
+      data: param
+    })
+  }
+  exportFile (params) {
+    return request({
+      url: '/reimbursementApproval/info/exportFile',
+      method: 'get',
+      params: params,
+      responseType: 'blob'
+    })
+  }
+}

+ 1 - 1
src/views/modules/cw/reimbursementApproval/info/CwReimbursementTypePullForm.vue

@@ -103,7 +103,7 @@
       },
       list () {
         this.loading = true
-        this.reimbursementApprovalTypeService.list({...this.searchForm}).then(({data}) => {
+        this.reimbursementApprovalTypeService.bxList({...this.searchForm}).then(({data}) => {
           this.dataList = data
           this.loading = false
         })

+ 19 - 1
src/views/modules/cw/reimbursementApproval/type/TypeForm.vue

@@ -12,6 +12,20 @@
                label-width="100px" @submit.native.prevent>
         <el-row  :gutter="15">
           <el-col :span="21">
+            <el-form-item label="业务类型" prop="businessType"
+                          :rules="[{required: true, message: '业务类型不能为空', trigger: 'blur'}
+                 ]">
+              <el-select :disabled="this.inputForm.businessType !== '' & method !== 'edit'" v-model="inputForm.businessType" placeholder="请选择业务类型" style="width:100%;">
+                <el-option
+                  v-for="item in $dictUtils.getDictList('business_type')"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="21">
             <el-form-item label="上级节点" prop="parentId">
               <SelectTree
                 ref="areaTree"
@@ -57,11 +71,13 @@
   export default {
     data () {
       return {
+        disabled: false,
         title: '',
         method: '',
         visible: false,
         loading: false,
         inputForm: {
+          businessType: '',
           name: '',
           no: '',
           parentId: ''
@@ -78,9 +94,10 @@
       SelectTree
     },
     methods: {
-      init (method, id) {
+      init (method, id, businessType) {
         this.method = method
         this.inputForm = {
+          businessType: '',
           name: '',
           no: '',
           parentId: ''
@@ -96,6 +113,7 @@
         } else if (method === 'addChild') {
           this.title = '添加下级结构'
           this.inputForm.parentId = id
+          this.inputForm.businessType = businessType
         }
         this.visible = true
         this.loading = false

+ 3 - 3
src/views/modules/cw/reimbursementApproval/type/TypeList.vue

@@ -46,7 +46,7 @@
 
           <vxe-column title="操作" width="230px" fixed="right" align="center">
             <template  slot-scope="scope">
-              <el-button v-if="hasPermission('reimbursement:type:edit')&&(scope.row.level === '1' || scope.row.level === '2')" type="text"  size="small" @click="addChild(scope.row.id)">添加下级结构</el-button>
+              <el-button v-if="hasPermission('reimbursement:type:edit')&&(scope.row.level === '1' || scope.row.level === '2')" type="text"  size="small" @click="addChild(scope.row.id,scope.row.businessType)">添加下级结构</el-button>
               <el-button v-if="hasPermission('reimbursement:type:edit')" type="text"  size="small" @click="edit(scope.row.id)">修改</el-button>
               <el-button v-if="hasPermission('reimbursement:type:remove')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
             </template>
@@ -97,8 +97,8 @@
       add () {
         this.$refs.typeForm.init('add', '')
       },
-      addChild (id) {
-        this.$refs.typeForm.init('addChild', id)
+      addChild (id, businessType) {
+        this.$refs.typeForm.init('addChild', id, businessType)
       },
       // 修改
       edit (id) {

+ 90 - 0
src/views/modules/materialManagement/file/MaterialManagementDialog.vue

@@ -0,0 +1,90 @@
+<!--文件上传组件-->
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1400px"
+      height="500px"
+      @close="close"
+      append-to-body
+      @keyup.enter.native=""
+      :visible.sync="visible">
+      <UpLoadComponentV2 ref="upLoadComponentV2"></UpLoadComponentV2>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" icon="el-icon-circle-check" @click="doSubmit()">确定</el-button>
+    </span>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+  import UpLoadComponentV2 from './MaterialManagementV2'
+  export default {
+    data () {
+      return {
+        visible: false,
+        title: '',
+        index: ''
+      }
+    },
+    computed: {
+    },
+    watch: {
+    },
+    created () {
+    },
+    components: {
+      UpLoadComponentV2
+    },
+    mounted () {
+    },
+    methods: {
+      /**
+       * 文件上传组件初始化
+       * @param auth
+       *    auth的值为"view"时,不可上传/编辑文件
+       *    auth为其他值时,可上传/编辑文件
+       * @param fileList  要显示到文件上传列表中的文件。
+       *    注:文件必须要有url属性并且文件的url属性值必须是在oss中的路径值
+       *    例:'/attachment-file/xxx/xxx/2022/9/08/xxx.jpg'
+       * @param directory  要存放到oss的哪个文件夹下。
+       *    注:值为空时,默认存放到"public"文件夹
+       * @param maxValue  上传文件允许的最大值,单位:MB
+       *    注:值为空时,默认值为300MB
+       * @param dividerName  组件中divider的名称
+       *    注:值为空时,默认值为‘附件’
+       * @param uploadFlag  ‘上传文件’按钮是否禁用
+       *    注:值为空时,默认值为false
+       *    auth=view&&uploadFlag=false时 ‘上传文件’按钮禁用
+       * @param delFlag  ‘删除’按钮是否禁用
+       *    注:值为空时,默认值为false
+       *    auth=view&&delFlag=false时 ‘删除’按钮禁用
+       * @param showDivider  ‘附件‘Divider是否展示
+       *    注:值为空时,默认值为true
+       *    showDivider=false时 ‘附件‘Divider隐藏
+       */
+      newUpload (auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag, showDivider, index) {
+        this.index = index
+        this.title = '附件'
+        this.visible = true
+        this.$nextTick(() => {
+          this.$refs.upLoadComponentV2.newUpload(auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag, showDivider)
+        })
+      },
+      doSubmit () {
+        if (!this.$refs.upLoadComponentV2.checkProgress()) {
+          this.$emit('getUpload', this.$refs.upLoadComponentV2.getDataList(), this.index)
+          this.close()
+        }
+      },
+      close () {
+        this.$refs.upLoadComponentV2.clearUpload()
+        this.visible = false
+      }
+    }
+  }
+</script>

+ 674 - 0
src/views/modules/materialManagement/file/MaterialManagementV2.vue

@@ -0,0 +1,674 @@
+<!--文件上传组件-->
+<template>
+  <div>
+    <el-divider v-if="showDivider" content-position="left"><i class="el-icon-document"></i> {{dividerName}}</el-divider>
+    <el-upload ref="upload" style="display: inline-block; :show-header='status'" action=""
+               :limit="999" :http-request="httpRequest"
+               multiple
+               :on-exceed="(files, fileList) =>{
+                      $message.warning(`当前限制选择 999 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
+                     }"
+               :show-file-list="false"
+               :on-change="changes"
+               :on-progress="uploadVideoProcess"
+               :file-list="fileList">
+      <el-button type="info" size="mini" :slot="auth==='view'&&uploadFlag===false?'tip':'trigger'" @click="clickHandel" :disabled="auth==='view'&&uploadFlag===false">点击上传</el-button>
+    </el-upload>
+    <div style="height: calc(100% - 80px);margin-top: 10px">
+      <!-- 进度条 -->
+      <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
+      <el-table
+        ref="uploadTable"
+        :key="tableKey"
+        @row-click="tableRowClick"
+        :row-class-name="tableRowClassName"
+        :data="dataListNew">
+        <el-table-column type="seq" width="40"></el-table-column>
+        <el-table-column label="文件名称" prop="name" align="center">
+          <template scope="scope">
+            <div v-if="ifName(scope.row) === true">
+              <el-image
+                style="width: 30px; height: 30px;padding-top: 4px"
+                :src="scope.row.lsUrl"
+                :preview-src-list="[scope.row.lsUrl]"
+              ></el-image>
+            </div>
+            <div v-else>
+              <el-link  type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.name}}</el-link>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column v-if="auth !== 'view'" label="创建人" prop="createBy.name" align="center"></el-table-column>
+        <el-table-column v-if="auth !== 'view'" label="创建时间" prop="createDate" align="center"></el-table-column>
+        <el-table-column label="文件大小" prop="size" align="center">
+          <template slot-scope="scope">
+            {{getSize(scope.row.size)}}
+          </template>
+        </el-table-column>
+<!--        <el-table-column label="文件类型" prop="fileType" align="center">-->
+<!--          <template slot-scope="scope">-->
+<!--            <component-->
+<!--              :is="scope.row.fileTypeComponent || 'fileTypeComponentA'"-->
+<!--              :options="$dictUtils.getDictList('cw_project_report_file_type')"-->
+<!--              :value="scope.row.fileType"-->
+<!--              @updateFileType="updateFileType"-->
+<!--            ></component>-->
+<!--          </template>-->
+<!--        </el-table-column>-->
+<!--        <el-table-column label="盖章类型" prop="sealType" align="center">-->
+<!--          <template slot-scope="scope">-->
+<!--            <component-->
+<!--              :is="scope.row.sealTypeComponent || 'sealTypeComponentA'"-->
+<!--              :options="$dictUtils.getDictList('cw_seal_type')"-->
+<!--              :value="scope.row.sealType"-->
+<!--              :scope="scope"-->
+<!--              @updateSealType="updateSealType"-->
+<!--            ></component>-->
+<!--          </template>-->
+<!--        </el-table-column>-->
+<!--        <el-table-column label="备注" prop="remarks" align="center">-->
+<!--          <template slot-scope="scope">-->
+<!--            <component-->
+<!--              :is="scope.row.remarksComponent || 'remarksComponentA'"-->
+<!--              :value="scope.row.remarks"-->
+<!--              @updateRemarks="updateRemarks"-->
+<!--            ></component>-->
+<!--          </template>-->
+<!--        </el-table-column>-->
+        <el-table-column label="操作" width="200px" fixed="right" align="center">
+          <template  scope="scope">
+            <el-button type="text"  icon="el-icon-edit" size="small" @click="toHref(scope.row)" :disabled="false">下载</el-button>
+            <el-button type="text"  icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$index)" :disabled="auth==='view'&&delFlag === false&&createBy!==scope.row.createBy.name">删除</el-button>
+            <!--<el-button size="small" type="text" icon="el-icon-edit"
+                     @click="handleUpdate(scope.row, scope.$index)"
+            >{{ scope.row.btn || "修改" }}</el-button>-->
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <el-image-viewer v-if="showViewer" :on-close="closeViewer" :url-list="[url]" :zIndex=9999></el-image-viewer>
+
+  </div>
+</template>
+
+<script>
+  // eslint-disable-next-line no-unused-vars
+  import OSSSerivce, {
+    httpRequest,
+    // eslint-disable-next-line no-unused-vars
+    handleRemove,
+    fileName,
+    // eslint-disable-next-line no-unused-vars
+    beforeAvatarUpload,
+    // eslint-disable-next-line no-unused-vars
+    openWindowOnUrl,
+    // eslint-disable-next-line no-unused-vars
+    toHref
+  } from '@/api/sys/OSSService'
+  import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
+  import moment from 'moment'
+  export default {
+    data () {
+      return {
+        progressFlag: false,
+        loadProgress: 0,
+        fileList: [],
+        dataList: [],
+        dataListNew: [],
+        url: '',
+        showViewer: false,
+        ossService: null,
+        auth: '',
+        directory: 'public',
+        maxValue: 300,
+        tableKey: '',
+        fileLoading: true,
+        dividerName: '',
+        uploadFlag: false,
+        delFlag: false,
+        createBy: '',
+        showDivider: true,
+        fileType: '',
+        sealType: '',
+        remarks: ''
+      }
+    },
+    watch: {
+    },
+    created () {
+      this.ossService = new OSSSerivce()
+    },
+    components: {
+      ElImageViewer,
+      fileTypeComponentA: {
+        render: function (h) {
+          return h('span', {
+            domProps: {
+              innerText: this.$dictUtils.getDictLabel('cw_project_report_file_type', this.value, '')
+            }
+          })
+        },
+        props: ['options', 'value']
+      },
+      fileTypeComponentB: {
+        data () {
+          return { fileType: '' }
+        },
+        props: ['options', 'value'],
+        mounted () {
+          this.fileType = this.value
+        },
+        render: function (h) {
+          return h(
+            'el-select',
+            {
+              attrs: {
+                placeholder: '请选择',
+                value: this.$dictUtils.getDictLabel('cw_project_report_file_type', this.fileType, ''),
+                size: 'small',
+                clearable: true
+              },
+              props: ['value'],
+              on: {
+                change: (value) => {
+                  this.fileType = value
+                  this.$emit('updateFileType', value)
+                }
+              }
+            },
+            [
+              this.options.map((item) => {
+                let { label, value } = item
+                return h('el-option', {
+                  props: {
+                    label,
+                    value: parseInt(value),
+                    key: value
+                  }
+                })
+              })
+            ]
+          )
+        }
+      },
+      sealTypeComponentA: {
+        render: function (h) {
+          return h('span', {
+            domProps: {
+              innerText: this.$dictUtils.getDictLabel('cw_seal_type', this.value, '')
+            }
+          })
+        },
+        props: ['options', 'value']
+      },
+      sealTypeComponentB: {
+        data () {
+          return { sealType: '' }
+        },
+        props: ['options', 'value', 'scope'],
+        mounted () {
+          this.sealType = this.value
+        },
+        render: function (h) {
+          return h(
+            'el-select',
+            {
+              attrs: {
+                placeholder: '请选择',
+                value: this.$dictUtils.getDictLabel('cw_seal_type', this.sealType, ''),
+                size: 'small',
+                clearable: true
+              },
+              props: ['value'],
+              on: {
+                change: (value) => {
+                  let suffix = this.scope.row.name.substring(this.scope.row.name.lastIndexOf('.') + 1)
+                  if (parseInt(value) === 1) {
+                    if (suffix === 'pdf' || suffix === 'doc' || suffix === 'docx') {
+                      this.sealType = value
+                      this.$emit('updateSealType', value)
+                    } else {
+                      this.$message.error('只有“pdf、doc、docx”格式文件的盖章类型可以是“电子章”')
+                      this.sealType = ''
+                      this.$emit('updateSealType', '')
+                    }
+                  } else {
+                    this.sealType = value
+                    this.$emit('updateSealType', value)
+                  }
+                }
+              }
+            },
+            [
+              this.options.map((item) => {
+                let { label, value } = item
+                return h('el-option', {
+                  props: {
+                    label,
+                    value: parseInt(value),
+                    key: value
+                  }
+                })
+              })
+            ]
+          )
+        }
+      },
+      remarksComponentA: {
+        render: function (h) {
+          return h('span', {
+            domProps: {
+              innerText: this.value
+            }
+          })
+        },
+        props: ['value']
+      },
+      remarksComponentB: {
+        data () {
+          return { remarks: '' }
+        },
+        props: ['value'],
+        mounted () {
+          this.remarks = this.value
+        },
+        render: function (h) {
+          return h(
+            'el-input',
+            {
+              attrs: {
+                placeholder: '请输入',
+                value: this.remarks,
+                size: 'small',
+                clearable: true
+              },
+              props: ['value'],
+              on: {
+                input: (value) => {
+                  this.remarks = value
+                  this.$emit('updateRemarks', value)
+                }
+              }
+            }
+          )
+        }
+      }
+    },
+    mounted () {
+      window.onPreview = this.onPreview
+    },
+    methods: {
+      /**
+       * dividerName: 组件中divider的名称赋值
+       * showDivider: ‘附件‘Divider是否展示
+       *     注:值为空时,默认值为true
+       *    showDivider=false时 ‘附件‘Divider隐藏
+       **/
+      setDividerName (dividerName, showDivider) {
+        if (this.commonJS.isNotEmpty(dividerName)) {
+          this.dividerName = dividerName
+        }
+        if (this.commonJS.isNotEmpty(showDivider)) {
+          if (showDivider === false) {
+            this.showDivider = false
+          } else {
+            this.showDivider = true
+          }
+        } else {
+          this.showDivider = true
+        }
+      },
+      /**
+       * 文件上传组件初始化
+       * @param auth
+       *    auth的值为"view"时,不可上传/编辑文件
+       *    auth为其他值时,可上传/编辑文件
+       * @param fileList  要显示到文件上传列表中的文件。
+       *    注:文件必须要有url属性并且文件的url属性值必须是在oss中的路径值
+       *    例:'/attachment-file/xxx/xxx/2022/9/08/xxx.jpg'
+       * @param directory  要存放到oss的哪个文件夹下。
+       *    注:值为空时,默认存放到"public"文件夹
+       * @param maxValue  上传文件允许的最大值,单位:MB
+       *    注:值为空时,默认值为300MB
+       * @param dividerName  组件中divider的名称
+       *    注:值为空时,默认值为‘附件’
+       * @param uploadFlag  ‘上传文件’按钮是否禁用
+       *    注:值为空时,默认值为false
+       *    auth=view&&uploadFlag=false时 ‘上传文件’按钮禁用
+       * @param delFlag  ‘删除’按钮是否禁用
+       *    注:值为空时,默认值为false
+       *    auth=view&&delFlag=false时 ‘删除’按钮禁用
+       * @param showDivider  ‘附件‘Divider是否展示
+       *    注:值为空时,默认值为true
+       *    showDivider=false时 ‘附件‘Divider隐藏
+       */
+      async newUpload (auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag, showDivider) {
+        await this.fileLoadingFalse()
+        if (this.commonJS.isEmpty(dividerName)) {
+          this.dividerName = '附件'
+        } else {
+          this.dividerName = dividerName
+        }
+        if (directory !== undefined && directory !== null && directory !== '' && directory !== {}) {
+          this.directory = directory
+        } else {
+          this.directory = 'public'
+        }
+        if (maxValue !== undefined && maxValue !== null && maxValue !== '' && maxValue !== 0) {
+          this.maxValue = maxValue
+        } else {
+          this.maxValue = 300
+        }
+        this.auth = auth
+        if (this.commonJS.isEmpty(uploadFlag)) {
+          this.uploadFlag = false
+        } else {
+          if (uploadFlag !== true && uploadFlag !== false) {
+            this.uploadFlag = false
+          } else {
+            this.uploadFlag = uploadFlag
+          }
+        }
+        if (this.commonJS.isEmpty(delFlag)) {
+          this.delFlag = false
+        } else {
+          if (delFlag !== true && delFlag !== false) {
+            this.delFlag = false
+            this.createBy = delFlag
+          } else {
+            this.delFlag = delFlag
+          }
+        }
+        if (this.commonJS.isEmpty(fileList)) {
+          this.fileLoading = true
+        }
+        for await (let item of fileList) {
+          await this.ossService.getFileSizeByUrl(item.url).then((data) => {
+            item.lsUrl = data.data.url
+            item.size = data.data.size
+            this.dataList.push(item)
+            this.dataListNew.push(item)
+            if (this.dataList.length === fileList.length) {
+              this.fileLoading = true
+            }
+          })
+        }
+        // this.dataList = JSON.parse(JSON.stringify(fileList))
+        // this.dataListNew = JSON.parse(JSON.stringify(fileList))
+        if (this.commonJS.isEmpty(showDivider)) {
+          this.showDivider = true
+        } else {
+          if (showDivider === false) {
+            this.showDivider = false
+          } else {
+            this.showDivider = true
+          }
+        }
+      },
+      async httpRequest (file) {
+        await httpRequest(file, fileName(file), this.directory, this.maxValue)
+      },
+      uploadVideoProcess (event, file, fileList) {
+        this.progressFlag = true // 显示进度条
+        this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
+        if (this.loadProgress >= 100) {
+          this.loadProgress = 100
+          setTimeout(() => {
+            this.progressFlag = false
+          }, 1000) // 一秒后关闭进度条
+        }
+      },
+      getSize (value) {
+        if (this.commonJS.isEmpty(value)) {
+          return '0 B'
+        } else {
+          let val = parseInt(value)
+          if (this.commonJS.isEmpty(val)) {
+            return '0 B'
+          }
+          if (isNaN(val)) {
+            return '0 B'
+          }
+          if (val === 0) {
+            return '0 B'
+          }
+          let k = 1024
+          let sizes = ['B', 'KB', 'MB', 'GB', 'PB', 'TB', 'EB', 'ZB', 'YB']
+          let i = Math.floor(Math.log(val) / Math.log(k))
+          return (val / Math.pow(k, i)).toPrecision(3) + '' + sizes[i]
+        }
+      },
+      async changes (file, fileList) {
+        // if (file.status !== 'ready') {
+        //   return
+        // }
+        if (!beforeAvatarUpload(file, fileList, this.maxValue)) {
+          this.$message.error('文件大小不能超过 ' + this.maxValue + ' MB!')
+          return
+        }
+        this.dataListNew = []
+        this.dataList.forEach((item) => {
+          this.dataListNew.push(item)
+        })
+        for (let item of fileList) {
+          item.createDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+          item.createBy = {
+            id: '',
+            name: ''
+          }
+          item.createBy.id = this.$store.state.user.id
+          item.createBy.name = this.$store.state.user.name
+          this.dataListNew.push(item)
+        }
+        for await (let item of this.dataListNew) {
+          if (item.raw !== undefined && item.raw !== null && item.raw !== {}) {
+            item.url = item.raw.url
+            if (item.raw.url !== undefined && item.raw.url !== null && item.raw.url !== {}) {
+              await this.ossService.getTemporaryUrl(item.raw.url).then((data) => {
+                item.lsUrl = data.data
+              })
+            }
+          }
+        }
+        this.tableKey = Math.random()
+      },
+      showFile (row) {
+        openWindowOnUrl(row)
+      },
+      onPreview (url) {
+        this.url = url
+        this.showViewer = true
+      },
+      // 关闭查看器
+      closeViewer () {
+        this.url = ''
+        this.showViewer = false
+      },
+      toHref (row) {
+        toHref(row)
+      },
+      deleteById (row, index) {
+        this.dataListNew.splice(index, 1)
+        if (row.id !== null && row.id !== '' && row.id !== undefined) {
+          this.dataList.splice(index, 1)
+          // this.ossService.deleteMsgById(row.id)
+        } else {
+          let num
+          if (this.dataList.length > 0) {
+            num = this.dataList.length - 1
+          } else {
+            num = 0
+          }
+          this.$refs.upload.uploadFiles.splice(index - num, 1)
+        }
+      },
+      /**
+       * 关闭dialog时使用  清除el-upload中上传的文件
+       */
+      clearUpload () {
+        this.$refs.upload.uploadFiles = []
+        this.dataList = []
+        this.dataListNew = []
+        this.createBy = ''
+      },
+      /**
+       * 获取当前文件列表中的文件数据
+       */
+      getDataList () {
+        let _this = this
+        const waitForEach = function () {
+          return new Promise(function (resolve, reject) {
+            _this.dataListNew.forEach((item, index) => {
+              if (item.btnType === 'save') {
+                _this.dataListNew[index].fileTypeComponent = 'fileTypeComponentA'
+                _this.dataListNew[index].sealTypeComponent = 'sealTypeComponentA'
+                _this.dataListNew[index].remarksComponent = 'remarksComponentA'
+                _this.dataListNew[index].btn = '修改'
+                _this.dataListNew[index].btnType = 'edit'
+                _this.dataListNew[index].fileType = _this.fileType
+                _this.dataListNew[index].sealType = _this.sealType
+                _this.dataListNew[index].remarks = _this.remarks
+              }
+            })
+            _this.tableKey = Math.random()
+            resolve(_this.dataListNew)
+          })
+        }
+        return waitForEach()
+      },
+      /**
+       * 判断进度条是否结束,附件是否加载完成
+       * @returns {boolean}
+       */
+      checkProgress () {
+        if (this.progressFlag === true) {
+          this.$message.warning('请等待附件上传完成再进行操作')
+          return true
+        }
+        if (this.fileLoading === false) {
+          this.$message.warning('请等待附件加载完成再进行操作')
+          return true
+        }
+        return false
+      },
+      ifName (row) {
+        if (this.commonJS.isEmpty(row.name)) {
+          row.name = '---'
+          return false
+        }
+        let suffix = row.name.substring(row.name.lastIndexOf('.') + 1)
+        if (suffix === 'jpg' || suffix === 'png' || suffix === 'gif' || suffix === 'bmp' || suffix === 'jpeg') {
+          return true
+        } else {
+          return false
+        }
+      },
+      fileLoadingFalse () {
+        this.fileLoading = false
+      },
+      /** 修改||保存按钮操作 */
+      handleUpdate: async function (row, rowIndex) {
+        if (row.btnType === 'edit' || this.commonJS.isEmpty(row.btnType)) {
+          let _this = this
+          const waitForEach = function () {
+            return new Promise(function (resolve, reject) {
+              _this.dataListNew.forEach((item, index) => {
+                if (item.btnType === 'save') {
+                  _this.dataListNew[index].fileTypeComponent = 'fileTypeComponentA'
+                  _this.dataListNew[index].sealTypeComponent = 'sealTypeComponentA'
+                  _this.dataListNew[index].remarksComponent = 'remarksComponentA'
+                  _this.dataListNew[index].btn = '修改'
+                  _this.dataListNew[index].btnType = 'edit'
+                  _this.dataListNew[index].fileType = _this.fileType
+                  _this.dataListNew[index].sealType = _this.sealType
+                  _this.dataListNew[index].remarks = _this.remarks
+                }
+              })
+              resolve()
+            })
+          }
+          waitForEach().then(() => {
+            this.dataListNew[rowIndex].fileTypeComponent = 'fileTypeComponentB'
+            this.dataListNew[rowIndex].sealTypeComponent = 'sealTypeComponentB'
+            this.dataListNew[rowIndex].remarksComponent = 'remarksComponentB'
+            this.dataListNew[rowIndex].btn = '保存'
+            this.dataListNew[rowIndex].btnType = 'save'
+          })
+        } else {
+          this.dataListNew[rowIndex].fileTypeComponent = 'fileTypeComponentA'
+          this.dataListNew[rowIndex].sealTypeComponent = 'sealTypeComponentA'
+          this.dataListNew[rowIndex].remarksComponent = 'remarksComponentA'
+          this.dataListNew[rowIndex].btn = '修改'
+          this.dataListNew[rowIndex].btnType = 'edit'
+          this.dataListNew[rowIndex].fileType = this.fileType
+          this.dataListNew[rowIndex].sealType = this.sealType
+          this.dataListNew[rowIndex].remarks = this.remarks
+        }
+        this.tableKey = Math.random()
+      },
+      updateFileType (fileType) {
+        this.fileType = fileType
+      },
+      updateSealType (sealType) {
+        this.sealType = sealType
+      },
+      updateRemarks (remarks) {
+        this.remarks = remarks
+      },
+      tableRowClassName ({ row, rowIndex }) {
+        row.index = rowIndex
+      },
+      // 行点击事件
+      tableRowClick (row, column) {
+        if (this.auth !== 'view') {
+          if (column.label !== '备注' && column.label !== '文件名称' && column.label !== '操作') {
+            let _this = this
+            const waitForEach = function () {
+              return new Promise(function (resolve, reject) {
+                _this.dataListNew.forEach((item, index) => {
+                  if (item.btnType === 'save') {
+                    _this.dataListNew[index].fileTypeComponent = 'fileTypeComponentA'
+                    _this.dataListNew[index].sealTypeComponent = 'sealTypeComponentA'
+                    _this.dataListNew[index].remarksComponent = 'remarksComponentA'
+                    _this.dataListNew[index].btn = '修改'
+                    _this.dataListNew[index].btnType = 'edit'
+                    _this.dataListNew[index].fileType = _this.fileType
+                    _this.dataListNew[index].sealType = _this.sealType
+                    _this.dataListNew[index].remarks = _this.remarks
+                  }
+                })
+                resolve()
+              })
+            }
+            waitForEach().then(() => {
+              this.fileType = this.dataListNew[row.index].fileType
+              this.sealType = this.dataListNew[row.index].sealType
+              this.remarks = this.dataListNew[row.index].remarks
+              this.dataListNew[row.index].fileTypeComponent = 'fileTypeComponentB'
+              this.dataListNew[row.index].sealTypeComponent = 'sealTypeComponentB'
+              this.dataListNew[row.index].remarksComponent = 'remarksComponentB'
+              this.dataListNew[row.index].btn = '保存'
+              this.dataListNew[row.index].btnType = 'save'
+            })
+            this.tableKey = Math.random()
+          }
+        }
+      },
+      // 点击上传文件按钮的时候,把未保存的文件保存一下
+      clickHandel () {
+        this.dataListNew.forEach((item, index) => {
+          if (item.btnType === 'save') {
+            this.dataListNew[index].fileTypeComponent = 'fileTypeComponentA'
+            this.dataListNew[index].sealTypeComponent = 'sealTypeComponentA'
+            this.dataListNew[index].remarksComponent = 'remarksComponentA'
+            this.dataListNew[index].btn = '修改'
+            this.dataListNew[index].btnType = 'edit'
+            this.dataListNew[index].fileType = this.fileType
+            this.dataListNew[index].sealType = this.sealType
+            this.dataListNew[index].remarks = this.remarks
+          }
+        })
+      }
+    }
+  }
+</script>

+ 136 - 0
src/views/modules/materialManagement/info/MaterialTypePullForm.vue

@@ -0,0 +1,136 @@
+<template>
+  <div>
+    <el-dialog
+      title="报销类型选择"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1100px"
+      height="500px"
+      @close="close"
+      @keyup.enter.native=""
+      :visible.sync="visible">
+      <div style="height: calc(100% - 80px);">
+        <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+          <!-- 搜索框-->
+          <el-form-item label="报销类型名称" prop="name">
+            <el-input size="small" v-model="searchForm.name" placeholder="请输入报销类型名称" clearable></el-input>
+          </el-form-item>
+
+          <el-form-item>
+            <el-button type="primary" @click="list()" size="small" icon="el-icon-search">查询</el-button>
+            <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+          </el-form-item>
+        </el-form>
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="500px"
+          :loading="loading"
+          size="small"
+          ref="typeTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :tree-config="{transform: true, rowField: 'id', parentField: 'parentId'}"
+          :checkbox-config="{}">
+          <vxe-column type="seq" width="60" title="序号"></vxe-column>
+          <vxe-column type="checkbox" width="40" ></vxe-column>
+          <vxe-column title="报销内容名称" field="name" align="left" tree-node></vxe-column>
+          <vxe-column width="100" title="序号" field="sort"></vxe-column>
+        </vxe-table>
+      </div>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="getProgramForType" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  // import ReimbursementTypeService from '@/api/sys/ReimbursementTypeService'
+  import ReimbursementApprovalTypeService from '@/api/cw/reimbursementApproval/ReimbursementApprovalTypeService'
+  export default {
+    data () {
+      return {
+        searchForm: {
+          name: ''
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        title: '',
+        method: '',
+        visible: false,
+        loading: false
+      }
+    },
+    // reimbursementTypeService: null,
+    reimbursementApprovalTypeService: null,
+    created () {
+      // this.reimbursementTypeService = new ReimbursementTypeService()
+      this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
+    },
+    components: {
+    },
+    methods: {
+      init () {
+        this.visible = true
+        this.list()
+      },
+      // 表单提交
+      getProgramForType () {
+        let rows
+        if (this.commonJS.isEmpty(this.$refs.typeTable.getCheckboxRecords()) || this.$refs.typeTable.getCheckboxRecords().length > 1) {
+          this.$message.error('请选择一条数据')
+          return
+        }
+        rows = this.$refs.typeTable.getCheckboxRecords()
+        if (rows[0].level !== '3' && rows[0].id !== '3') {
+          this.$message.error('请选择子集数据')
+          return
+        }
+        this.$emit('getProgramForType', rows)
+        this.close()
+      },
+      list () {
+        this.loading = true
+        this.reimbursementApprovalTypeService.cgList({...this.searchForm}).then(({data}) => {
+          this.dataList = data
+          this.loading = false
+        })
+        // this.reimbursementTypeService.list({...this.searchForm}).then(({data}) => {
+        //   this.dataList = data
+        //   this.loading = false
+        // })
+      },
+      // 当前页
+      currentChangeHandle ({currentPage, pageSize}) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.list()
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.list()
+      },
+      close () {
+        this.detail = ''
+        this.visible = false
+      }
+    }
+  }
+</script>
+<style>
+  .messageZindex {
+    z-index:9999 !important;
+  }
+</style>

+ 509 - 0
src/views/modules/materialManagement/info/UpdateInfoForm.vue

@@ -0,0 +1,509 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1200px"
+      @close="close"
+      @keyup.enter.native="doSubmit"
+      :visible.sync="visible">
+      <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
+               label-width="100px" @submit.native.prevent>
+
+        <el-divider content-position="left"><i class="el-icon-document"></i> 基础信息</el-divider>
+        <el-row :gutter="26">
+          <el-col :span="12">
+            <el-form-item label="采购编号" prop="purchaseNo">
+              <el-input placeholder="自动生成" v-model="inputForm.purchaseNo" :disabled="true"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="采购简述" prop="purchaseSketch"
+                          :rules="[{required: true, message: '采购简述不能为空', trigger: 'blur'}
+                 ]">
+              <el-input v-model="inputForm.purchaseSketch" placeholder="请填写采购简述"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="经办人" prop="handledBy">
+              <el-input v-model="inputForm.handledBy" :disabled="true"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="经办人部门" prop="handledByOffice">
+              <SelectTree
+                :disabled="true"
+                ref="officeTree"
+                :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+
+                :url="`/sys/office/treeData?type=2`"
+                :value="inputForm.handledByOffice"
+                :accordion="true"
+                size="medium"
+                @getValue="(value) => {inputForm.handledByOffice=value}"/>
+              <!--            <el-input v-model="inputForm.handledByOffice" :disabled="true"></el-input>-->
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="采购时间" prop="purchaseDate" :rules="[{required: true, message:'请选择采购时间', trigger:'blur'}]">
+              <el-date-picker
+                v-model="inputForm.purchaseDate"
+                type="date"
+                value-format="yyyy-MM-dd"
+                style="width: 100%"
+                placeholder="选择日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="采购方式" prop="purchaseMode"
+                          :rules="[]">
+              <el-select v-model="inputForm.purchaseMode" placeholder="请选择采购方式" style="width:100%;">
+                <el-option
+                  v-for="item in $dictUtils.getDictList('material_purchase_mode')"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="备注" prop="remarks">
+              <el-input v-model="inputForm.remarks"
+                        type="textarea"
+                        :rows="5"
+                        maxlength="500"
+                        placeholder="请输入简介"
+                        show-word-limit>
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-divider content-position="left"><i class="el-icon-document"></i>
+          报销详情
+          <el-button style="margin-left: 20px" type="primary" @click="insertEvent('detail')" plain>
+            新增
+          </el-button>
+        </el-divider>
+        <el-row  :gutter="15" >
+          <vxe-table
+            border
+            show-footer
+            show-overflow
+            :footer-method="footerMethod"
+            ref="detailTable"
+            class="vxe-table-element"
+            :data="inputForm.detailInfos"
+            style="margin-left: 5em"
+            @cell-click=""
+            @edit-closed=""
+            highlight-current-row
+            :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
+          >
+            <vxe-table-column field="purchaser" title="采购人" :edit-render="{}" :rules="[{required: true, message:'请选择采购人', trigger:'blur'}]">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.purchaser" @focus="userPullListForm(scope.$rowIndex)"></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="procurementOffice" title="采购部门" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input :disabled='true' v-model="scope.row.procurementOffice" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="procurementType" title="采购类型" :edit-render="{}" :rules="[{required: true, message:'请选择采购类型', trigger:'blur'}]">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.procurementType" @focus="typePullForm(scope.$rowIndex)"></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="tradeName" title="商品名称" :edit-render="{}" :rules="[{required: true, message:'请填写商品名称', trigger:'blur'}]">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.tradeName"></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="tradePrice" title="商品单价(元)" :edit-render="{}" :rules="[{required: true, message:'请输入商品单价', trigger:'blur'}]">
+              <template v-slot:edit="scope">
+                <el-input maxlength="15" v-model="scope.row.tradePrice" @keyup.native="scope.row.tradePrice = twoDecimalPlaces(scope.row.tradePrice)"></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="tradeNumber" title="商品数量" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.tradeNumber" oninput ="value=value.replace(/\D|^0/g,'')" maxlength="10"></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="company" title="单位" :edit-render="{}" :rules="[{required: true, message:'请填写单位', trigger:'blur'}]">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.company"></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="remarks" title="备注" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.remarks" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column title="操作" width="300">
+              <template v-slot="scope">
+                <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'detail')">删除</el-button>
+                <el-button size="mini" type="primary" @click="sss(scope.$rowIndex)">上传附件</el-button>
+                <el-button size="mini" type="primary" v-if="scope.row.status !== '1' || scope.row.status !== '' " :disabled="false" @click="seeFileInfo(scope.$rowIndex)">查看文件详情</el-button>
+                <!--              <el-button size="mini" v-if="formReadOnly" :disabled="false" type="primary" @click="seeFileInfo(scope.$rowIndex)">查看文件详情</el-button>-->
+              </template>
+            </vxe-table-column>
+          </vxe-table>
+        </el-row>
+
+        <!--<el-divider content-position="left"><i class="el-icon-document"></i>
+          专用发票信息
+          <el-button style="margin-left: 20px" type="primary" :disabled="method==='view'" size="mini" @click="insertEvent('amount')" plain>
+            新增
+          </el-button>
+        </el-divider>
+        <el-row  :gutter="15" >
+          <vxe-table
+            border
+            show-overflow
+            ref="amountTable"
+            class="vxe-table-element"
+            :data="inputForm.amountInfos"
+            style="margin-left: 5em"
+            @cell-click=""
+            @edit-closed=""
+            highlight-current-row
+            :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
+          >
+            <vxe-table-column field="code" title="发票代码" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.code" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="number" title="发票号" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.number" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="amount" title="金额" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.amount" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="taxAmount" title="税额" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.taxAmount" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="count" title="价税合计" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.count" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column title="操作" width="100">
+              <template v-slot="scope">
+                <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'amount')">删除</el-button>
+              </template>
+            </vxe-table-column>
+          </vxe-table>
+        </el-row>-->
+
+        <!-- 附件 -->
+        <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+        <MaterialManagementDialog ref="materialManagementDialog" @getUpload="getUpload"></MaterialManagementDialog>
+        <CwProgramPageForm ref="cwProgramPageForm" @getProgram="getProgram"></CwProgramPageForm>
+        <MaterialTypePullForm ref="materialTypePullForm" @getProgramForType="getProgramForType"></MaterialTypePullForm>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import MaterialManagementDialog from '../file/MaterialManagementDialog'
+  import CwProgramPageForm from '@/views/modules/cw/reimbursementApproval/info/CwProgramPageForm'
+  import MaterialTypePullForm from './MaterialTypePullForm'
+  // import ReimbursementService from '@/api/sys/ReimbursementService'
+  // import ReimbursementApprovalService from '@/api/cw/reimbursementApproval/ReimbursementApprovalService'
+  import MaterialManagementService from '@/api/materialManagement/MaterialManagementService'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import XEUtils from "xe-utils";
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          tradeTotalPrice: '',  // 商品总价
+          fileInfoLost: [],
+          purchaseMode: '',
+          handledByOffice: '',
+          handledBy: '',
+          purchaseSketch: '',
+          purchaseNo: '', // 采购编号
+          userId: '',
+          purchaseDate: '',
+          remarks: '',
+          detailInfos: [],
+          // amountInfos: [],
+          files: [] // 附件信息
+        }
+      }
+    },
+    // reimbursementService: null,
+    // reimbursementApprovalService: null,
+    MaterialManagementService: null,
+    created () {
+      // this.reimbursementService = new ReimbursementService()
+      // this.reimbursementApprovalService = new ReimbursementApprovalService()
+      this.materialManagementService = new MaterialManagementService()
+    },
+    components: {
+      MaterialTypePullForm,
+      CwProgramPageForm,
+      MaterialManagementDialog,
+      UpLoadComponent
+    },
+    methods: {
+      init (method, id) {
+        this.method = method
+        this.inputForm = {
+          tradeTotalPrice: '',  // 商品总价
+          fileInfoLost: [],
+          purchaseMode: '',
+          handledByOffice: '',
+          handledBy: JSON.parse(localStorage.getItem('user')).name,
+          purchaseSketch: '',
+          purchaseNo: '', // 采购编号
+          userId: JSON.parse(localStorage.getItem('user')).id,
+          purchaseDate: new Date(),
+          remarks: '',
+          detailInfos: [],
+          // amountInfos: [],
+          files: [] // 附件信息
+        }
+        if (method === 'add') {
+          this.title = `新建报销类型`
+        } else if (method === 'edit') {
+          this.inputForm.id = id
+          this.title = '修改报销类型'
+        } else if (method === 'view') {
+          this.inputForm.id = id
+          this.title = '查看报销类型'
+        } else if (method === 'addChild') {
+          this.title = '添加下级结构'
+          this.inputForm.parentId = id
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.$refs.inputForm.resetFields()
+            this.materialManagementService.findById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
+                this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
+              }
+              this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
+              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+              this.loading = false
+            })
+            // this.reimbursementApprovalService.findById(this.inputForm.id).then(({data}) => {
+            //   this.inputForm = this.recover(this.inputForm, data)
+            //   this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
+            //   this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+            //   this.loading = false
+            // })
+            // this.reimbursementService.findById(this.inputForm.id).then(({data}) => {
+            //   this.inputForm = this.recover(this.inputForm, data)
+            //   this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
+            //   this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+            //   this.loading = false
+            // })
+          }
+        })
+      },
+      getProgramForType (rows) {
+        this.inputForm.detailInfos[this.indexRow].typeId = rows[0].id
+        this.inputForm.detailInfos[this.indexRow].procurementType = rows[0].name
+        this.indexRow = ''
+        this.$forceUpdate()
+      },
+      getProgram (rows) {
+        console.log('aaaaaaaaaaa', rows[0])
+        this.inputForm.detailInfos[this.indexRow].projectId = rows[0].id
+        this.inputForm.detailInfos[this.indexRow].projectName = rows[0].name
+        this.inputForm.detailInfos[this.indexRow].reportNumber = rows[0].reportNo
+        this.indexRow = ''
+        this.$forceUpdate()
+      },
+      getUpload (p, index) {
+        p.then((list) => {
+          // list为返回数据
+          this.inputForm.detailInfos[index].fileInfoLost = list
+          this.inputForm.detailInfos[index].fileNumber = list.length
+          this.tableKeyClient = Math.random()
+        })
+      },
+      twoDecimalPlaces (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
+      },
+      // 采购人下拉弹窗
+      userPullListForm (rowIndex) {
+        this.indexRow = rowIndex
+        this.$refs.userPullForm.init()
+      },
+      footerMethod ({ columns, data }) {
+        const footerData = [
+          columns.map((column, columnIndex) => {
+            if (columnIndex === 0) {
+              return '商品总价'
+            }
+            if (['tradePrice'].includes(column.property)) {
+              // eslint-disable-next-line no-undef
+              this.inputForm.tradeTotalPrice = XEUtils.sum(data, column.property)
+              console.log('this.inputForm.tradeTotalPrice', this.inputForm.tradeTotalPrice)
+              return XEUtils.sum(data, column.property)
+            }
+            return null
+          })
+        ]
+        return footerData
+      },
+      seeFileInfo (index) {
+        if (this.commonJS.isEmpty(this.inputForm.detailInfos[index].fileInfoLost)) {
+          this.inputForm.detailInfos[index].fileInfoLost = []
+        }
+        this.$refs.materialManagementDialog.newUpload('view', this.inputForm.detailInfos[index].fileInfoLost, null, null, null, null, null, false, index)
+      },
+      sss (index) {
+        if (this.commonJS.isEmpty(this.inputForm.detailInfos[index].fileInfoLost)) {
+          this.inputForm.detailInfos[index].fileInfoLost = []
+        }
+        this.$refs.materialManagementDialog.newUpload(null, this.inputForm.detailInfos[index].fileInfoLost, null, null, null, null, null, false, index)
+      },
+      // 采购类型下拉弹窗
+      typePullForm (rowIndex) {
+        this.indexRow = rowIndex
+        // this.$refs.reimbursementTypePullForm.init()
+        // this.$refs.cwReimbursementTypePullForm.init()
+        this.$refs.materialTypePullForm.init()
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            if (this.$refs.uploadComponent.checkProgress()) {
+              this.loading = false
+              return
+            }
+            if (this.commonJS.isEmpty(this.inputForm.files)) {
+              this.loading = false
+              this.inputForm.files = []
+            }
+            if (this.commonJS.isEmpty(this.inputForm.detailInfos)) {
+              this.$message.error('至少填写一条报销详情信息')
+              this.loading = false
+              return
+            } else {
+              let i = this.inputForm.detailInfos.length
+              for (let j = 0; j < i; j++) {
+                let k = j + 1
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].purchaser)) {
+                  this.$message.error('报销详情第' + k + '行请选择采购人')
+                  this.loading = false
+                  return
+                }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].procurementType)) {
+                  this.$message.error('报销详情第' + k + '行请选择采购类型')
+                  this.loading = false
+                  return
+                }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].tradePrice)) {
+                  this.$message.error('报销详情第' + k + '行请输入商品单价')
+                  this.loading = false
+                  return
+                }
+              }
+            }
+            this.inputForm.files = this.$refs.uploadComponent.getDataList()
+            this.materialManagementService.save(this.inputForm).then(({data}) => {
+              // eslint-disable-next-line no-undef
+              callback(data.businessTable, data.businessId, this.inputForm)
+              this.$refs.inputForm.resetFields()
+              this.loading = false
+            }).catch(() => {
+              this.$refs.inputForm.resetFields()
+              this.loading = false
+            })
+          }
+        })
+      },
+      close () {
+        this.$refs.inputForm.resetFields()
+        this.inputForm.detailInfos = []
+        this.inputForm.amountInfos = []
+        this.$refs.uploadComponent.clearUpload()
+        this.visible = false
+      },
+      // 删除
+      removeEvent (row, rowIndex, type) {
+        if (type === 'detail') {
+          this.$refs.detailTable.remove(row)
+          this.inputForm.detailInfos.splice(rowIndex, 1)
+        }
+        if (type === 'amount') {
+          this.$refs.amountTable.remove(row)
+          this.inputForm.amountInfos.splice(rowIndex, 1)
+        }
+      },
+      // 新增
+      async insertEvent (type) {
+        if (type === 'detail') {
+          await this.$refs.detailTable.insert().then((data) => {
+            this.inputForm.detailInfos.push(data)
+          })
+        }
+        if (type === 'amount') {
+          await this.$refs.amountTable.insert().then((data) => {
+            this.inputForm.amountInfos.push(data)
+          })
+        }
+      }
+    }
+  }
+</script>

+ 693 - 0
src/views/modules/materialManagement/purchase/PurchaseForm.vue

@@ -0,0 +1,693 @@
+<template>
+  <div>
+    <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="formReadOnly"
+             label-width="100px" @submit.native.prevent>
+
+      <el-divider content-position="left"><i class="el-icon-document"></i> 基础信息</el-divider>
+      <el-row :gutter="26">
+        <el-col :span="12">
+          <el-form-item label="采购编号" prop="purchaseNo">
+            <el-input placeholder="自动生成" v-model="inputForm.purchaseNo" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="采购简述" prop="purchaseSketch"
+                        :rules="[{required: true, message: '采购简述不能为空', trigger: 'blur'}
+                 ]">
+            <el-input v-model="inputForm.purchaseSketch" placeholder="请填写采购简述"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="经办人" prop="handledBy">
+            <el-input v-model="inputForm.handledBy" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="经办人部门" prop="handledByOffice">
+            <SelectTree
+              :disabled="true"
+              ref="officeTree"
+              :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+
+              :url="`/sys/office/treeData?type=2`"
+              :value="inputForm.handledByOffice"
+              :accordion="true"
+              size="medium"
+              @getValue="(value) => {inputForm.handledByOffice=value}"/>
+<!--            <el-input v-model="inputForm.handledByOffice" :disabled="true"></el-input>-->
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="采购时间" prop="purchaseDate" :rules="[{required: true, message:'请选择采购时间', trigger:'blur'}]">
+            <el-date-picker
+              v-model="inputForm.purchaseDate"
+              type="date"
+              value-format="yyyy-MM-dd"
+              style="width: 100%"
+              placeholder="选择日期">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="采购方式" prop="purchaseMode"
+                        :rules="[]">
+            <el-select v-model="inputForm.purchaseMode" placeholder="请选择采购方式" style="width:100%;">
+              <el-option
+                v-for="item in $dictUtils.getDictList('material_purchase_mode')"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="备注" prop="remarks">
+            <el-input v-model="inputForm.remarks"
+                      type="textarea"
+                      :rows="5"
+                      maxlength="500"
+                      placeholder="请输入简介"
+                      show-word-limit>
+            </el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-divider content-position="left"><i class="el-icon-document"></i>
+        报销详情
+        <el-button style="margin-left: 20px" type="primary" :disabled="method==='view' || this.formReadOnly" size="mini" @click="insertEvent('detail')" plain>
+          新增
+        </el-button>
+      </el-divider>
+      <el-row  :gutter="15" >
+        <vxe-table
+          border
+          show-footer
+          show-overflow
+          :footer-method="footerMethod"
+          ref="detailTable"
+          class="vxe-table-element"
+          :data="inputForm.detailInfos"
+          style="margin-left: 5em"
+          @cell-click=""
+          @edit-closed=""
+          highlight-current-row
+          :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
+        >
+          <vxe-table-column field="purchaser" title="采购人" :edit-render="{}" :rules="[{required: true, message:'请选择采购人', trigger:'blur'}]">
+            <template v-slot:edit="scope">
+              <el-input v-model="scope.row.purchaser" @focus="userPullListForm(scope.$rowIndex)"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="procurementOffice" title="采购部门" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input :disabled='true' v-model="scope.row.procurementOffice" ></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="procurementType" title="采购类型" :edit-render="{}" :rules="[{required: true, message:'请选择采购类型', trigger:'blur'}]">
+            <template v-slot:edit="scope">
+              <el-input v-model="scope.row.procurementType" @focus="typePullForm(scope.$rowIndex)"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="tradeName" title="商品名称" :edit-render="{}" :rules="[{required: true, message:'请填写商品名称', trigger:'blur'}]">
+            <template v-slot:edit="scope">
+              <el-input v-model="scope.row.tradeName"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="tradePrice" title="商品单价(元)" :edit-render="{}" :rules="[{required: true, message:'请输入商品单价', trigger:'blur'}]">
+            <template v-slot:edit="scope">
+              <el-input maxlength="15" v-model="scope.row.tradePrice" @keyup.native="scope.row.tradePrice = twoDecimalPlaces(scope.row.tradePrice)"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="tradeNumber" title="商品数量" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input v-model="scope.row.tradeNumber" oninput ="value=value.replace(/\D|^0/g,'')" maxlength="10"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="company" title="单位" :edit-render="{}" :rules="[{required: true, message:'请填写单位', trigger:'blur'}]">
+            <template v-slot:edit="scope">
+              <el-input v-model="scope.row.company"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="remarks" title="备注" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input v-model="scope.row.remarks" ></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column title="操作" width="300">
+            <template v-slot="scope">
+              <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'detail')">删除</el-button>
+              <el-button size="mini" type="primary" @click="sss(scope.$rowIndex)">上传附件</el-button>
+              <el-button size="mini" type="primary" v-if="scope.row.status !== '1' || scope.row.status !== '' " :disabled="false" @click="seeFileInfo(scope.$rowIndex)">查看文件详情</el-button>
+<!--              <el-button size="mini" v-if="formReadOnly" :disabled="false" type="primary" @click="seeFileInfo(scope.$rowIndex)">查看文件详情</el-button>-->
+            </template>
+          </vxe-table-column>
+        </vxe-table>
+      </el-row>
+
+      <!--<el-divider content-position="left"><i class="el-icon-document"></i>
+        专用发票信息
+        <el-button style="margin-left: 20px" type="primary" :disabled="method==='view' || this.formReadOnly " size="mini" @click="insertEvent('amount')" plain>
+          新增
+        </el-button>
+      </el-divider>
+      <el-row  :gutter="15" >
+        <vxe-table
+          border
+          show-overflow
+          ref="amountTable"
+          class="vxe-table-element"
+          :data="inputForm.amountInfos"
+          style="margin-left: 5em"
+          @cell-click=""
+          @edit-closed=""
+          highlight-current-row
+          :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
+        >
+          <vxe-table-column field="code" title="发票代码" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input oninput ="value=value.replace(/\D|^0/g,'')" maxlength="10" v-model="scope.row.code" ></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="number" title="发票号" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input oninput ="value=value.replace(/\D|^0/g,'')" maxlength="8" @change="isExict(scope.row)" v-model="scope.row.number" ></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="amount" title="金额" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input maxlength="15" v-model="scope.row.amount" @keyup.native="scope.row.amount = twoDecimalPlaces(scope.row.amount)" @change="countAmount(scope.row)"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="taxAmount" title="税额" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input maxlength="15" v-model="scope.row.taxAmount" @keyup.native="scope.row.taxAmount = twoDecimalPlaces(scope.row.taxAmount)" @change="countAmount(scope.row)"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="count" title="价税合计" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input disabled="true" v-model="scope.row.count" ></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column title="操作" width="100">
+            <template v-slot="scope">
+              <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'amount')">删除</el-button>
+            </template>
+          </vxe-table-column>
+        </vxe-table>
+      </el-row>-->
+
+      <!-- 附件 -->
+      <MaterialManagementDialog ref="materialManagementDialog" @getUpload="getUpload"></MaterialManagementDialog>
+      <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+      <CwProgramPageForm ref="cwProgramPageForm" @getProgram="getProgram"></CwProgramPageForm>
+      <MaterialTypePullForm ref="materialTypePullForm" @getProgramForType="getProgramForType"></MaterialTypePullForm>
+<!--      <CwReimbursementTypePullForm ref="cwReimbursementTypePullForm" @getProgramForType="getProgramForType"></CwReimbursementTypePullForm>-->
+      <UserPullForm ref="userPullForm" @getProgramForUser="getProgramForUser"></UserPullForm>
+    </el-form>
+  </div>
+</template>
+
+<script>
+  // import UpLoadComponentDialog from '@/views/common/UpLoadComponentDialog'
+  import MaterialManagementDialog from '../file/MaterialManagementDialog'
+  // import ReimbursementApprovalService from '@/api/cw/reimbursementApproval/ReimbursementApprovalService'
+  import MaterialManagementService from '@/api/materialManagement/MaterialManagementService'
+  // import ReimbursementApprovalTypeService from '@/api/cw/reimbursementApproval/ReimbursementApprovalTypeService'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import XEUtils from 'xe-utils'
+  import UserService from '@/api/sys/UserService'
+  import CwProgramPageForm from '@/views/modules/cw/reimbursementApproval/info/CwProgramPageForm'
+  // import CwReimbursementTypePullForm from '@/views/modules/cw/reimbursementApproval/info/CwReimbursementTypePullForm'
+  import MaterialTypePullForm from '../info/MaterialTypePullForm'
+  import UserPullForm from '@/views/modules/finance/invoice/UserPullForm'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        indexRow: '',
+        inputForm: {
+          tradeTotalPrice: '',  // 商品总价
+          fileInfoLost: [],
+          purchaseMode: '',
+          handledByOffice: '',
+          handledBy: '',
+          purchaseSketch: '',
+          purchaseNo: '', // 采购编号
+          userId: '',
+          purchaseDate: '',
+          remarks: '',
+          detailInfos: [],
+          // amountInfos: [],
+          files: [] // 附件信息
+        }
+      }
+    },
+    // ReimbursementApprovalService: null,
+    MaterialManagementService: null,
+    // reimbursementApprovalTypeService: null,
+    userService: null,
+    created () {
+      // this.reimbursementApprovalService = new ReimbursementApprovalService()
+      this.materialManagementService = new MaterialManagementService()
+      // this.inputForm.userId = this.userId
+      // this.inputForm.handledBy = this.name
+      // this.inputForm.purchaseDate = new Date()
+      // this.inputForm.deptName = this.officeName
+      this.userService = new UserService()
+      // this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
+    },
+    props: {
+      businessId: {
+        type: String,
+        default: ''
+      },
+      formReadOnly: {
+        type: Boolean,
+        default: false
+      }
+    },
+    components: {
+      MaterialManagementDialog,
+      UpLoadComponent,
+      SelectUserTree,
+      SelectTree,
+      CwProgramPageForm,
+      // CwReimbursementTypePullForm,
+      MaterialTypePullForm,
+      UserPullForm
+    },
+    computed: {
+      name () {
+        return JSON.parse(localStorage.getItem('user')).name
+      },
+      officeName () {
+        return JSON.parse(localStorage.getItem('user')).officeDTO.name
+      },
+      userId () {
+        return JSON.parse(localStorage.getItem('user')).id
+      }
+    },
+    watch: {
+      'businessId': {
+        handler (newVal) {
+          if (this.businessId && this.businessId !== 'false') {
+            this.init('edit', this.businessId)
+          } else {
+            this.init('clean', '')
+          }
+        },
+        immediate: true,
+        deep: false
+      }
+    },
+    methods: {
+      init (method, id) {
+        this.method = method
+        this.inputForm = {
+          tradeTotalPrice: '',  // 商品总价
+          fileInfoLost: [],
+          purchaseMode: '',
+          handledByOffice: '',
+          handledBy: JSON.parse(localStorage.getItem('user')).name,
+          purchaseSketch: '',
+          purchaseNo: '', // 采购编号
+          userId: JSON.parse(localStorage.getItem('user')).id,
+          purchaseDate: new Date(),
+          remarks: '',
+          detailInfos: [],
+          // amountInfos: [],
+          files: [] // 附件信息
+        }
+        if (method === 'add') {
+          this.title = `新建采购类型`
+        } else if (method === 'edit') {
+          this.inputForm.id = id
+          this.title = '修改采购类型'
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          console.log('进来了')
+          if (this.formReadOnly === true && this.businessId !== 'false') {
+            method = 'view'
+          }
+          if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
+            this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
+          }
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.$refs.inputForm.resetFields()
+            this.materialManagementService.findById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
+                this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
+              }
+              this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
+              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+              this.loading = false
+            })
+            // this.reimbursementApprovalService.findById(this.inputForm.id).then(({data}) => {
+            //   this.inputForm = this.recover(this.inputForm, data)
+            //   if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
+            //     this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
+            //   }
+            //   this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
+            //   this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+            //   this.loading = false
+            // })
+          }
+          if (method !== 'edit' && method !== 'view') {
+            this.$refs.uploadComponent.newUpload(method, [], 'reimbursement')
+          }
+        })
+      },
+      getUpload (p, index) {
+        p.then((list) => {
+          // list为返回数据
+          this.inputForm.detailInfos[index].fileInfoLost = list
+          this.inputForm.detailInfos[index].fileNumber = list.length
+          this.tableKeyClient = Math.random()
+        })
+      },
+      seeFileInfo (index) {
+        if (this.commonJS.isEmpty(this.inputForm.detailInfos[index].fileInfoLost)) {
+          this.inputForm.detailInfos[index].fileInfoLost = []
+        }
+        this.$refs.materialManagementDialog.newUpload('view', this.inputForm.detailInfos[index].fileInfoLost, null, null, null, null, null, false, index)
+      },
+      sss (index) {
+        if (this.commonJS.isEmpty(this.inputForm.detailInfos[index].fileInfoLost)) {
+          this.inputForm.detailInfos[index].fileInfoLost = []
+        }
+        this.$refs.materialManagementDialog.newUpload(null, this.inputForm.detailInfos[index].fileInfoLost, null, null, null, null, null, false, index)
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            if (this.$refs.uploadComponent.checkProgress()) {
+              this.loading = false
+              return
+            }
+            if (this.commonJS.isEmpty(this.inputForm.files)) {
+              this.inputForm.files = []
+            }
+            this.inputForm.id = this.businessId
+            this.inputForm.files = this.$refs.uploadComponent.getDataList()
+            this.materialManagementService.save(this.inputForm).then(({data}) => {
+              this.close()
+              this.$message.success(data)
+              this.$emit('refreshDataList')
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+            // this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
+            //   this.close()
+            //   this.$message.success(data)
+            //   this.$emit('refreshDataList')
+            //   this.loading = false
+            // }).catch(() => {
+            //   this.loading = false
+            // })
+          }
+        })
+      },
+      close () {
+        this.$refs.inputForm.resetFields()
+        this.inputForm.detailInfos = []
+        // this.inputForm.amountInfos = []
+        this.$refs.uploadComponent.clearUpload()
+        this.visible = false
+      },
+      // 删除
+      removeEvent (row, rowIndex, type) {
+        if (type === 'detail') {
+          this.$refs.detailTable.remove(row)
+          this.inputForm.detailInfos.splice(rowIndex, 1)
+        }
+        if (type === 'amount') {
+          this.$refs.amountTable.remove(row)
+          // this.inputForm.amountInfos.splice(rowIndex, 1)
+        }
+      },
+      // 新增
+      async insertEvent (type) {
+        if (type === 'detail') {
+          await this.$refs.detailTable.insert().then((data) => {
+            data.purchaser = this.name
+            data.procurementOffice = this.officeName
+            this.inputForm.detailInfos.push(data)
+          })
+        }
+        if (type === 'amount') {
+          await this.$refs.amountTable.insert().then((data) => {
+            // this.inputForm.amountInfos.push(data)
+          })
+        }
+      },
+      // 暂存
+      async saveForm (callback) {
+        this.loading = true
+        if (this.$refs.uploadComponent.checkProgress()) {
+          this.loading = false
+          return
+        }
+        if (this.commonJS.isEmpty(this.inputForm.files)) {
+          this.inputForm.files = []
+        }
+        this.inputForm.files = this.$refs.uploadComponent.getDataList()
+        this.inputForm.status = '1'
+        this.materialManagementService.save(this.inputForm).then(({data}) => {
+          callback()
+          this.$refs.inputForm.resetFields()
+          this.loading = false
+        }).catch(() => {
+          this.$refs.inputForm.resetFields()
+          this.loading = false
+        })
+        // this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
+        //   callback()
+        //   this.$refs.inputForm.resetFields()
+        //   this.loading = false
+        // }).catch(() => {
+        //   this.$refs.inputForm.resetFields()
+        //   this.loading = false
+        // })
+      },
+      // 送审
+      async startForm (callback) {
+        this.$refs['inputForm'].validate(async (valid) => {
+          if (valid) {
+            this.loading = true
+            if (this.$refs.uploadComponent.checkProgress()) {
+              this.loading = false
+              return
+            }
+            if (this.commonJS.isEmpty(this.inputForm.files)) {
+              this.inputForm.files = []
+            }
+            if (this.commonJS.isEmpty(this.inputForm.detailInfos)) {
+              this.$message.error('至少填写一条报销详情信息')
+              this.loading = false
+              return
+            } else {
+              let i = this.inputForm.detailInfos.length
+              for (let j = 0; j < i; j++) {
+                let k = j + 1
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].purchaser)) {
+                  this.$message.error('报销详情第' + k + '行请选择采购人')
+                  this.loading = false
+                  return
+                }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].procurementType)) {
+                  this.$message.error('报销详情第' + k + '行请选择采购类型')
+                  this.loading = false
+                  return
+                }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].tradePrice)) {
+                  this.$message.error('报销详情第' + k + '行请输入商品单价')
+                  this.loading = false
+                  return
+                }
+              }
+            }
+            this.inputForm.files = this.$refs.uploadComponent.getDataList()
+            this.inputForm.status = '2'
+            this.materialManagementService.save(this.inputForm).then(({data}) => {
+              callback(data.businessTable, data.businessId, this.inputForm)
+              this.$refs.inputForm.resetFields()
+              this.loading = false
+            }).catch(() => {
+              this.$refs.inputForm.resetFields()
+              this.loading = false
+            })
+            // this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
+            //   callback(data.businessTable, data.businessId, this.inputForm)
+            //   this.$refs.inputForm.resetFields()
+            //   this.loading = false
+            // }).catch(() => {
+            //   this.$refs.inputForm.resetFields()
+            //   this.loading = false
+            // })
+          }
+        })
+      },
+      // 通过
+      async agreeForm (callback) {
+        this.$refs['inputForm'].validate(async (valid) => {
+          if (valid) {
+            this.loading = true
+            if (this.$refs.uploadComponent.checkProgress()) {
+              this.loading = false
+              return
+            }
+            if (this.commonJS.isEmpty(this.inputForm.files)) {
+              this.inputForm.files = []
+            }
+            this.inputForm.files = this.$refs.uploadComponent.getDataList()
+            await this.userService.is().then(({data}) => {
+              if (data) {
+                this.inputForm.status = '5'
+              }
+            })
+            this.materialManagementService.save(this.inputForm).then(({data}) => {
+              callback(data.businessTable, data.businessId, this.inputForm)
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+            // this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
+            //   callback(data.businessTable, data.businessId, this.inputForm)
+            //   this.loading = false
+            // }).catch(() => {
+            //   this.loading = false
+            // })
+          }
+        })
+      },
+      // 修改状态
+      updateStatusById (type) {
+        if (type === 'reject') {
+          this.inputForm.status = '4'
+          // this.reimbursementApprovalService.updateStatusById(this.inputForm)
+          this.materialManagementService.updateStatusById(this.inputForm)
+        }
+      },
+      footerMethod ({ columns, data }) {
+        const footerData = [
+          columns.map((column, columnIndex) => {
+            if (columnIndex === 0) {
+              return '商品总价'
+            }
+            if (['tradePrice'].includes(column.property)) {
+              // eslint-disable-next-line no-undef
+              this.inputForm.tradeTotalPrice = XEUtils.sum(data, column.property)
+              console.log('this.inputForm.tradeTotalPrice', this.inputForm.tradeTotalPrice)
+              return XEUtils.sum(data, column.property)
+            }
+            return null
+          })
+        ]
+        return footerData
+      },
+      twoDecimalPlaces (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
+      },
+      // isExict (row) {
+      //   this.reimbursementApprovalService.checkNumber(row.number).then(({data}) => {
+      //     if (data) {
+      //       this.$message.error('该发票号已存在')
+      //       row.number = ''
+      //     }
+      //   })
+      // },
+      countAmount (row) {
+        let amount
+        let taxAmount
+        let count = 0
+        if (!this.commonJS.isEmpty(row.amount)) {
+          amount = parseFloat(row.amount)
+          count = count + amount
+        }
+        if (!this.commonJS.isEmpty(row.taxAmount)) {
+          taxAmount = parseFloat(row.taxAmount)
+          count = count + taxAmount
+        }
+        row.count = parseFloat(count).toFixed(2)
+      },
+      getProgram (rows) {
+        console.log('aaaaaaaaaaa', rows[0])
+        this.inputForm.detailInfos[this.indexRow].projectId = rows[0].id
+        this.inputForm.detailInfos[this.indexRow].projectName = rows[0].name
+        this.inputForm.detailInfos[this.indexRow].reportNumber = rows[0].reportNo
+        this.indexRow = ''
+        this.$forceUpdate()
+      },
+      // 采购类型下拉弹窗
+      typePullForm (rowIndex) {
+        this.indexRow = rowIndex
+        // this.$refs.reimbursementTypePullForm.init()
+        // this.$refs.cwReimbursementTypePullForm.init()
+        this.$refs.materialTypePullForm.init()
+      },
+      getProgramForType (rows) {
+        this.inputForm.detailInfos[this.indexRow].typeId = rows[0].id
+        this.inputForm.detailInfos[this.indexRow].procurementType = rows[0].name
+        this.indexRow = ''
+        this.$forceUpdate()
+      },
+      // 采购人下拉弹窗
+      userPullListForm (rowIndex) {
+        this.indexRow = rowIndex
+        this.$refs.userPullForm.init()
+      },
+      getProgramForUser (rows) {
+        console.log('rows', rows)
+        this.inputForm.detailInfos[this.indexRow].userId = rows[0].id
+        this.inputForm.detailInfos[this.indexRow].purchaser = rows[0].name
+        this.inputForm.detailInfos[this.indexRow].deptId = rows[0].parentId
+        this.inputForm.detailInfos[this.indexRow].procurementOffice = rows[0].officeName
+        this.indexRow = ''
+        this.$forceUpdate()
+      }
+    }
+  }
+</script>

+ 431 - 0
src/views/modules/materialManagement/purchase/PurchaseList.vue

@@ -0,0 +1,431 @@
+<template>
+  <div class="page">
+    <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+      <!-- 搜索框-->
+      <el-form-item label="采购简述" prop="purchaseSketch">
+        <el-input size="small" v-model="searchForm.purchaseSketch" placeholder="请输入采购简述" clearable></el-input>
+      </el-form-item>
+<!--      <el-form-item label="经办人" prop="handledBy">-->
+<!--        <el-input size="small" v-model="searchForm.handledBy" placeholder="请输入经办人" clearable></el-input>-->
+<!--      </el-form-item>-->
+      <el-form-item label="经办人" prop="handledBy">
+        <SelectUserTree
+          ref="companyTree"
+          :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+          :url="`/sys/user/treeUserDataAllOffice?type=2`"
+          :value="searchForm.handledBy"
+          :clearable="true"
+          :accordion="true"
+          @getValue="(value) => {searchForm.handledBy=value}"/>
+      </el-form-item>
+      <el-form-item  prop="handledByOffice" label="经办人部门">
+        <SelectTree
+          ref="officeTree"
+          :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+
+          :url="`/sys/office/treeData?type=1`"
+          :value="searchForm.handledByOffice"
+          :accordion="true"
+          @getValue="(value) => {searchForm.handledByOffice=value}"/>
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="searchForm.status" placeholder="请选择" style="width:100%;">
+          <el-option
+            v-for="item in $dictUtils.getDictList('cw_status')"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="采购类别" prop="procurementType">
+        <el-select v-model="searchForm.procurementType" placeholder="请选择" style="width:100%;">
+          <el-option
+            v-for="item in $dictUtils.getDictList('filed_type')"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="合同金额" prop="contractAmounts">
+        <InputNumber :disabled="false" :precision="num" v-model="searchForm.contractAmounts"></InputNumber>
+      </el-form-item>
+      <el-form-item label="申请时间" prop="contractDates">
+        <el-date-picker
+          placement="bottom-start"
+          format="yyyy-MM-dd HH:mm:ss"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          v-model="searchForm.contractDates"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </el-date-picker>
+      </el-form-item>
+
+      <el-form-item>
+        <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
+        <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <div class="bg-white top" style="">
+      <vxe-toolbar :refresh="{query: refreshList}" custom>
+        <template #buttons>
+          <el-button v-if="hasPermission('cw_work_client:info:add')" type="primary" size="small" icon="el-icon-plus" @click="start()">新建</el-button>
+        </template>
+      </vxe-toolbar>
+      <div style="height: calc(100% - 90px)">
+        <vxe-table
+          :key="tableKey"
+          border="inner"
+          auto-resize
+          resizable
+          height="auto"
+          :loading="loading"
+          size="small"
+          ref="clientTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          @sort-change="sortChangeHandle"
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :checkbox-config="{}">
+          <vxe-column type="seq" width="60" title="序号"></vxe-column>
+          <vxe-column min-width="160" align="center" title="采购编号" field="purchaseNo"></vxe-column>
+          <vxe-column min-width="160" align="center" title="采购简述" field="purchaseSketch">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" v-if="hasPermission('material:list')" @click="view(scope.row.id)">{{scope.row.purchaseSketch}}</el-link>
+              <el-link  type="primary" :underline="false" v-else-if="hasPermission('material:list')"  @click="view(scope.row.id,)">{{scope.row.purchaseSketch}}</el-link>
+              <span v-else>{{scope.row.purchaseSketch}}</span>
+            </template>
+          </vxe-column>
+          <vxe-column min-width="160" align="center" title="采购类型" field="procurementType"></vxe-column>
+          <vxe-column min-width="160" align="center" title="采购方式" field="purchaseMode"></vxe-column>
+          <vxe-column min-width="160" align="center" title="采购金额(元)" field="tradeTotalPrice"></vxe-column>
+          <vxe-column min-width="160" align="center" title="经办人" field="handledBy"></vxe-column>
+          <vxe-column min-width="160" align="center" title="经办人部门" field="handledByOfficeName"></vxe-column>
+          <vxe-column min-width="160" align="center" title="申请时间" field="createDate"></vxe-column>
+          <vxe-column  min-width="150px"align="center" fixed="right" title="状态" field="status" >
+            <template slot-scope="scope">
+              <el-button  type="text" @click="detail(scope.row)" effect="dark" size="mini"
+                          :type="$dictUtils.getDictLabel('cw_status_flag', scope.row.status, '-')">
+                {{$dictUtils.getDictLabel("cw_status", scope.row.status, '-')}}
+              </el-button>
+            </template>
+          </vxe-column>
+
+          <vxe-column title="操作" width="150px" fixed="right" align="center">
+            <template  slot-scope="scope">
+              <el-button v-if="hasPermission('material:edit')&&scope.row.createBy === $store.state.user.id&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4')" type="text"  size="small" @click="push(scope.row)">修改</el-button>
+              <el-button v-else-if="hasPermission('material:edit')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'||scope.row.status==='5')" type="text"  size="small" @click="edit(scope.row.id)">修改</el-button>
+              <el-button v-if="hasPermission('material:edit')&&scope.row.createBy === $store.state.user.id&&scope.row.status==='2'" type="text"  size="small" @click="reback(scope.row)">撤回</el-button>
+              <el-button v-if="hasPermission('material:del')&&scope.row.createBy === $store.state.user.id&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
+              <el-button v-else-if="hasPermission('material:del')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'||scope.row.status==='5')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
+            </template>
+          </vxe-column>
+        </vxe-table>
+        <vxe-pager
+          background
+          size="small"
+          :current-page="tablePage.currentPage"
+          :page-size="tablePage.pageSize"
+          :total="tablePage.total"
+          :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+          @page-change="currentChangeHandle">
+        </vxe-pager>
+        <UpdateInfoForm ref="updateInfoForm" @refreshDataList="refreshList"></UpdateInfoForm>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  import UpdateInfoForm from '../info/UpdateInfoForm'
+  import InputNumber from '@/views/modules/cw/workContract/InputNumber.vue'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import WorkClientService from '@/api/cw/workClientInfo/WorkClientService'
+  // import ReportCancellApplyService from '@/api/cw/reportCancellApply/ReportCancellApplyService'
+  import MaterialManagementService from '@/api/materialManagement/MaterialManagementService'
+  import TaskService from '@/api/flowable/TaskService'
+  import ProcessService from '@/api/flowable/ProcessService'
+  import pick from 'lodash.pick'
+  import UserService from '@/api/sys/UserService'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  export default {
+    data () {
+      return {
+        num: 0,
+        searchForm: {
+          contractAmounts: [],
+          purchaseSketch: '',
+          handledBy: '',
+          handledByOffice: '',
+          status: '',
+          contractDates: [],
+          procurementType: '',
+          createBy: ''
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        tableKey: '',
+        loading: false,
+        processDefinitionAuditId: '',
+        procDefAuditKey: '',
+        isAdmin: false,
+        create: ''
+      }
+    },
+    workClientService: null,
+    // projectReportService: null,
+    // reportCancellApplyService: null,
+    materialManagementService: null,
+    taskService: null,
+    processService: null,
+    userService: null,
+    created () {
+      this.workClientService = new WorkClientService()
+      // this.projectReportService = new ProjectReportService()
+      // this.reportCancellApplyService = new ReportCancellApplyService()
+      this.materialManagementService = new MaterialManagementService()
+      this.taskService = new TaskService()
+      this.processService = new ProcessService()
+      this.userService = new UserService()
+    },
+    components: {
+      InputNumber,
+      SelectUserTree,
+      SelectTree,
+      UpdateInfoForm
+    },
+    computed: {
+      userName () {
+        return JSON.parse(localStorage.getItem('user')).name
+      },
+      user () {
+        this.createName = JSON.parse(localStorage.getItem('user')).name
+        return JSON.parse(localStorage.getItem('user'))
+      }
+    },
+    mounted () {
+      this.refreshList()
+    },
+    activated () {
+      this.refreshList()
+    },
+    methods: {
+      // 新增
+      add () {
+        // this.$refs.reportManagementForm.init('add', '')
+      },
+      // 修改
+      edit (id) {
+        id = id || this.$refs.clientTable.getCheckboxRecords().map(item => {
+          return item.id
+        })[0]
+        this.$refs.updateInfoForm.init('edit', id)
+      },
+      // 查看
+      view (id) {
+        this.$refs.updateInfoForm.init('view', id)
+      },
+      // 查询当前用户是否是管理员用户
+      checkIsAdmin () {
+        this.userService.is().then(({data}) => {
+          this.isAdmin = data
+        })
+      },
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.materialManagementService.list({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          this.tableKey = Math.random()
+          this.loading = false
+        })
+        this.checkIsAdmin()
+        this.processService.getByName('物资管理-采购申请').then(({data}) => {
+          if (!this.commonJS.isEmpty(data.id)) {
+            this.processDefinitionAuditId = data.id
+            this.procDefAuditKey = data.key
+          }
+        })
+      },
+      // 当前页
+      currentChangeHandle ({ currentPage, pageSize }) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.refreshList()
+      },
+      // 排序
+      sortChangeHandle (column) {
+        this.tablePage.orders = []
+        if (column.order != null) {
+          this.tablePage.orders.push({column: this.$utils.toLine(column.property), asc: column.order === 'asc'})
+        }
+        this.refreshList()
+      },
+      // 删除
+      del (id) {
+        let ids = id || this.$refs.clientTable.getCheckboxRecords().map(item => {
+          return item.id
+        }).join(',')
+        this.$confirm(`确定删除所选项吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.loading = true
+          this.materialManagementService.remove(ids).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+            this.loading = false
+          })
+          // this.reportCancellApplyService.delete(ids).then(({data}) => {
+          //   this.$message.success(data)
+          //   this.refreshList()
+          //   this.loading = false
+          // })
+        })
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.refreshList()
+      },
+      start () {
+        // 读取流程表单
+        let tabTitle = `发起流程【采购申请】`
+        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [采购申请]`
+        this.taskService.getTaskDef({ procDefId: this.processDefinitionAuditId,
+          status: 'startAndHold'}).then((data) => {
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                procDefId: this.processDefinitionAuditId,
+                procDefKey: this.procDefAuditKey,
+                status: 'startAndHold',
+                title: tabTitle,
+                formType: data.data.formType,
+                formUrl: data.data.formUrl,
+                formTitle: processTitle,
+                businessId: 'false',
+                isShow: false,
+                routePath: '/materialManagement/purchase/PurchaseList'
+              }
+            })
+          })
+      },
+      // 发起采购申请
+      push (row) {
+        console.log('row', row)
+        // 读取流程表单
+        let title = `发起流程【采购申请】`
+        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[采购申请]`
+        let status = 'startAndHold'
+        if (row.status === '3' || row.status === '4') {
+          status = 'startAndClose'
+        }
+        this.taskService.getTaskDef({ procDefId: this.processDefinitionAuditId,
+          businessId: row.id,
+          businessTable: 'material_management_pruchase_request_basics'}).then((data) => {
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                procDefId: this.processDefinitionAuditId,
+                procDefKey: this.procDefAuditKey,
+                title: title,
+                formType: data.data.formType,
+                formUrl: data.data.formUrl,
+                formTitle: processTitle,
+                businessTable: 'material_management_pruchase_request_basics',
+                businessId: row.id,
+                isShow: 'false',
+                status: status,
+                routePath: '/materialManagement/purchase/PurchaseList'
+              }
+            })
+          })
+      },
+      // 查看客户登记流程结果
+      detail (row) {
+        if (row.status !== '0' && row.status !== '1') {
+          // eslint-disable-next-line eqeqeq
+          this.taskService.getTaskDef({
+            procInsId: row.procInsId,
+            procDefId: this.processDefinitionAuditId
+          }).then(({data}) => {
+            this.$router.push({
+              path: '/flowable/task/TaskFormDetail',
+              query: {
+                isShow: 'false',
+                readOnly: true,
+                title: '质控管理' + '流程详情',
+                formTitle: '质控管理' + '流程详情',
+                businessId: row.id,
+                status: 'reback',
+                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'title', 'businessId')
+              }
+            })
+          })
+        }
+      },
+      // 撤回报告流程
+      reback (row) {
+        this.$confirm(`确定要撤回该申请吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          await this.materialManagementService.findById(row.id).then(({data}) => {
+            if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+              this.$message.error('数据已发生改变或不存在,请刷新数据')
+              this.refreshList()
+            } else {
+              this.processService.revokeProcIns(row.procInsId).then(({data}) => {
+                let form = {status: '3', id: row.id}
+                this.materialManagementService.updateStatusById(form)
+                this.$message.success(data)
+                this.refreshList()
+              })
+            }
+          })
+          // await this.reportCancellApplyService.queryById(row.id).then(({data}) => {
+          //   if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+          //     this.$message.error('数据已发生改变或不存在,请刷新数据')
+          //     this.refreshList()
+          //   } else {
+          //     this.processService.revokeProcIns(row.procInsId).then(({data}) => {
+          //       let form = {status: '3', id: row.id}
+          //       this.reportCancellApplyService.updateStatusById(form)
+          //       this.$message.success(data)
+          //       this.refreshList()
+          //     })
+          //   }
+          // })
+        })
+      }
+    }
+  }
+</script>