Ver código fonte

Merge remote-tracking branch 'origin/master'

lizhenhao 2 anos atrás
pai
commit
66e680810a

+ 46 - 0
src/api/materialManagement/CollectService.js

@@ -0,0 +1,46 @@
+import request from '@/utils/httpRequest'
+
+export default class CollectService {
+  updateStatusById (param) {
+    return request({
+      url: '/material/collect/updateStatusById',
+      method: 'post',
+      data: param
+    })
+  }
+  remove (id) {
+    return request({
+      url: '/material/collect/remove',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  save (param) {
+    return request({
+      url: '/material/collect/save',
+      method: 'post',
+      data: param
+    })
+  }
+  findById (id) {
+    return request({
+      url: '/material/collect/findById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  list (param) {
+    return request({
+      url: '/material/collect/list',
+      method: 'get',
+      params: param
+    })
+  }
+  wareHouseList (params) {
+    return request({
+      url: '/material/collect/wareHouseList',
+      method: 'get',
+      params: params
+    })
+  }
+}

+ 3 - 3
src/views/modules/cw/reportManagement/ReportManagementAddForm.vue

@@ -403,15 +403,15 @@
 <!--              &lt;!&ndash;                <el-input size="medium" v-model="inputForm.reportTitleType" placeholder="请填写报告类型及标题"></el-input>&ndash;&gt;-->
 <!--            </el-form-item>-->
 <!--          </el-col>-->
-          <el-col :span="12">
+          <!--<el-col :span="12">
             <el-form-item label="报告编号" prop="reportReviewNo"
                           :rules="[
                    ]">
               <el-input size="medium" :disabled="true" v-model="inputForm.reportReviewNo" placeholder="自动生成">
-                <!--                  <el-button slot="append" icon="el-icon-search" @click="openContractForm()"></el-button>-->
+                &lt;!&ndash;                  <el-button slot="append" icon="el-icon-search" @click="openContractForm()"></el-button>&ndash;&gt;
               </el-input>
             </el-form-item>
-          </el-col>
+          </el-col>-->
           <el-col :span="12">
             <el-form-item label="共印份数(大写)" prop="allPrintNum"
                           :rules="[

+ 3 - 3
src/views/modules/cw/reportManagement/ReportManagementSignatureForm.vue

@@ -364,15 +364,15 @@
 <!--              </el-select>-->
 <!--            </el-form-item>-->
 <!--          </el-col>-->
-          <el-col :span="12">
+          <!--<el-col :span="12">
             <el-form-item label="报告编号" prop="reportReviewNo"
                           :rules="[
                    ]">
               <el-input size="medium" :disabled="true" v-model="inputForm.reportReviewNo" placeholder="自动生成">
-                <!--                  <el-button slot="append" icon="el-icon-search" @click="openContractForm()"></el-button>-->
+                &lt;!&ndash;                  <el-button slot="append" icon="el-icon-search" @click="openContractForm()"></el-button>&ndash;&gt;
               </el-input>
             </el-form-item>
-          </el-col>
+          </el-col>-->
           <el-col :span="12">
             <el-form-item label="共印份数(大写)" prop="allPrintNum"
                           :rules="[

+ 3 - 3
src/views/modules/cw/reportManagement/reportReview/ReportReviewForm.vue

@@ -364,15 +364,15 @@
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col :span="12">
+            <!--<el-col :span="12">
               <el-form-item label="报告编号" prop="reportReviewNo"
                             :rules="[
                    ]">
                 <el-input size="medium" :disabled="true" v-model="inputForm.reportReviewNo" placeholder="自动生成">
-<!--                  <el-button slot="append" icon="el-icon-search" @click="openContractForm()"></el-button>-->
+&lt;!&ndash;                  <el-button slot="append" icon="el-icon-search" @click="openContractForm()"></el-button>&ndash;&gt;
                 </el-input>
               </el-form-item>
-            </el-col>
+            </el-col>-->
             <el-col :span="12">
               <el-form-item label="共印份数(大写)" prop="allPrintNum"
                             :rules="[

+ 694 - 0
src/views/modules/materialManagement/collect/CollectForm.vue

@@ -0,0 +1,694 @@
+<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="collectNo">
+            <el-input placeholder="自动生成" v-model="inputForm.collectNo" :disabled="true"></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="collectDate" :rules="[{required: true, message:'请选择领用时间', trigger:'blur'}]">
+            <el-date-picker
+              v-model="inputForm.collectDate"
+              type="date"
+              value-format="yyyy-MM-dd"
+              style="width: 100%"
+              placeholder="选择日期">
+            </el-date-picker>
+          </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
+          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: 'row', showStatus: false, autoClear: true, icon: '-'}"
+          :edit-rules="validRules"
+        >
+          <vxe-table-column field="recipientAgent" title="领用人" :edit-render="{}" :rules="[{required: true, message:'请选择领用人', trigger:'blur'}]">
+            <template v-slot:edit="scope">
+              <el-input v-model="scope.row.recipientAgent" @focus="userPullListForm(scope.$rowIndex)"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="recipientOffice" title="领用人部门" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input :disabled='true' v-model="scope.row.recipientOffice" ></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="collectType" title="领用类型" :edit-render="{}" :rules="[{required: true, message:'请选择领用类型', trigger:'blur'}]">
+            <template v-slot:edit="scope">
+              <el-input v-model="scope.row.collectType" @focus="typePullForm(scope.$rowIndex)"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="goodsName" title="物品名称" :edit-render="{}" :rules="[{required: true, message:'请填写物品名称', trigger:'blur'}]">
+            <template v-slot:edit="scope">
+              <el-input v-model="scope.row.goodsName" @focus="openPurchasePageForm(scope.$rowIndex, scope.row)"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="surplusNumber" title="剩余数量" :edit-render="{}">
+            <template v-slot:edit="scope">
+<!--              <el-input @change="changeValue" v-model="scope.row.tradeNumber" oninput ="value=value.replace(/\D|^0/g,'')" maxlength="10"></el-input>-->
+<!--              <el-input @change="changeValue" v-model="scope.row.tradeNumber" @blur="scope.row.tradeNumber = twoDecimalPlaces2(scope.row.tradeNumber)" maxlength="10"></el-input>-->
+              <el-input :disabled="true" v-model="scope.row.surplusNumber" maxlength="10"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="collectNumber" title="领用数量" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <!--              <el-input @change="changeValue" v-model="scope.row.tradeNumber" oninput ="value=value.replace(/\D|^0/g,'')" maxlength="10"></el-input>-->
+              <!--              <el-input @change="changeValue" v-model="scope.row.tradeNumber" @blur="scope.row.tradeNumber = twoDecimalPlaces2(scope.row.tradeNumber)" maxlength="10"></el-input>-->
+              <el-input @change="changeValue" v-model="scope.row.collectNumber" @blur="scope.row.collectNumber = twoDecimalPlaces2(scope.row.collectNumber)" 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="formReadOnly" :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-form>
+    <PurchasePageForm  ref="purchasePageForm" @getProject="getContract"></PurchasePageForm>
+    <!-- 附件 -->
+    <MaterialManagementDialog ref="materialManagementDialog" @getUpload="getUpload"></MaterialManagementDialog>
+    <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+    <CwProgramPageForm ref="cwProgramPageForm" @getProgram="getProgram"></CwProgramPageForm>
+    <MaterialTypePullForm ref="materialTypePullForm" @getProgramForType="getProgramForType"></MaterialTypePullForm>
+    <UserPullForm ref="userPullForm" @getProgramForUser="getProgramForUser"></UserPullForm>
+  </div>
+</template>
+
+<script>
+  import UserSelect from '@/components/userSelect'
+  import MaterialManagementDialog from '../file/MaterialManagementDialog'
+  import CollectService from '@/api/materialManagement/CollectService'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import UserService from '@/api/sys/UserService'
+  import CwProgramPageForm from '@/views/modules/cw/reimbursementApproval/info/CwProgramPageForm'
+  import MaterialTypePullForm from '../info/MaterialTypePullForm'
+  import UserPullForm from '@/views/modules/finance/invoice/UserPullForm'
+  import PurchasePageForm from './PurchasePageForm'
+  export default {
+    data () {
+      return {
+        validRules: {
+          recipientAgent: [
+            {required: true, message: '领用人不能为空'}
+          ],
+          recipientOffice: [
+            {required: true, message: '领用人部门不能为空'}
+          ],
+          collectType: [
+            {required: true, message: '领用类型不能为空'}
+          ],
+          goodsName: [
+            {required: true, message: '物品名称不能为空'}
+          ],
+          collectNumber: [
+            {required: true, message: '领用数量不能为空'}
+          ]
+        },
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        indexRow: '',
+        inputForm: {
+          fileInfoLost: [],
+          handledByOffice: '',
+          handledBy: '',
+          handledById: '',
+          collectNo: '', // 领用编号
+          userId: '',
+          collectDate: '',
+          remarks: '',
+          detailInfos: [],
+          // amountInfos: [],
+          files: [] // 附件信息
+        },
+        keyWatch: ''
+      }
+    },
+    CollectService: null,
+    userService: null,
+    created () {
+      this.collectService = new CollectService()
+      this.userService = new UserService()
+    },
+    props: {
+      businessId: {
+        type: String,
+        default: ''
+      },
+      formReadOnly: {
+        type: Boolean,
+        default: false
+      },
+      status: {
+        type: String,
+        default: ''
+      }
+    },
+    components: {
+      UserSelect,
+      MaterialManagementDialog,
+      UpLoadComponent,
+      SelectUserTree,
+      SelectTree,
+      CwProgramPageForm,
+      MaterialTypePullForm,
+      UserPullForm,
+      PurchasePageForm
+    },
+    computed: {
+      bus: {
+        get () {
+          return this.businessId
+        },
+        set (val) {
+          this.businessId = val
+        }
+      },
+      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
+      },
+      recipientAgentId () {
+        return JSON.parse(localStorage.getItem('user')).id
+      },
+      collectTypeId () {
+        return ''
+      }
+    },
+    watch: {
+      'keyWatch': {
+        handler (newVal) {
+          if (this.commonJS.isNotEmpty(this.bus)) {
+            this.init('', this.bus)
+          } else {
+            this.$nextTick(() => {
+              this.$refs.inputForm.resetFields()
+            })
+          }
+        }
+      }
+    },
+    methods: {
+      getKeyWatch (keyWatch) {
+        this.keyWatch = keyWatch
+      },
+      init (method, id) {
+        this.method = method
+        this.inputForm = {
+          fileInfoLost: [],
+          handledByOffice: '',
+          handledBy: JSON.parse(localStorage.getItem('user')).name,
+          handledById: JSON.parse(localStorage.getItem('user')).id,
+          collectNo: '', // 领用编号
+          userId: JSON.parse(localStorage.getItem('user')).id,
+          collectDate: new Date(),
+          remarks: '',
+          detailInfos: [],
+          // amountInfos: [],
+          files: [] // 附件信息
+        }
+        if (method === 'add') {
+          this.title = `新建领用类型`
+        } else if (method === 'edit') {
+          this.title = '修改领用类型'
+        }
+        this.inputForm.id = id
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
+            this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
+          }
+          if (this.status === 'audit' || this.status === 'taskFormDetail') {
+            method = 'view'
+          }
+          this.loading = true
+          this.$refs.inputForm.resetFields()
+          this.collectService.findById(this.inputForm.id).then(({data}) => {
+            if (this.inputForm.id !== 'false') {
+              this.inputForm = this.recover(this.inputForm, data)
+              if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
+                this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
+              }
+              if (this.commonJS.isNotEmpty(data.recipientAgentId)) {
+                this.recipientAgentId = data.recipientAgentId
+              }
+              if (this.commonJS.isNotEmpty(data.collectTypeId)) {
+                this.collectTypeId = data.collectTypeId
+              }
+              if (this.commonJS.isNotEmpty(this.inputForm.detailInfos)) {
+                let i = this.inputForm.detailInfos.length
+                for (let j = 0; j < i; j++) {
+                  if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradePrice)) {
+                    if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradeNumber)) {
+                      this.inputForm.detailInfos[j].priceSum = this.inputForm.detailInfos[j].tradePrice * this.inputForm.detailInfos[j].tradeNumber
+                    }
+                  }
+                }
+              }
+              this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
+              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+              this.loading = false
+            } else {
+              if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
+                this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
+              }
+              if (this.commonJS.isEmpty(this.inputForm.handledBy)) {
+                this.inputForm.handledBy = JSON.parse(localStorage.getItem('user')).name
+              }
+              if (this.commonJS.isEmpty(this.inputForm.handledById)) {
+                this.inputForm.handledById = JSON.parse(localStorage.getItem('user')).id
+              }
+              if (this.commonJS.isEmpty(this.inputForm.collectDate)) {
+                this.inputForm.collectDate = new Date()
+              }
+              this.inputForm.detailInfos = []
+              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.collectService.save(this.inputForm).then(({data}) => {
+              this.close()
+              this.$message.success(data)
+              this.$emit('refreshDataList')
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      },
+      close () {
+        this.inputForm.detailInfos = []
+        // this.inputForm.amountInfos = []
+        this.$refs.uploadComponent.clearUpload()
+
+        this.visible = false
+        this.$refs.inputForm.resetFields()
+      },
+      // 删除
+      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.recipientAgent = JSON.parse(localStorage.getItem('user')).name
+            data.recipientAgentId = this.recipientAgentId
+            data.recipientOffice = 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.collectService.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].recipientAgent)) {
+                  this.$message.error('领用详情第' + k + '行请选择领用人')
+                  this.loading = false
+                  return
+                }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].collectType)) {
+                  this.$message.error('领用详情第' + k + '行请选择领用类型')
+                  this.loading = false
+                  return
+                }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].goodsName)) {
+                  this.$message.error('领用详情第' + k + '行请选择物品名称')
+                  this.loading = false
+                  return
+                }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].collectNumber)) {
+                  this.$message.error('领用详情第' + k + '行请输入领用数量')
+                  this.loading = false
+                  return
+                }
+              }
+            }
+            this.inputForm.files = this.$refs.uploadComponent.getDataList()
+            this.inputForm.status = '2'
+            this.collectService.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()
+            this.inputForm.status = '5'
+            // await this.userService.is().then(({data}) => {
+            //   if (data) {
+            //     this.inputForm.status = '5'
+            //   }
+            // })
+            this.collectService.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.collectService.updateStatusById(this.inputForm)
+        }
+      },
+      // footerMethod ({ columns, data }) {
+      //   const footerData = [
+      //     columns.map((column, columnIndex) => {
+      //       if (columnIndex === 0) {
+      //         return '商品总价'
+      //       }
+      //       if (['priceSum'].includes(column.property)) {
+      //         // eslint-disable-next-line no-undef
+      //         this.inputForm.tradeTotalPrice = XEUtils.sum(data, column.property)
+      //         return XEUtils.sum(data, column.property)
+      //       }
+      //       return null
+      //     })
+      //   ]
+      //   return footerData
+      // },
+      // twoDecimalPlaces (num, index) {
+      //   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
+      //   this.inputForm.detailInfos[index].priceSum = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
+      // },
+      twoDecimalPlaces2 (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
+      },
+      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) {
+        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.materialTypePullForm.init()
+      },
+      getProgramForType (rows) {
+        this.inputForm.detailInfos[this.indexRow].collectTypeId = rows.id
+        this.inputForm.detailInfos[this.indexRow].collectType = rows.name
+        this.indexRow = ''
+        this.$forceUpdate()
+      },
+      // 领用人下拉弹窗
+      userPullListForm (rowIndex) {
+        this.indexRow = rowIndex
+        this.$refs.userPullForm.init()
+      },
+      getProgramForUser (rows) {
+        this.inputForm.detailInfos[this.indexRow].recipientAgentId = rows[0].id
+        this.inputForm.detailInfos[this.indexRow].recipientAgent = rows[0].name
+        this.inputForm.detailInfos[this.indexRow].deptId = rows[0].parentId
+        this.inputForm.detailInfos[this.indexRow].recipientOffice = rows[0].officeName
+        this.indexRow = ''
+        this.$forceUpdate()
+      },
+      getUserInfo (rows) {
+      },
+      openPurchasePageForm (rowIndex, row) {
+        if (this.commonJS.isEmpty(row.collectType)) {
+          this.$message.error('请选择领用类型')
+          return
+        }
+        this.indexRow = rowIndex
+        this.$refs.purchasePageForm.init(row.collectTypeId)
+      },
+      getContract (row) {
+        this.inputForm.detailInfos[this.indexRow].surplusNumber = row.tradeNumber
+        this.inputForm.detailInfos[this.indexRow].goodsName = row.tradeName
+        this.indexRow = ''
+        this.$forceUpdate()
+      },
+      // 值改变事件
+      changeValue () {
+        let i = this.inputForm.detailInfos.length
+        for (let j = 0; j < i; j++) {
+          if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].surplusNumber)) {
+            this.$message.error('请选择领用物品名称')
+            return
+          }
+          if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].collectNumber)) {
+            if (this.inputForm.detailInfos[j].surplusNumber < this.inputForm.detailInfos[j].collectNumber) {
+              this.$message.error('领用数量不能大于剩余数量')
+              return
+            }
+          }
+        }
+      }
+    }
+  }
+</script>

+ 391 - 0
src/views/modules/materialManagement/collect/CollectList.vue

@@ -0,0 +1,391 @@
+<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="collectNo">
+        <el-input size="small" v-model="searchForm.collectNo" placeholder="请输入领用编号" clearable></el-input>
+      </el-form-item>
+      <el-form-item label="领用物品名称" prop="goodsName">
+        <el-input size="small" v-model="searchForm.goodsName" 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="collectDates">
+        <el-date-picker
+          placement="bottom-start"
+          format="yyyy-MM-dd HH:mm:ss"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          v-model="searchForm.collectDates"
+          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="collectNo"></vxe-column>
+          <vxe-column min-width="160" align="center" title="领用物品名称" field="goodsName">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" v-if="hasPermission('material:list')" @click="view(scope.row.id)">{{scope.row.goodsName}}</el-link>
+              <el-link  type="primary" :underline="false" v-else-if="hasPermission('material:list')"  @click="view(scope.row.id,)">{{scope.row.goodsName}}</el-link>
+              <span v-else>{{scope.row.goodsName}}</span>
+            </template>
+          </vxe-column>
+          <vxe-column min-width="160" align="center" title="经办人" field="handledByName"></vxe-column>
+          <vxe-column min-width="160" align="center" title="经办人部门" field="handledByOfficeName"></vxe-column>
+          <vxe-column min-width="160" align="center" title="领用时间" field="collectDate"></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>
+        <UpdateCollectInfoForm ref="updateCollectInfoForm" @refreshList="refreshList"></UpdateCollectInfoForm>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  import CollectService from '@/api/materialManagement/CollectService'
+  import UpdateCollectInfoForm from './UpdateCollectInfoForm'
+  import InputNumber from '@/views/modules/cw/workContract/InputNumber.vue'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import WorkClientService from '@/api/cw/workClientInfo/WorkClientService'
+  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: {
+          handledBy: '',
+          handledByOffice: '',
+          collectNo: '',
+          goodsName: '',
+          collectDates: []
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        tableKey: '',
+        loading: false,
+        processDefinitionAuditId: '',
+        procDefAuditKey: '',
+        isAdmin: false,
+        create: ''
+      }
+    },
+    workClientService: null,
+    collectService: null,
+    taskService: null,
+    processService: null,
+    userService: null,
+    created () {
+      this.workClientService = new WorkClientService()
+      this.collectService = new CollectService()
+      this.taskService = new TaskService()
+      this.processService = new ProcessService()
+      this.userService = new UserService()
+    },
+    components: {
+      InputNumber,
+      SelectUserTree,
+      SelectTree,
+      UpdateCollectInfoForm
+    },
+    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.updateCollectInfoForm.init('edit', id)
+      },
+      // 查看
+      view (id) {
+        this.$refs.updateCollectInfoForm.init('view', id)
+      },
+      // 查询当前用户是否是管理员用户
+      checkIsAdmin () {
+        this.userService.is().then(({data}) => {
+          this.isAdmin = data
+        })
+      },
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.collectService.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.collectService.remove(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/collect/CollectList'
+              }
+            })
+          })
+      },
+      // 发起领用申请
+      push (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_collect_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_collect_basics',
+                businessId: row.id,
+                isShow: 'false',
+                status: status,
+                routePath: '/materialManagement/collect/CollectList'
+              }
+            })
+          })
+      },
+      // 查看客户登记流程结果
+      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.collectService.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.collectService.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>

+ 154 - 0
src/views/modules/materialManagement/collect/PurchasePageForm.vue

@@ -0,0 +1,154 @@
+<template>
+  <div>
+    <el-dialog
+      title="选择商品"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1100px"
+      height="500px"
+      @close="close"
+      append-to-body
+      @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" @submit.native.prevent>
+          <!-- 搜索框-->
+          <el-form-item label="商品名称" prop="tradeName">
+            <el-input size="small" v-model="searchForm.tradeName" 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="400px"
+          :loading="loading"
+          size="small"
+          ref="projectTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :print-config="{}"
+          @sort-change=""
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :row-config="{isCurrent: true}"
+          :radio-config="{trigger: 'row'}"
+        >
+          <vxe-column type="seq" width="60" title="序号"></vxe-column>
+          <vxe-column type="radio" width="40px"></vxe-column>
+          <vxe-column min-width="230" align="center" title="商品名称" field="tradeName"></vxe-column>
+          <vxe-column min-width="230" align="center" title="商品数量" field="tradeNumber"></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>
+      </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="getProject()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import InputNumber from '@/views/modules/sys/workContract/InputNumber.vue'
+  import CollectService from '@/api/materialManagement/CollectService'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        dataList: [],
+        searchForm: {
+          wareHouseType: ''
+        }
+      }
+    },
+    collectService: null,
+    created () {
+      this.collectService = new CollectService()
+    },
+    components: {
+      SelectUserTree,
+      InputNumber
+    },
+    methods: {
+      init (collectType) {
+        this.visible = true
+        this.list(collectType)
+      },
+      // 表单提交
+      getProject () {
+        let row = this.$refs.projectTable.getRadioRecord()
+        if (this.commonJS.isEmpty(row)) {
+          this.$message.error('请选择一条数据')
+          return
+        }
+        this.close()
+        this.$emit('getProject', row)
+      },
+      list (collectType) {
+        this.loading = true
+        // this.searchForm.createId = this.$store.state.user.id
+        // this.searchForm.status = '5'
+        this.searchForm.wareHouseType = collectType
+        this.collectService.wareHouseList({
+          '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.loading = false
+        })
+      },
+      // 当前页
+      currentChangeHandle ({currentPage, pageSize}) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.list()
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.list()
+      },
+      close () {
+        this.$refs.searchForm.resetFields()
+        this.visible = false
+      }
+    }
+  }
+</script>
+<style scoped>
+  /deep/ .el-dialog__body {
+    padding-top: 0px;
+    padding-bottom: 15px;
+  }
+</style>

+ 541 - 0
src/views/modules/materialManagement/collect/UpdateCollectInfoForm.vue

@@ -0,0 +1,541 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1500px"
+      @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="collectNo">
+              <el-input placeholder="自动生成" v-model="inputForm.collectNo" :disabled="true"></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="collectDate" :rules="[{required: true, message:'请选择领用时间', trigger:'blur'}]">
+              <el-date-picker
+                v-model="inputForm.collectDate"
+                type="date"
+                value-format="yyyy-MM-dd"
+                style="width: 100%"
+                placeholder="选择日期">
+              </el-date-picker>
+            </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>
+<!--method==='view' || this.formReadOnly-->
+        <el-divider content-position="left"><i class="el-icon-document"></i>
+          领用详情
+          <el-button style="margin-left: 20px" type="primary" :disabled="true" size="mini" @click="insertEvent('detail')" plain>
+            新增
+          </el-button>
+        </el-divider>
+        <el-row  :gutter="15" >
+          <vxe-table
+            border
+            show-footer
+            show-overflow
+            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: 'row', showStatus: false, autoClear: true, icon: '-'}"
+            :edit-rules="validRules"
+          >
+            <vxe-table-column field="recipientAgent" title="领用人" :edit-render="{}" :rules="[{required: true, message:'请选择领用人', trigger:'blur'}]">
+              <template v-slot:edit="scope">
+                <el-input :disabled='true' v-model="scope.row.recipientAgent" @focus="userPullListForm(scope.$rowIndex)"></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="recipientOffice" title="领用人部门" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input :disabled='true' v-model="scope.row.recipientOffice" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="collectType" title="领用类型" :edit-render="{}" :rules="[{required: true, message:'请选择领用类型', trigger:'blur'}]">
+              <template v-slot:edit="scope">
+                <el-input :disabled='true' v-model="scope.row.collectType" @focus="typePullForm(scope.$rowIndex)"></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="goodsName" title="物品名称" :edit-render="{}" :rules="[{required: true, message:'请填写物品名称', trigger:'blur'}]">
+              <template v-slot:edit="scope">
+                <el-input :disabled='true' v-model="scope.row.goodsName" @focus="openPurchasePageForm(scope.$rowIndex, scope.row)"></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="surplusNumber" title="剩余数量" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input :disabled="true" v-model="scope.row.surplusNumber" maxlength="10"></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="collectNumber" title="领用数量" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input :disabled='true' @change="changeValue" v-model="scope.row.collectNumber" @blur="scope.row.collectNumber = twoDecimalPlaces2(scope.row.collectNumber)" 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 :disabled='true' 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 :disabled='true' v-model="scope.row.remarks" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column title="操作" width="180">
+              <template v-slot="scope">
+<!--                <el-button size="mini" :disabled='true' type="danger" v-if="method!=='view'" @click="removeEvent(scope.row,scope.$rowIndex,'detail')">删除</el-button>-->
+<!--                <el-button size="mini" :disabled='true' type="primary" v-if="method!=='view'" @click="sss(scope.$rowIndex)">上传附件</el-button>-->
+                <el-button size="mini" type="primary" :disabled="false" @click="seeFileInfo(scope.$rowIndex)">查看文件详情</el-button>
+              </template>
+            </vxe-table-column>
+          </vxe-table>
+        </el-row>
+
+      </el-form>
+      <PurchasePageForm  ref="purchasePageForm" @getProject="getContract"></PurchasePageForm>
+      <!-- 附件 -->
+      <MaterialManagementDialog ref="materialManagementDialog" @getUpload="getUpload"></MaterialManagementDialog>
+      <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+      <CwProgramPageForm ref="cwProgramPageForm" @getProgram="getProgram"></CwProgramPageForm>
+      <MaterialTypePullForm ref="materialTypePullForm" @getProgramForType="getProgramForType"></MaterialTypePullForm>
+      <UserPullForm ref="userPullForm" @getProgramForUser="getProgramForUser"></UserPullForm>
+      <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 PurchasePageForm from './PurchasePageForm'
+  import CollectService from '@/api/materialManagement/CollectService'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import MaterialManagementDialog from '../file/MaterialManagementDialog'
+  import CwProgramPageForm from '@/views/modules/cw/reimbursementApproval/info/CwProgramPageForm'
+  import MaterialTypePullForm from '../info/MaterialTypePullForm'
+  import MaterialManagementService from '@/api/materialManagement/MaterialManagementService'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import UserPullForm from '@/views/modules/finance/invoice/UserPullForm'
+  export default {
+    data () {
+      return {
+        validRules: {
+          recipientAgent: [
+            {required: true, message: '领用人不能为空'}
+          ],
+          recipientOffice: [
+            {required: true, message: '领用人部门不能为空'}
+          ],
+          collectType: [
+            {required: true, message: '领用类型不能为空'}
+          ],
+          goodsName: [
+            {required: true, message: '物品名称不能为空'}
+          ],
+          collectNumber: [
+            {required: true, message: '领用数量不能为空'}
+          ]
+        },
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          sign: '', // 管理员修改标记
+          fileInfoLost: [],
+          handledByOffice: '',
+          handledBy: '',
+          handledById: '',
+          collectNo: '', // 领用编号
+          userId: '',
+          collectDate: '',
+          remarks: '',
+          detailInfos: [],
+          // amountInfos: [],
+          files: [] // 附件信息
+        }
+      }
+    },
+    CollectService: null,
+    MaterialManagementService: null,
+    created () {
+      this.collectService = new CollectService()
+      this.materialManagementService = new MaterialManagementService()
+    },
+    props: {
+      businessId: {
+        type: String,
+        default: ''
+      },
+      formReadOnly: {
+        type: Boolean,
+        default: false
+      },
+      status: {
+        type: String,
+        default: ''
+      }
+    },
+    components: {
+      SelectTree,
+      MaterialTypePullForm,
+      CwProgramPageForm,
+      MaterialManagementDialog,
+      UpLoadComponent,
+      UserPullForm,
+      PurchasePageForm
+    },
+    computed: {
+      bus: {
+        get () {
+          return this.businessId
+        },
+        set (val) {
+          this.businessId = val
+        }
+      },
+      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
+      },
+      recipientAgentId () {
+        return JSON.parse(localStorage.getItem('user')).id
+      },
+      collectTypeId () {
+        return ''
+      }
+    },
+    methods: {
+      init (method, id) {
+        this.method = method
+        this.inputForm = {
+          sign: '', // 管理员修改标记
+          fileInfoLost: [],
+          handledByOffice: '',
+          handledBy: JSON.parse(localStorage.getItem('user')).name,
+          handledById: JSON.parse(localStorage.getItem('user')).id,
+          collectNo: '', // 领用编号
+          userId: JSON.parse(localStorage.getItem('user')).id,
+          collectDate: 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 = '查看领用类型'
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.$refs.inputForm.resetFields()
+            this.collectService.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
+              }
+              if (this.commonJS.isNotEmpty(data.collectDate)) {
+                this.inputForm.collectDate = data.collectDate
+              }
+              if (this.commonJS.isNotEmpty(data.recipientAgentId)) {
+                this.recipientAgentId = data.recipientAgentId
+              }
+              if (this.commonJS.isNotEmpty(data.collectTypeId)) {
+                this.collectTypeId = data.collectTypeId
+              }
+              let i = this.inputForm.detailInfos.length
+              for (let j = 0; j < i; j++) {
+                if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradePrice)) {
+                  if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradeNumber)) {
+                    this.inputForm.detailInfos[j].priceSum = this.inputForm.detailInfos[j].tradePrice * this.inputForm.detailInfos[j].tradeNumber
+                  }
+                }
+              }
+              this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
+              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+              this.loading = false
+            })
+          }
+        })
+      },
+      // 值改变事件
+      changeValue () {
+        let i = this.inputForm.detailInfos.length
+        for (let j = 0; j < i; j++) {
+          if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].surplusNumber)) {
+            this.$message.error('请选择领用物品名称')
+            return
+          }
+          if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].collectNumber)) {
+            if (this.inputForm.detailInfos[j].surplusNumber < this.inputForm.detailInfos[j].collectNumber) {
+              this.$message.error('领用数量不能大于剩余数量')
+              return
+            }
+          }
+        }
+      },
+      getProgramForUser (rows) {
+        this.inputForm.detailInfos[this.indexRow].recipientAgentId = rows[0].id
+        this.inputForm.detailInfos[this.indexRow].recipientAgent = rows[0].name
+        this.inputForm.detailInfos[this.indexRow].deptId = rows[0].parentId
+        this.inputForm.detailInfos[this.indexRow].recipientOffice = rows[0].officeName
+        this.indexRow = ''
+        this.$forceUpdate()
+      },
+      getProgramForType (rows) {
+        this.inputForm.detailInfos[this.indexRow].collectTypeId = rows.id
+        this.inputForm.detailInfos[this.indexRow].collectType = rows.name
+        this.indexRow = ''
+        this.$forceUpdate()
+      },
+      getProgram (rows) {
+        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()
+        })
+      },
+      twoDecimalPlaces2 (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 (['priceSum'].includes(column.property)) {
+      //         // eslint-disable-next-line no-undef
+      //         this.inputForm.tradeTotalPrice = XEUtils.sum(data, column.property)
+      //         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.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].recipientAgent)) {
+                  this.$message.error('领用详情第' + k + '行请选择领用人')
+                  this.loading = false
+                  return
+                }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].collectType)) {
+                  this.$message.error('领用详情第' + k + '行请选择领用类型')
+                  this.loading = false
+                  return
+                }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].goodsName)) {
+                  this.$message.error('领用详情第' + k + '行请选择物品名称')
+                  this.loading = false
+                  return
+                }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].collectNumber)) {
+                  this.$message.error('领用详情第' + k + '行请输入领用数量')
+                  this.loading = false
+                  return
+                }
+              }
+            }
+            this.inputForm.sign = '测试'
+            this.inputForm.files = this.$refs.uploadComponent.getDataList()
+            this.collectService.save(this.inputForm).then(({data}) => {
+              // eslint-disable-next-line no-undef
+              // callback(data.businessTable, data.businessId, this.inputForm)
+              // this.$refs.inputForm.resetFields()
+              this.$emit('refreshList')
+              this.loading = false
+              this.close()
+            }).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) => {
+            data.recipientAgent = JSON.parse(localStorage.getItem('user')).name
+            data.recipientAgentId = this.recipientAgentId
+            data.recipientOffice = this.officeName
+            this.inputForm.detailInfos.push(data)
+          })
+        }
+        if (type === 'amount') {
+          await this.$refs.amountTable.insert().then((data) => {
+            this.inputForm.amountInfos.push(data)
+          })
+        }
+      },
+      getContract (row) {
+        this.inputForm.detailInfos[this.indexRow].surplusNumber = row.tradeNumber
+        this.inputForm.detailInfos[this.indexRow].goodsName = row.tradeName
+        this.indexRow = ''
+        this.$forceUpdate()
+      },
+      openPurchasePageForm (rowIndex, row) {
+        if (this.commonJS.isEmpty(row.collectType)) {
+          this.$message.error('请选择领用类型')
+          return
+        }
+        this.indexRow = rowIndex
+        this.$refs.purchasePageForm.init(row.collectTypeId)
+      }
+    }
+  }
+</script>

+ 39 - 15
src/views/modules/materialManagement/info/UpdateInfoForm.vue

@@ -4,7 +4,7 @@
       :title="title"
       :close-on-click-modal="false"
       v-dialogDrag
-      width="1200px"
+      width="1500px"
       @close="close"
       @keyup.enter.native="doSubmit"
       :visible.sync="visible">
@@ -108,9 +108,9 @@
             :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: true, icon: '-'}"
             :edit-rules="validRules"
           >
-            <vxe-table-column field="purchaser" title="采购人" :edit-render="{}" :rules="[{required: true, message:'请选择采购人', trigger:'blur'}]">
+            <vxe-table-column field="purchaserAgent" 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>
+                <el-input v-model="scope.row.purchaserAgent" @focus="userPullListForm(scope.$rowIndex)"></el-input>
               </template>
             </vxe-table-column>
             <vxe-table-column field="procurementOffice" title="采购部门" :edit-render="{}">
@@ -155,10 +155,10 @@
                 <el-input v-model="scope.row.remarks" ></el-input>
               </template>
             </vxe-table-column>
-            <vxe-table-column title="操作" width="300">
+            <vxe-table-column title="操作" width="180">
               <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="danger" v-if="method!=='view'" @click="removeEvent(scope.row,scope.$rowIndex,'detail')">删除</el-button>
+                <el-button size="mini" type="primary" v-if="method!=='view'" @click="sss(scope.$rowIndex)">上传附件</el-button>
                 <el-button size="mini" type="primary" v-if="method==='view'" :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>
@@ -248,7 +248,7 @@
     data () {
       return {
         validRules: {
-          purchaser: [
+          purchaserAgent: [
             {required: true, message: '采购人不能为空'}
           ],
           procurementOffice: [
@@ -313,6 +313,12 @@
       },
       officeName () {
         return JSON.parse(localStorage.getItem('user')).officeDTO.name
+      },
+      purchaserAgentId () {
+        return JSON.parse(localStorage.getItem('user')).id
+      },
+      procurementTypeId () {
+        return ''
       }
     },
     methods: {
@@ -356,6 +362,12 @@
               if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
                 this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
               }
+              if (this.commonJS.isNotEmpty(data.purchaserAgentId)) {
+                this.purchaserAgentId = data.purchaserAgentId
+              }
+              if (this.commonJS.isNotEmpty(data.procurementTypeId)) {
+                this.procurementTypeId = data.procurementTypeId
+              }
               let i = this.inputForm.detailInfos.length
               for (let j = 0; j < i; j++) {
                 if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradePrice)) {
@@ -384,21 +396,20 @@
         }
       },
       getProgramForUser (rows) {
-        this.inputForm.detailInfos[this.indexRow].userId = rows[0].id
-        this.inputForm.detailInfos[this.indexRow].purchaser = rows[0].name
+        this.inputForm.detailInfos[this.indexRow].purchaserAgentId = rows[0].id
+        this.inputForm.detailInfos[this.indexRow].purchaserAgent = 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()
       },
       getProgramForType (rows) {
-        this.inputForm.detailInfos[this.indexRow].typeId = rows.id
+        this.inputForm.detailInfos[this.indexRow].procurementTypeId = rows.id
         this.inputForm.detailInfos[this.indexRow].procurementType = rows.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
@@ -530,7 +541,7 @@
               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)) {
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].purchaserAgent)) {
                   this.$message.error('采购详情第' + k + '行请选择采购人')
                   this.loading = false
                   return
@@ -540,19 +551,31 @@
                   this.loading = false
                   return
                 }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].tradeName)) {
+                  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
                 }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].tradeNumber)) {
+                  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()
+              // callback(data.businessTable, data.businessId, this.inputForm)
+              // this.$refs.inputForm.resetFields()
+              this.$emit('refreshList')
               this.loading = false
+              this.close()
             }).catch(() => {
               this.$refs.inputForm.resetFields()
               this.loading = false
@@ -582,7 +605,8 @@
       async insertEvent (type) {
         if (type === 'detail') {
           await this.$refs.detailTable.insert().then((data) => {
-            data.purchaser = this.name
+            data.purchaserAgentId = this.purchaserAgentId
+            data.purchaserAgent = this.name
             data.procurementOffice = this.officeName
             this.inputForm.detailInfos.push(data)
           })

+ 110 - 29
src/views/modules/materialManagement/purchase/PurchaseForm.vue

@@ -102,9 +102,9 @@
           :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: true, icon: '-'}"
           :edit-rules="validRules"
         >
-          <vxe-table-column field="purchaser" title="采购人" :edit-render="{}" :rules="[{required: true, message:'请选择采购人', trigger:'blur'}]">
+          <vxe-table-column field="purchaserAgent" 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>
+              <el-input v-model="scope.row.purchaserAgent" @focus="userPullListForm(scope.$rowIndex)"></el-input>
             </template>
           </vxe-table-column>
           <vxe-table-column field="procurementOffice" title="采购部门" :edit-render="{}">
@@ -245,7 +245,7 @@
     data () {
       return {
         validRules: {
-          purchaser: [
+          purchaserAgent: [
             {required: true, message: '采购人不能为空'}
           ],
           procurementOffice: [
@@ -278,6 +278,7 @@
           purchaseMode: '',
           handledByOffice: '',
           handledBy: '',
+          handledById: '',
           purchaseSketch: '',
           purchaseNo: '', // 采购编号
           userId: '',
@@ -286,7 +287,8 @@
           detailInfos: [],
           // amountInfos: [],
           files: [] // 附件信息
-        }
+        },
+        keyWatch: ''
       }
     },
     // ReimbursementApprovalService: null,
@@ -311,6 +313,10 @@
       formReadOnly: {
         type: Boolean,
         default: false
+      },
+      status: {
+        type: String,
+        default: ''
       }
     },
     components: {
@@ -325,30 +331,44 @@
       UserPullForm
     },
     computed: {
+      bus: {
+        get () {
+          return this.businessId
+        },
+        set (val) {
+          this.businessId = val
+        }
+      },
       name () {
         return JSON.parse(localStorage.getItem('user')).name
       },
       officeName () {
         return JSON.parse(localStorage.getItem('user')).officeDTO.name
       },
-      userId () {
+      purchaserAgentId () {
         return JSON.parse(localStorage.getItem('user')).id
+      },
+      procurementTypeId () {
+        return ''
       }
     },
     watch: {
-      'businessId': {
+      'keyWatch': {
         handler (newVal) {
-          if (this.businessId && this.businessId !== 'false') {
-            this.init('edit', this.businessId)
+          if (this.commonJS.isNotEmpty(this.bus)) {
+            this.init('', this.bus)
           } else {
-            this.init('clean', '')
+            this.$nextTick(() => {
+              this.$refs.inputForm.resetFields()
+            })
           }
-        },
-        immediate: true,
-        deep: false
+        }
       }
     },
     methods: {
+      getKeyWatch (keyWatch) {
+        this.keyWatch = keyWatch
+      },
       init (method, id) {
         this.method = method
         this.inputForm = {
@@ -357,6 +377,7 @@
           purchaseMode: '',
           handledByOffice: '',
           handledBy: JSON.parse(localStorage.getItem('user')).name,
+          handledById: JSON.parse(localStorage.getItem('user')).id,
           purchaseSketch: '',
           purchaseNo: '', // 采购编号
           userId: JSON.parse(localStorage.getItem('user')).id,
@@ -369,27 +390,35 @@
         if (method === 'add') {
           this.title = `新建采购类型`
         } else if (method === 'edit') {
-          this.inputForm.id = id
           this.title = '修改采购类型'
         }
+        this.inputForm.id = id
         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}) => {
+          if (this.status === 'audit' || this.status === 'taskFormDetail') {
+            method = 'view'
+          }
+          this.loading = true
+          this.$refs.inputForm.resetFields()
+          this.materialManagementService.findById(this.inputForm.id).then(({data}) => {
+            if (this.inputForm.id !== 'false') {
               this.inputForm = this.recover(this.inputForm, data)
               if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
                 this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
               }
+              if (this.commonJS.isNotEmpty(data.purchaserAgentId)) {
+                this.purchaserAgentId = data.purchaserAgentId
+              }
+              if (this.commonJS.isNotEmpty(data.procurementTypeId)) {
+                this.procurementTypeId = data.procurementTypeId
+              }
               let i = this.inputForm.detailInfos.length
               for (let j = 0; j < i; j++) {
                 if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradePrice)) {
@@ -401,11 +430,56 @@
               this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
               this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
               this.loading = false
-            })
-          }
+            } else {
+              if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
+                this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
+              }
+              if (this.commonJS.isEmpty(this.inputForm.handledBy)) {
+                this.inputForm.handledBy = JSON.parse(localStorage.getItem('user')).name
+              }
+              if (this.commonJS.isEmpty(this.inputForm.handledById)) {
+                this.inputForm.handledById = JSON.parse(localStorage.getItem('user')).id
+              }
+              if (this.commonJS.isEmpty(this.inputForm.purchaseDate)) {
+                this.inputForm.purchaseDate = new Date()
+              }
+              this.inputForm.detailInfos = []
+              this.loading = false
+            }
+          })
           if (method !== 'edit' && method !== 'view') {
             this.$refs.uploadComponent.newUpload(method, [], 'reimbursement')
           }
+          // 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
+          //     }
+          //     if (this.commonJS.isNotEmpty(data.purchaserAgentId)) {
+          //       this.purchaserAgentId = data.purchaserAgentId
+          //     }
+          //     if (this.commonJS.isNotEmpty(data.procurementTypeId)) {
+          //       this.procurementTypeId = data.procurementTypeId
+          //     }
+          //     let i = this.inputForm.detailInfos.length
+          //     for (let j = 0; j < i; j++) {
+          //       if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradePrice)) {
+          //         if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradeNumber)) {
+          //           this.inputForm.detailInfos[j].priceSum = this.inputForm.detailInfos[j].tradePrice * this.inputForm.detailInfos[j].tradeNumber
+          //         }
+          //       }
+          //     }
+          //     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) {
@@ -483,7 +557,8 @@
       async insertEvent (type) {
         if (type === 'detail') {
           await this.$refs.detailTable.insert().then((data) => {
-            data.purchaser = this.name
+            data.purchaserAgentId = this.purchaserAgentId
+            data.purchaserAgent = this.name
             data.procurementOffice = this.officeName
             this.inputForm.detailInfos.push(data)
           })
@@ -505,7 +580,6 @@
           this.inputForm.files = []
         }
         this.inputForm.files = this.$refs.uploadComponent.getDataList()
-        console.log('this.inputForm', this.inputForm)
         this.inputForm.status = '1'
         this.materialManagementService.save(this.inputForm).then(({data}) => {
           callback()
@@ -544,7 +618,7 @@
               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)) {
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].purchaserAgent)) {
                   this.$message.error('采购详情第' + k + '行请选择采购人')
                   this.loading = false
                   return
@@ -554,11 +628,21 @@
                   this.loading = false
                   return
                 }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].tradeName)) {
+                  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
                 }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].tradeNumber)) {
+                  this.$message.error('采购详情第' + k + '行请输入商品数量')
+                  this.loading = false
+                  return
+                }
               }
             }
             this.inputForm.files = this.$refs.uploadComponent.getDataList()
@@ -717,7 +801,6 @@
         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
@@ -732,7 +815,7 @@
         this.$refs.materialTypePullForm.init()
       },
       getProgramForType (rows) {
-        this.inputForm.detailInfos[this.indexRow].typeId = rows.id
+        this.inputForm.detailInfos[this.indexRow].procurementTypeId = rows.id
         this.inputForm.detailInfos[this.indexRow].procurementType = rows.name
         this.indexRow = ''
         this.$forceUpdate()
@@ -743,9 +826,8 @@
         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].purchaserAgentId = rows[0].id
+        this.inputForm.detailInfos[this.indexRow].purchaserAgent = rows[0].name
         this.inputForm.detailInfos[this.indexRow].deptId = rows[0].parentId
         this.inputForm.detailInfos[this.indexRow].procurementOffice = rows[0].officeName
         this.indexRow = ''
@@ -756,7 +838,6 @@
       },
       // 值改变事件
       changeValue () {
-        console.log('进来了')
         let i = this.inputForm.detailInfos.length
         for (let j = 0; j < i; j++) {
           if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradePrice)) {

+ 2 - 3
src/views/modules/materialManagement/purchase/PurchaseList.vue

@@ -126,7 +126,7 @@
           </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="handledByName"></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" >
@@ -158,7 +158,7 @@
           :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
           @page-change="currentChangeHandle">
         </vxe-pager>
-        <UpdateInfoForm ref="updateInfoForm" @refreshDataList="refreshList"></UpdateInfoForm>
+        <UpdateInfoForm ref="updateInfoForm" @refreshList="refreshList"></UpdateInfoForm>
       </div>
     </div>
   </div>
@@ -352,7 +352,6 @@
       },
       // 发起采购申请
       push (row) {
-        console.log('row', row)
         // 读取流程表单
         let title = `发起流程【采购申请】`
         let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[采购申请]`

+ 43 - 6
src/views/modules/materialManagement/wareHouse/WareHouseAddForm.vue

@@ -102,9 +102,9 @@
             highlight-current-row
             :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: true, icon: '-'}"
           >
-            <vxe-table-column field="purchaser" title="采购人" :edit-render="{}" :rules="[{required: true, message:'请选择采购人', trigger:'blur'}]">
+            <vxe-table-column field="purchaserAgent" title="采购人" :edit-render="{}" :rules="[{required: true, message:'请选择采购人', trigger:'blur'}]">
               <template v-slot:edit="scope">
-                <el-input :disabled='true' v-model="scope.row.purchaser"></el-input>
+                <el-input :disabled='true' v-model="scope.row.purchaserAgent"></el-input>
 <!--                <el-input v-model="scope.row.purchaser" @focus="userPullListForm(scope.$rowIndex)"></el-input>-->
               </template>
             </vxe-table-column>
@@ -182,8 +182,9 @@
             @edit-closed=""
             highlight-current-row
             :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: true, icon: '-'}"
+            :edit-rules="validRules"
           >
-            <vxe-table-column field="wareHouseMan" title="入库人" :edit-render="{}" :rules="[{required: true, message:'请选择采购人', trigger:'blur'}]">
+            <vxe-table-column field="wareHouseMan" title="入库人" :edit-render="{}" :rules="[{required: true, message:'请选择入库人', trigger:'blur'}]">
               <template v-slot:edit="scope">
                 <el-input v-model="scope.row.wareHouseMan" @focus="userPullListForm(scope.$rowIndex)"></el-input>
               </template>
@@ -269,6 +270,26 @@
   export default {
     data () {
       return {
+        validRules: {
+          wareHouseMan: [
+            {required: true, message: '采购人不能为空'}
+          ],
+          wareHouseManOffice: [
+            {required: true, message: '入库部门不能为空'}
+          ],
+          wareHouseType: [
+            {required: true, message: '入库类型不能为空'}
+          ],
+          tradeName: [
+            {required: true, message: '商品名称不能为空'}
+          ],
+          tradeNumber: [
+            {required: true, message: '商品数量不能为空'}
+          ],
+          tradePrice: [
+            {required: true, message: '商品单价不能为空'}
+          ]
+        },
         title: '',
         method: '',
         visible: false,
@@ -312,6 +333,12 @@
       name () {
         return JSON.parse(localStorage.getItem('user')).name
       },
+      wareHouseManId () {
+        return JSON.parse(localStorage.getItem('user')).id
+      },
+      wareHouseTypeId () {
+        return ''
+      },
       officeName () {
         return JSON.parse(localStorage.getItem('user')).officeDTO.name
       }
@@ -353,6 +380,12 @@
             this.loading = true
             this.$refs.inputForm.resetFields()
             this.wareHouseService.findById(this.inputForm.id).then(({data}) => {
+              if (this.commonJS.isNotEmpty(data.wareHouseManId)) {
+                this.wareHouseManId = data.wareHouseManId
+              }
+              if (this.commonJS.isNotEmpty(data.wareHouseTypeId)) {
+                this.wareHouseTypeId = data.wareHouseTypeId
+              }
               this.inputForm = this.recover(this.inputForm, data)
               if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
                 this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
@@ -377,6 +410,8 @@
               this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
               this.loading = false
             })
+          } else {
+            this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
           }
         })
       },
@@ -427,7 +462,7 @@
         // 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.inputForm.wareHouse[this.indexRow].userId = rows[0].id
+        this.inputForm.wareHouse[this.indexRow].wareHouseManId = rows[0].id
         this.inputForm.wareHouse[this.indexRow].wareHouseMan = rows[0].name
         this.inputForm.wareHouse[this.indexRow].deptId = rows[0].parentId
         this.inputForm.wareHouse[this.indexRow].wareHouseManOffice = rows[0].officeName
@@ -435,7 +470,7 @@
         this.$forceUpdate()
       },
       getProgramForType (rows) {
-        this.inputForm.wareHouse[this.indexRow].typeId = rows.id
+        this.inputForm.wareHouse[this.indexRow].wareHouseTypeId = rows.id
         this.inputForm.wareHouse[this.indexRow].wareHouseType = rows.name
         // this.inputForm.detailInfos[this.indexRow].procurementType = rows.name
         this.indexRow = ''
@@ -633,11 +668,12 @@
         })
       },
       close () {
-        this.$refs.inputForm.resetFields()
+        this.method = ''
         this.inputForm.detailInfos = []
         this.inputForm.wareHouse = []
         this.inputForm.amountInfos = []
         this.$refs.uploadComponent.clearUpload()
+        this.$refs.inputForm.resetFields()
         this.visible = false
       },
       // 删除
@@ -656,6 +692,7 @@
       async insertEvent (type) {
         if (type === 'detail') {
           await this.$refs.detailTable.insert().then((data) => {
+            data.wareHouseManId = this.wareHouseManId
             data.wareHouseMan = this.name
             data.wareHouseManOffice = this.officeName
             // this.inputForm.detailInfos.push(data)

+ 1 - 1
src/views/modules/sys/workContract/WorkContractFileForm.vue

@@ -121,7 +121,7 @@
         <el-col :span="24">
           <el-form-item label="收费标准" prop="contractFees">
             <el-checkbox-group v-model="inputForm.contractFees">
-              <el-checkbox @change="changeContractFee" v-for="item in $dictUtils.getDictList('contract_fee')" :label="item.value">
+              <el-checkbox @change="changeContractFee" v-for="item in $dictUtils.getDictList('contract_fee_pg')" :label="item.value">
                 {{item.label}}
               </el-checkbox>
             </el-checkbox-group>

+ 1 - 1
src/views/modules/sys/workContract/WorkContractForm.vue

@@ -121,7 +121,7 @@
         <el-col :span="24">
           <el-form-item label="收费标准" prop="contractFees">
             <el-checkbox-group v-model="inputForm.contractFees">
-              <el-checkbox @change="changeContractFee" v-for="item in $dictUtils.getDictList('contract_fee')" :label="item.value">
+              <el-checkbox @change="changeContractFee" v-for="item in $dictUtils.getDictList('contract_fee_pg')" :label="item.value">
                 {{item.label}}
               </el-checkbox>
             </el-checkbox-group>

+ 1 - 1
src/views/modules/sys/workContract/WorkContractForm2.vue

@@ -125,7 +125,7 @@
             <el-col :span="24">
               <el-form-item label="收费标准" prop="contractFees">
                 <el-checkbox-group v-model="inputForm.contractFees" @change="changeContractFee">
-                  <el-checkbox  v-for="item in $dictUtils.getDictList('contract_fee')" :label="item.value" >{{item.label}}</el-checkbox>
+                  <el-checkbox  v-for="item in $dictUtils.getDictList('contract_fee_pg')" :label="item.value" >{{item.label}}</el-checkbox>
                 </el-checkbox-group>
               </el-form-item>
             </el-col>