소스 검색

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/api/sys/OSSService.js
lizhenhao 2 년 전
부모
커밋
4a486950a7

+ 1 - 1
.env.production

@@ -2,7 +2,7 @@
 ENV = 'production'
 
 #Jeeplus快速开发平台/后台地址
-VUE_APP_SERVER_URL = 'http://pg.xgccpm.com:8081/jeeplus-vue'
+VUE_APP_SERVER_URL = 'http://pg.xgccpm.com/jeeplus-vue'
 #单点登录设置
 VUE_APP_SSO_LOGIN  = 'false'
 VUE_APP_CAS_SERVER = 'https://www.cainiao.com:8443/cas'

BIN
public/static/img/login.png


BIN
public/static/img/login1.png


+ 1 - 0
src/api/auth/LoginService.js

@@ -8,6 +8,7 @@ export default class LoginService {
     })
   }
   login (data) {
+    console.log(data)
     return request({
       url: '/sys/login',
       method: 'post',

+ 8 - 0
src/api/sys/OfficeService.js

@@ -32,4 +32,12 @@ export default class OfficeService {
       params: params
     })
   }
+
+  treeData2 (params) {
+    return request({
+      url: '/sys/office/treeData2',
+      method: 'get',
+      params: params
+    })
+  }
 }

+ 10 - 2
src/api/sys/ProjectService.js

@@ -51,11 +51,19 @@ export default class PostService {
       responseType: 'blob'
     })
   }
-  proportion (itemType) {
+  proportion (params) {
     return request({
       url: '/sys/project/proportion',
       method: 'get',
-      params: {itemType: itemType}
+      params: params
+    })
+  }
+  fileUploadList (params) {
+    return request({
+      url: '/sys/project/exportFileUploadList',
+      method: 'get',
+      params: params,
+      responseType: 'blob'
     })
   }
 }

+ 35 - 0
src/api/sys/SerialnumTplService.js

@@ -0,0 +1,35 @@
+import request from '@/utils/httpRequest'
+
+export default class SerialnumTplService {
+  list (param) {
+    return request({
+      url: `/sys/template/list`,
+      method: 'get',
+      params: param
+    })
+  }
+
+  remove (url) {
+    return request({
+      url: '/sys/template/remove',
+      method: 'get',
+      params: {id: url}
+    })
+  }
+
+  findById (id) {
+    return request({
+      url: '/sys/template/findById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+
+  save (param) {
+    return request({
+      url: '/sys/template/save',
+      method: 'post',
+      data: param
+    })
+  }
+}

+ 7 - 0
src/api/sys/WorkClientService.js

@@ -57,4 +57,11 @@ export default class WorkClientService {
       params: {id: name}
     })
   }
+  isExist (param) {
+    return request({
+      url: '/workClientInfo/workClientInfo/isExist',
+      method: 'get',
+      params: {param: param}
+    })
+  }
 }

+ 2 - 2
src/views/modules/sys/login/login.vue

@@ -161,7 +161,7 @@
               if (checked) {
                 // eslint-disable-next-line no-undef
                 // let password = Base64.encode(passwordLogin) // base64加密
-                this.setCookie(username, Base64.encode(password), 7)
+                this.setCookie(Base64.encode(username), Base64.encode(password), 7)
               } else {
                 this.setCookie('', '', -1) // 修改2值都为空,天数为负1天就好了
               }
@@ -219,7 +219,7 @@
           for (let i = 0; i < arr.length; i++) {
             let arr2 = arr[i].split('=') // 再次切割,arr2[0]为key值,arr2[1]为对应的value
             if (arr2[0] === 'username') {
-              this.inputForm.username = arr2[1]
+              this.inputForm.username = Base64.decode(arr2[1])// base64解密
             } else if (arr2[0] === 'password') {
               // eslint-disable-next-line no-undef
               this.inputForm.password = Base64.decode(arr2[1])// base64解密

+ 397 - 0
src/views/modules/sys/mould/SerialnumTplForm.vue

@@ -0,0 +1,397 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1200px"
+      @close="close()"
+      @keyup.enter.native="doSubmit"
+      :visible.sync="visible">
+      <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
+               label-width="150px">
+        <el-row  :gutter="0">
+          <el-col :span="12">
+            <el-form-item label="模板名称" prop="tplName" :rules="[
+                  {required: true, message:'请输入模板名称', trigger:'blur'}
+                ]">
+              <el-input v-model="inputForm.tplName" placeholder="请输入模板名称"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item label="公司" prop="companyId"
+                          :rules="[
+                   {required: true, message:'请选择公司', trigger:'blur'}
+                 ]">
+              <SelectTree
+                ref="officeTree"
+                :props="{
+                    value: 'id',             // ID字段名
+                    label: 'name',         // 显示名称
+                    children: 'children'    // 子级字段名
+                  }"
+                :url="`/sys/office/treeData2?type=1`"
+                :value="inputForm.companyId"
+                :clearable="true"
+                :accordion="true"
+                @getValue="(value) => {inputForm.companyId=value}"/>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item label="业务标识" prop="bizCode"
+                          :rules="[
+                      {required: true, message:'请选择业务标识', trigger:'blur'}
+                   ]">
+              <el-select v-model="inputForm.bizCode" placeholder="请选择业务标识" style="width:100%;">
+                <el-option
+                  v-for="item in $dictUtils.getDictList('serial_biztype')"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item label="起始序列号" prop="serialNum">
+              <el-input v-model="inputForm.serialNum" placeholder="请输入起始序列号"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item label="序列号长度" prop="serialNumLen"
+                          :rules="[
+                   {required: true, message:'请输入序列号长度', trigger:'blur'}
+                 ]">
+              <el-input v-model="inputForm.serialNumLen" placeholder="请输入序列号长度"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item label="编号模板" prop="serialTpl"
+                :rules="[
+                  {required: true, message:'请输入编号模板', trigger:'blur'}
+                ]">
+              <el-input v-model="inputForm.serialTpl" :disabled="true" placeholder="请输入编号模板"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item label="编号示例" prop="serialTplEx"
+                          :rules="[
+                  {required: true, message:'请输入编号示例', trigger:'blur'}
+                ]">
+              <el-input v-model="inputForm.serialTplEx" :disabled="true" placeholder="请输入编号示例"></el-input>
+            </el-form-item>
+          </el-col>
+
+        </el-row>
+
+        <el-row></el-row>
+          <el-form-item style="margin-top: 20px" label="生成编号模板" prop="mouldList">
+            <vxe-toolbar >
+              <template #buttons>
+                <vxe-button status="primary" size="mini" @click="insertEvent">新增</vxe-button>
+              </template>
+            </vxe-toolbar>
+          </el-form-item>
+
+        <vxe-table
+          border
+          show-overflow
+          ref="xTable"
+          class="vxe-table-element"
+          :data="mouldList"
+          :disabled="method==='view'"
+          style="margin-left: 5em"
+          @cell-click="dbclickFun"
+          @edit-closed=""
+          highlight-current-row
+          :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
+        >
+
+          <vxe-table-column field="type" title="变量名称" :edit-render="{name: '$select', options: $dictUtils.getDictList('variable_type')}">
+            <template v-slot:edit="scope" >
+              <vxe-select v-model="scope.row.type" @input="variableValue(scope.row, scope.row.type)" transfer>
+                <vxe-option
+                  v-for="item in $dictUtils.getDictList('variable_type')"
+                  :key="item.value"
+                  :value="item.value"
+                  :label="item.label">
+                </vxe-option>
+              </vxe-select>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="value" title="变量值" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input :disabled="scope.row.showType" v-model="scope.row.value" ></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column title="操作" width="100">
+            <template v-slot="scope">
+              <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex)">删除</el-button>
+            </template>
+          </vxe-table-column>
+        </vxe-table>
+
+      </el-form>
+
+        <span slot="footer" class="dialog-footer">
+          <el-button size="small" type="primary" v-if="method != 'view'" @click="generateTemplate()" icon="el-icon-edit-outline">生成模板</el-button>
+          <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 SerialnumTplService from '@/api/sys/SerialnumTplService'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  export default {
+    data () {
+      return {
+        visable: false,
+        gridData: [],
+        radio: 0,
+        tableData: [],
+        dataList: [],
+        dataListNew: [],
+        title: '',
+        method: '',
+        isSubmit: false,
+        visible: false,
+        loading: false,
+        returnForm: {
+          id: '',
+          tplName: '',
+          companyId: '',
+          bizCode: '',
+          serialNum: '',
+          serialNumLen: '',
+          serialTpl: '',
+          serialTplEx: ''
+        },
+        inputForm: {
+          id: '',
+          tplName: '',
+          companyId: '',
+          bizCode: '',
+          serialNum: '',
+          serialNumLen: '',
+          serialTpl: '',
+          serialTplEx: ''
+        },
+        mouldList: [],
+        mould: {
+          type: '',
+          value: '',
+          showType: false
+        }
+      }
+    },
+    components: {
+      SelectTree
+    },
+    serialnumTplService: null,
+    created () {
+      this.serialnumTplService = new SerialnumTplService()
+    },
+    methods: {
+      init (method, id) {
+        this.method = method
+        this.inputForm = {
+          id: '',
+          tplName: '',
+          companyId: '',
+          bizCode: '',
+          serialNum: '',
+          serialNumLen: '',
+          serialTpl: '',
+          serialTplEx: '',
+          mouldList: [],
+          mould: {
+            type: '',
+            value: ''
+          }
+        }
+        this.inputForm.id = id
+        if (method === 'add') {
+          this.title = `新建基本信息`
+        } else if (method === 'edit') {
+          this.title = '修改基本信息'
+        } else if (method === 'view') {
+          this.showVi = false
+          this.title = '查看基本信息'
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          this.$refs.inputForm.resetFields()
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.serialnumTplService.findById(this.inputForm.id).then(({data}) => {
+              this.inputForm = data
+            })
+          }
+          this.loading = false
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        this.serialnumTplService.save(this.inputForm).then(({data}) => {
+          this.close()
+          this.$message.success(data)
+          this.$emit('refreshDataList')
+          this.loading = false
+        }).catch(() => {
+          this.loading = false
+        })
+      },
+      close () {
+        this.$refs.inputForm.resetFields()
+        this.visible = false
+        this.showVi = true
+        this.mouldList = []
+      },
+      // 排序
+      sortChangeHandle (column) {
+        this.orders = []
+        if (column.order != null) {
+          this.orders.push({column: this.$utils.toLine(column.prop), asc: column.order === 'ascending'})
+        }
+        this.refreshList()
+      },
+      deleteMsgById (row, index) {
+        this.dataListNew.splice(index, 1)
+        if (row.id !== null && row.id !== '' && row.id !== undefined) {
+          this.ossService.deleteMsgById(row.id)
+        }
+      },
+      tableRowClassName ({row, rowIndex}) {
+        row.index = rowIndex
+      },
+      handleRadioChange (val) {
+        if (val) {
+          this.radio = val.index
+        }
+      },
+      // 点击修改
+      dbclickFun (cell) {
+        this.onedit = false
+      },
+      // 新增
+      async insertEvent () {
+        if (this.inputForm.companyId === undefined || this.inputForm.companyId === '' || this.inputForm.companyId === null) {
+          this.$message.error('请选择公司信息')
+        } else if (this.inputForm.serialNumLen === undefined || this.inputForm.serialNumLen === '' || this.inputForm.serialNumLen === null) {
+          this.$message.error('请输入序列号长度')
+        } else {
+          await this.$refs.xTable.insert().then((data) => {
+            this.mouldList.push(data)
+          })
+        }
+      },
+      // 删除
+      removeEvent (row, rowIndex) {
+        this.$refs.xTable.remove(row)
+        this.mouldList.splice(rowIndex, 1)
+      },
+      // 变量值处理
+      variableValue (row, type) {
+        if (type === '1' || type === '2') {
+          row.showType = true
+        }
+        if (type === '7') {
+          row.value = new Date().getFullYear()
+          row.showType = true
+        }
+        if (type === '8') {
+          let len = this.inputForm.serialNumLen
+          let s = '0000000000000000'
+          s = s.substring(0, len - 1)
+          row.value = s + '1'
+          row.showType = true
+        }
+        if (type === '9') {
+          row.value = new Date().getMonth() + 1
+          row.showType = true
+        }
+      },
+      // 生成模板
+      generateTemplate () {
+        let list = this.mouldList
+        let i = ''
+        let j = ''
+        list.forEach(obj => {
+          // 公司简称
+          if (obj.type === '1') {
+            i = i + '{spnm}'
+          }
+          // 分公司简称
+          if (obj.type === '2') {
+            i = i + '{brspnm}'
+          }
+          // 固定字符、业务类型、业务类型代码、业务类型的字
+          if (obj.type === '3' || obj.type === '4' || obj.type === '5' || obj.type === '6') {
+            i = i + obj.value
+            j = j + obj.value
+          }
+          // 年度
+          if (obj.type === '7') {
+            i = i + '{year}'
+            j = j + obj.value
+          }
+          // 流水号
+          if (obj.type === '8') {
+            i = i + '{serialNum}'
+            j = j + obj.value
+          }
+          // 月度
+          if (obj.type === '9') {
+            i = i + '{month}'
+            j = j + obj.value
+          }
+        })
+        this.inputForm.serialTpl = i
+        this.inputForm.serialTplEx = j
+      }
+    }
+  }
+</script>
+
+<style>
+  .tid_40 .vxe-body--column .vxe-cell{
+    padding: 1px;
+    text-align: center;
+  }
+  .tid_40 .vxe-header--row .col--last{
+    text-align: center;
+  }
+  .tid_45 .vxe-body--column .vxe-cell{
+    padding: 1px;
+    text-align: center;
+  }
+  .tid_45 .vxe-header--row .col--last{
+    text-align: center;
+  }
+  .vxe-select--panel {
+    z-index: 9997 !important
+  }
+  .vxe-input--panel.type--date, .vxe-input--panel.type--month, .vxe-input--panel.type--week, .vxe-input--panel.type--year {
+    z-index: 9998 !important
+  }
+</style>
+
+<style scoped>
+  .avatar{
+    height: 100px;
+  }
+  .el-divider__text {
+    font-weight: bold;
+    font-size: 16px;
+  }
+</style>

+ 180 - 0
src/views/modules/sys/mould/SerialnumTplList.vue

@@ -0,0 +1,180 @@
+<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="tplName">
+                <el-input size="small" v-model="searchForm.tplName" placeholder="请输入模板名称" clearable></el-input>
+         </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">
+        <vxe-toolbar :refresh="{query: refreshList}" import export print custom>
+          <template #buttons>
+            <el-button v-if="hasPermission('sys:serialnumTpl:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button>
+          </template>
+        </vxe-toolbar>
+        <div style="height: calc(100% - 80px);">
+            <vxe-table
+                border="inner"
+                auto-resize
+                resizable
+                height="auto"
+                :loading="loading"
+                size="small"
+                ref="serialnumTplTable"
+                show-header-overflow
+                show-overflow
+                highlight-hover-row
+                :menu-config="{}"
+                :print-config="{}"
+                @sort-change="sortChangeHandle"
+                :sort-config="{remote:true}"
+                :data="dataList"
+                :checkbox-config="{}">
+                <vxe-column type="seq" width="40"></vxe-column>
+                <vxe-column type="checkbox"  width="40px"></vxe-column>
+                <vxe-column width="300px"  title="模板名称" field="tplName">
+                    <template slot-scope="scope">
+                        <el-link  type="primary" :underline="false" @click="view(scope.row.id)">{{scope.row.tplName}}</el-link>
+                    </template>
+                </vxe-column>
+                <vxe-column width="200px"  title="公司名称" field="companyName" ></vxe-column>
+                <vxe-column width="100px"  title="业务标识" field="bizCode" >
+                  <template slot-scope="scope">
+                    {{ $dictUtils.getDictLabel("serial_biztype", scope.row.bizCode, '-') }}
+                  </template>
+                </vxe-column>
+                <vxe-column width="100px"  title="序列号长度" field="serialNumLen" ></vxe-column>
+                <vxe-column width="200px" title="编号模板示例" field="serialTplEx" > </vxe-column>
+
+                <vxe-column title="操作" width="200px" fixed="right" align="center">
+                    <template  slot-scope="scope">
+                      <el-button v-if="hasPermission('sys:serialnumTpl:view')" type="text" icon="el-icon-view" size="small" @click="view(scope.row.id)">查看</el-button>
+                      <el-button v-if="hasPermission('sys:serialnumTpl:edit') " type="text" icon="el-icon-edit" size="small" @click="edit(scope.row.id)">修改</el-button>
+                      <el-button v-if="hasPermission('sys:serialnumTpl:del') " type="text"  icon="el-icon-delete" 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>
+        </div>
+     </div>
+        <!-- 弹窗, 新增 / 修改 -->
+    <SerialnumTplForm  ref="serialnumTplForm" @refreshDataList="refreshList"></SerialnumTplForm>
+  </div>
+</template>
+
+<script>
+  import SerialnumTplForm from './SerialnumTplForm'
+  import SerialnumTplService from '@/api/sys/SerialnumTplService'
+  export default {
+    data () {
+      return {
+        visible: false,
+        searchForm: {
+          tplName: ''
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        loading: false
+      }
+    },
+    serialnumTplService: null,
+    created () {
+      this.serialnumTplService = new SerialnumTplService()
+    },
+    components: {
+      SerialnumTplForm
+    },
+    activated () {
+      this.refreshList()
+    },
+
+    methods: {
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.serialnumTplService.list({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          'itemType': '1',
+          ...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.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()
+      },
+      // 新增
+      add () {
+        this.$refs.serialnumTplForm.init('add', '')
+      },
+      // 修改
+      edit (id) {
+        id = id || this.$refs.serialnumTplTable.getCheckboxRecords().map(item => {
+          return item.id
+        })[0]
+        this.$refs.serialnumTplForm.init('edit', id)
+      },
+      // 查看
+      view (id) {
+        this.$refs.serialnumTplForm.init('view', id)
+      },
+      // 删除
+      del (id) {
+        let ids = id || this.$refs.serialnumTplTable.getCheckboxRecords().map(item => {
+          return item.id
+        }).join(',')
+        this.$confirm(`确定删除所选项吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.loading = true
+          this.serialnumTplService.remove(ids).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+            this.loading = false
+          })
+        })
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.refreshList()
+      }
+    }
+  }
+</script>

+ 22 - 74
src/views/modules/sys/project/AssessForm.vue

@@ -32,6 +32,14 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
+            <el-form-item label="年份" prop="year"
+                          :rules="[
+                  {required: true, message:'年份不能为空', trigger:'blur'}
+                 ]">
+              <el-input v-model="inputForm.year" placeholder="请填写年份"     ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
             <el-form-item label="评估目的" prop="evaluationObjective"
                           :rules="[
                  ]">
@@ -407,6 +415,8 @@
   import SelectUserTree from '@/views/modules/utils/treeUserSelect'
   import OSSSerive, {
     httpRequest,
+    openWindowOnUrl,
+    toHref,
     handleRemove,
     fileName
   } from '@/api/sys/OSSService'
@@ -425,6 +435,7 @@
           permissionFlag: '', // 判断是否为当前登录人参数
           customerName: '',
           projectName: '',
+          year: '',
           evaluationObjective: '',
           projectType: '',
           evaluationBaseDate: '',
@@ -487,6 +498,9 @@
       this.ossService = new OSSSerive()
       this.projectService = new ProjectService()
     },
+    mounted () {
+      window.onPreview = this.onPreview
+    },
     methods: {
       uploadVideoProcess (event, file, fileList) {
         this.progressFlag = true // 显示进度条
@@ -514,38 +528,7 @@
       //   }
       // },
       async toHref (row) {
-        const link = document.createElement('a')
-        if (row.id === null || row.id === undefined || row.id === '') {
-          await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
-            const url = data.data // 完整的url则直接使用
-            // 这里是将url转成blob地址,
-            fetch(url).then(res => res.blob()).then(blob => { // 将链接地址字符内容转变成blob地址
-              link.href = URL.createObjectURL(blob)
-              console.log(link.href)
-              link.download = row.name || '' // 下载文件的名字
-              // a.download = url.split('/')[url.split('/').length -1] //  // 下载文件的名字
-              document.body.appendChild(link)
-              link.click()
-              // 在资源下载完成后 清除 占用的缓存资源
-              window.URL.revokeObjectURL(link.href)
-              document.body.removeChild(link)
-            })
-          })
-        } else {
-          const url = row.temporaryUrl // 完整的url则直接使用
-          // 这里是将url转成blob地址,
-          fetch(url).then(res => res.blob()).then(blob => { // 将链接地址字符内容转变成blob地址
-            link.href = URL.createObjectURL(blob)
-            console.log(link.href)
-            link.download = row.name || '' // 下载文件的名字
-            // a.download = url.split('/')[url.split('/').length -1] //  // 下载文件的名字
-            document.body.appendChild(link)
-            link.click()
-            // 在资源下载完成后 清除 占用的缓存资源
-            window.URL.revokeObjectURL(link.href)
-            document.body.removeChild(link)
-          })
-        }
+        toHref(row)
       },
       onPreview (url) {
         this.url = url
@@ -573,6 +556,7 @@
         this.inputForm = {
           customerName: '',
           projectName: '',
+          year: '',
           evaluationObjective: '',
           projectType: '',
           evaluationBaseDate: '',
@@ -647,12 +631,12 @@
       doSubmit () {
         if (this.progressFlag === true) {
           this.$message.warning('文件正在上传中,请稍等')
+          return
         }
         this.$refs['inputForm'].validate((valid) => {
           if (valid) {
             this.loading = true
             this.inputForm.itemType = '1'
-            console.log(this.dataListNew)
             this.inputForm.workAttachments = []
             this.dataListNew.forEach((item) => {
               if (item.id === null || item.id === undefined || item.id === '') {
@@ -679,10 +663,11 @@
           }
         })
       },
-      async close () {
+      close () {
         this.$refs.inputForm.resetFields()
         this.showVi = true
         this.visible = false
+        this.$emit('refreshDataList')
       },
       async httpRequest (file) {
         await httpRequest(file, fileName(file), 'projectRecords')
@@ -691,8 +676,6 @@
         this.fileList = handleRemove()
       },
       changes (file, fileList) {
-        console.log('file', file)
-        console.log('22', fileList)
         this.dataListNew = []
         this.dataList.forEach((item) => {
           this.dataListNew.push(item)
@@ -702,11 +685,9 @@
           item.createBy = this.$store.state.user.name
           this.dataListNew.push(item)
         })
-        console.log('11', this.dataList)
-        console.log('33', this.dataListNew)
-        const isLt2M = file.size / 1024 / 1024 < 300
+        const isLt2M = file.size / 1024 / 1024 < 1024
         if (isLt2M === false) {
-          this.$message.error('文件大小不能超过 ' + 300 + 'M !')
+          this.$message.error('文件大小不能超过 ' + 1 + 'G !')
           this.fileList = []
           this.filesArra2 = []
         } else {
@@ -717,39 +698,7 @@
         }
       },
       async showFile (row) {
-        console.log('row', row)
-        let suffix = row.name.substring(row.name.lastIndexOf('.') + 1)
-        if (suffix === 'jpg' || suffix === 'png' || suffix === 'gif' || suffix === 'bmp' || suffix === 'jpeg') {
-          if (row.url !== null && row.url !== undefined && row.url !== '') {
-            this.onPreview(row.url)
-            return
-          } else {
-            await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
-              this.onPreview(data.data)
-            })
-            return
-          }
-        }
-        if (row.url !== null && row.url !== undefined && row.url !== '') {
-          if (suffix === 'pdf') {
-            window.open('https://view.xdocin.com/xdoc?_xdoc=' + row.url, '_blank')
-          } else if (suffix === 'rar' || suffix === 'zip' || suffix === 'jar' || suffix === '7z') {
-            window.open('http://ow365.cn/?i=25008&furl=' + row.url, '_blank')
-          } else {
-            window.open('https://view.officeapps.live.com/op/view.aspx?src=' + row.url, '_blank')
-          }
-        } else if (row.raw.url !== null && row.raw.url !== undefined && row.raw.url !== '') {
-          await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
-            this.rowurl = data.data
-          })
-          if (suffix === 'pdf') {
-            window.open('https://view.xdocin.com/xdoc?_xdoc=' + this.rowurl, '_blank')
-          } else if (suffix === 'rar' || suffix === 'zip' || suffix === 'jar' || suffix === '7z') {
-            window.open('http://ow365.cn/?i=25008&furl=' + this.rowurl, '_blank')
-          } else {
-            window.open('https://view.officeapps.live.com/op/view.aspx?src=' + this.rowurl, '_blank')
-          }
-        }
+        await openWindowOnUrl(row)
       },
       // 排序
       sortChangeHandle (column) {
@@ -760,7 +709,6 @@
         this.refreshList()
       },
       deleteMsgById (row, index) {
-        console.log(index)
         this.dataListNew.splice(index, 1)
         if (row.id !== null && row.id !== '' && row.id !== undefined) {
           this.ossService.deleteMsgById(row.id)

+ 33 - 2
src/views/modules/sys/project/AssessList.vue

@@ -5,6 +5,14 @@
          <el-form-item prop="projectName">
                 <el-input size="small" v-model="searchForm.projectName" placeholder="项目名称" clearable></el-input>
          </el-form-item>
+        <el-form-item prop="year">
+          <el-date-picker
+            v-model="searchForm.year"
+            type="year"
+            value-format="yyyy"
+            placeholder="选择年份">
+          </el-date-picker>
+        </el-form-item>
         <el-form-item prop="documentNum">
           <el-input size="small" v-model="searchForm.documentNum" placeholder="文号" clearable></el-input>
         </el-form-item>
@@ -40,7 +48,8 @@
 <!--            <el-button v-if="hasPermission('sys:post:edit')" type="warning" size="small" icon="el-icon-edit-outline" @click="edit()" :disabled="$refs.projectTable && $refs.projectTable.getCheckboxRecords().length !== 1" plain>修改</el-button>-->
             <el-button v-if="hasPermission('sys:project:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.projectTable && $refs.projectTable.getCheckboxRecords().length === 0" plain>删除</el-button>
             <el-button v-if="hasPermission('sys:project:import')"  type="default" @click="downloadTpl()" size="small">下载模板</el-button>
-            <span style="margin-left:20px">文件上传比例 {{proport}}</span>
+            <el-button v-if="hasPermission('sys:project:exportFile')"  type="warning" plain @click="downloadFile()" size="small">完成比例</el-button>
+            <span style="margin-left:20px;color: #999999">文件上传比例 {{proport}}</span>
           </template>
         </vxe-toolbar>
         <div style="height: calc(100% - 80px);">
@@ -82,6 +91,7 @@
                         <span v-else>{{scope.row.projectName}}</span>
                     </template>
                 </vxe-column>
+                <vxe-column width="80px"  title="年份" field="year" > </vxe-column>
                 <vxe-column width="200px"  title="文号" field="documentNum" > </vxe-column>
                 <vxe-column width="110px"  title="协议号" field="protocolNum" > </vxe-column>
                 <vxe-column width="200px"  title="客户名称" field="customerName" > </vxe-column>
@@ -160,6 +170,7 @@
       return {
         searchForm: {
           customerName: '',
+          year: '',
           projectName: '',
           projectHead: ''
         },
@@ -190,7 +201,10 @@
       // 获取数据列表
       refreshList () {
         this.loading = true
-        this.projectService.proportion('1').then(({data}) => {
+        this.projectService.proportion({
+          'itemType': '1',
+          ...this.searchForm
+        }).then(({data}) => {
           this.proport = data
         })
         this.projectService.list({
@@ -284,6 +298,23 @@
           }
         })
       },
+      // 下载文档
+      downloadFile () {
+        this.loading = true
+        this.projectService.fileUploadList({
+          'itemType': '1',
+          ...this.searchForm
+        }).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadExcel(res.data, '评估项目上传比例报告')
+          this.loading = false
+        }).catch(function (err) {
+          this.loading = false
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
+      },
       // 自定义服务端导出
       exportMethod ({ options }) {
         // 传给服务端的参数

+ 21 - 64
src/views/modules/sys/project/ConsultationForm.vue

@@ -32,6 +32,14 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
+            <el-form-item label="年份" prop="year"
+                          :rules="[
+                  {required: true, message:'年份不能为空', trigger:'blur'}
+                 ]">
+              <el-input v-model="inputForm.year" placeholder="请填写年份"     ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
             <el-form-item label="评估目的" prop="evaluationObjective"
                           :rules="[
                  ]">
@@ -410,6 +418,8 @@
   import SelectUserTree from '@/views/modules/utils/treeUserSelect'
   import OSSSerive, {
     httpRequest,
+    toHref,
+    openWindowOnUrl,
     handleRemove,
     fileName
   } from '@/api/sys/OSSService'
@@ -428,6 +438,7 @@
           permissionFlag: '', // 判断是否为当前登录人参数
           customerName: '',
           projectName: '',
+          year: '',
           evaluationObjective: '',
           projectType: '',
           evaluationBaseDate: '',
@@ -490,6 +501,9 @@
       this.ossService = new OSSSerive()
       this.projectService = new ProjectService()
     },
+    mounted () {
+      window.onPreview = this.onPreview
+    },
     methods: {
 
       uploadVideoProcess (event, file, fileList) {
@@ -501,36 +515,7 @@
         }
       },
       async toHref (row) {
-        const link = document.createElement('a')
-        if (row.id === null || row.id === undefined || row.id === '') {
-          await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
-            const url = data.data // 完整的url则直接使用
-            // 这里是将url转成blob地址,
-            fetch(url).then(res => res.blob()).then(blob => { // 将链接地址字符内容转变成blob地址
-              link.href = URL.createObjectURL(blob)
-              link.download = row.name || '' // 下载文件的名字
-              // a.download = url.split('/')[url.split('/').length -1] //  // 下载文件的名字
-              document.body.appendChild(link)
-              link.click()
-              // 在资源下载完成后 清除 占用的缓存资源
-              window.URL.revokeObjectURL(link.href)
-              document.body.removeChild(link)
-            })
-          })
-        } else {
-          const url = row.temporaryUrl // 完整的url则直接使用
-          // 这里是将url转成blob地址,
-          fetch(url).then(res => res.blob()).then(blob => { // 将链接地址字符内容转变成blob地址
-            link.href = URL.createObjectURL(blob)
-            link.download = row.name || '' // 下载文件的名字
-            // a.download = url.split('/')[url.split('/').length -1] //  // 下载文件的名字
-            document.body.appendChild(link)
-            link.click()
-            // 在资源下载完成后 清除 占用的缓存资源
-            window.URL.revokeObjectURL(link.href)
-            document.body.removeChild(link)
-          })
-        }
+        toHref(row)
       },
       onPreview (url) {
         this.url = url
@@ -558,6 +543,7 @@
         this.inputForm = {
           customerName: '',
           projectName: '',
+          year: '',
           evaluationObjective: '',
           projectType: '',
           evaluationBaseDate: '',
@@ -631,6 +617,7 @@
       doSubmit () {
         if (this.progressFlag === true) {
           this.$message.warning('文件正在上传中,请稍等')
+          return
         }
         this.$refs['inputForm'].validate((valid) => {
           if (valid) {
@@ -666,6 +653,7 @@
         this.$refs.inputForm.resetFields()
         this.visible = false
         this.showVi = true
+        this.$emit('refreshDataList')
       },
       async httpRequest (file) {
         await httpRequest(file, fileName(file), 'projectRecords')
@@ -683,9 +671,9 @@
           item.createBy = this.$store.state.user.name
           this.dataListNew.push(item)
         })
-        const isLt2M = file.size / 1024 / 1024 < 300
+        const isLt2M = file.size / 1024 / 1024 < 1024
         if (isLt2M === false) {
-          this.$message.error('文件大小不能超过 ' + 300 + 'M !')
+          this.$message.error('文件大小不能超过 ' + 1 + 'G !')
           this.fileList = []
           this.filesArra2 = []
         } else {
@@ -696,38 +684,7 @@
         }
       },
       async showFile (row) {
-        let suffix = row.name.substring(row.name.lastIndexOf('.') + 1)
-        if (suffix === 'jpg' || suffix === 'png' || suffix === 'gif' || suffix === 'bmp' || suffix === 'jpeg') {
-          if (row.url !== null && row.url !== undefined && row.url !== '') {
-            this.onPreview(row.url)
-            return
-          } else {
-            await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
-              this.onPreview(data.data)
-            })
-            return
-          }
-        }
-        if (row.url !== null && row.url !== undefined && row.url !== '') {
-          if (suffix === 'pdf') {
-            window.open('https://view.xdocin.com/xdoc?_xdoc=' + row.url, '_blank')
-          } else if (suffix === 'rar' || suffix === 'zip' || suffix === 'jar' || suffix === '7z') {
-            window.open('http://ow365.cn/?i=25008&furl=' + row.url, '_blank')
-          } else {
-            window.open('https://view.officeapps.live.com/op/view.aspx?src=' + row.url, '_blank')
-          }
-        } else if (row.raw.url !== null && row.raw.url !== undefined && row.raw.url !== '') {
-          await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
-            this.rowurl = data.data
-          })
-          if (suffix === 'pdf') {
-            window.open('https://view.xdocin.com/xdoc?_xdoc=' + this.rowurl, '_blank')
-          } else if (suffix === 'rar' || suffix === 'zip' || suffix === 'jar' || suffix === '7z') {
-            window.open('http://ow365.cn/?i=25008&furl=' + this.rowurl, '_blank')
-          } else {
-            window.open('https://view.officeapps.live.com/op/view.aspx?src=' + this.rowurl, '_blank')
-          }
-        }
+        await openWindowOnUrl(row)
       },
       // 排序
       sortChangeHandle (column) {

+ 42 - 3
src/views/modules/sys/project/ConsultationList.vue

@@ -6,6 +6,14 @@
          <el-form-item prop="projectName">
                 <el-input size="small" v-model="searchForm.projectName" placeholder="项目名称" clearable></el-input>
          </el-form-item>
+        <el-form-item prop="year">
+          <el-date-picker
+            v-model="searchForm.year"
+            type="year"
+            value-format="yyyy"
+            placeholder="选择年份">
+          </el-date-picker>
+        </el-form-item>
         <el-form-item prop="documentNum">
           <el-input size="small" v-model="searchForm.documentNum" placeholder="文号" clearable></el-input>
         </el-form-item>
@@ -41,7 +49,8 @@
 <!--            <el-button v-if="hasPermission('sys:post:edit')" type="warning" size="small" icon="el-icon-edit-outline" @click="edit()" :disabled="$refs.projectTable && $refs.projectTable.getCheckboxRecords().length !== 1" plain>修改</el-button>-->
             <el-button v-if="hasPermission('sys:project:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.projectTable && $refs.projectTable.getCheckboxRecords().length === 0" plain>删除</el-button>
             <el-button v-if="hasPermission('sys:project:import')"  type="default" @click="downloadTpl()" size="small">下载模板</el-button>
-
+            <el-button v-if="hasPermission('sys:project:exportFile')"  type="warning" plain @click="downloadFile()" size="small">完成比例</el-button>
+            <span style="margin-left:20px;color: #999999">文件上传比例 {{proport}}</span>
           </template>
         </vxe-toolbar>
         <div style="height: calc(100% - 80px);">
@@ -83,6 +92,7 @@
                   <span v-else>{{scope.row.projectName}}</span>
                 </template>
               </vxe-column>
+              <vxe-column width="80px"  title="年份" field="year" > </vxe-column>
               <vxe-column width="200px"  title="文号" field="documentNum" > </vxe-column>
               <vxe-column width="110px"  title="协议号" field="protocolNum" > </vxe-column>
               <vxe-column width="200px"  title="客户名称" field="customerName" > </vxe-column>
@@ -110,7 +120,11 @@
                   {{ $dictUtils.getDictLabel("project_status", scope.row.status, '-') }}
                 </template>
               </vxe-column>
-
+              <vxe-column width="80px"   title="上传状态" field="fileUploadType" >
+                <template slot-scope="scope">
+                  {{ $dictUtils.getDictLabel("file_upload_type", scope.row.fileUploadType, '-') }}
+                </template>
+              </vxe-column>
 
 
                 <!--<vxe-column  title="是否可用" field="status" sortable>
@@ -158,6 +172,7 @@
         searchForm: {
           customerName: '',
           projectName: '',
+          year: '',
           projectHead: ''
         },
         dataList: [],
@@ -167,7 +182,8 @@
           pageSize: 10,
           orders: []
         },
-        loading: false
+        loading: false,
+        proport: ''
       }
     },
     projectService: null,
@@ -186,6 +202,12 @@
       // 获取数据列表
       refreshList () {
         this.loading = true
+        this.projectService.proportion({
+          'itemType': '2',
+          ...this.searchForm
+        }).then(({data}) => {
+          this.proport = data
+        })
         this.projectService.list({
           'current': this.tablePage.currentPage,
           'size': this.tablePage.pageSize,
@@ -277,6 +299,23 @@
           }
         })
       },
+      // 下载文档
+      downloadFile () {
+        this.loading = true
+        this.projectService.fileUploadList({
+          'itemType': '2',
+          ...this.searchForm
+        }).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadExcel(res.data, '咨询项目上传比例报告')
+          this.loading = false
+        }).catch(function (err) {
+          this.loading = false
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
+      },
       // 自定义服务端导出
       exportMethod ({ options }) {
         // 传给服务端的参数

+ 56 - 74
src/views/modules/sys/workClient/WorkClientForm.vue

@@ -15,7 +15,7 @@
             <el-form-item label="客户名称" prop="workClientInfo.name" :rules="[
                   {required: true, message:'请输入客户名称', trigger:'blur'}
                 ]">
-              <el-input v-model="inputForm.workClientInfo.name" placeholder="请输入客户名称"></el-input>
+              <el-input @blur="isExistByName" v-model="inputForm.workClientInfo.name" placeholder="请输入客户名称"></el-input>
             </el-form-item>
           </el-col>
             <el-col :span="2">
@@ -88,7 +88,7 @@
                           :rules="[
                    {required: true, message:'请输入统一社会信用代码', trigger:'blur'}
                  ]">
-              <el-input v-model="inputForm.workClientInfo.uscCode" placeholder="请输入统一社会信用代码"></el-input>
+              <el-input @blur="isExistByUscCode" v-model="inputForm.workClientInfo.uscCode" placeholder="请输入统一社会信用代码"></el-input>
             </el-form-item>
           </el-col>
 
@@ -329,10 +329,13 @@
                    :on-remove="handleRemove"
                    :show-file-list="false"
                    :on-change="changes"
+                    :on-progress="uploadVideoProcess"
                    :file-list="filesArra2">
           <el-button type="info" size="mini" v-if="inputForm.permissionFlag&&showVi">点击上传</el-button>
           </el-upload>
           <div style="height: calc(100% - 80px);margin-top: 10px">
+            <!-- 进度条 -->
+            <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
           <vxe-table
             style="margin-left: 5em"
             border="inner"
@@ -376,7 +379,7 @@
         zIndex="9999"/>
       <span slot="footer" class="dialog-footer">
       <el-button size="small" @click="close(),closeXTable()" 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>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick :disabled="isSubmit">确定</el-button>
     </span>
     </el-dialog>
   </div>
@@ -387,6 +390,8 @@
   import SelectTree from '@/components/treeSelect/treeSelect.vue'
   import OSSSerive, {
     httpRequest,
+    toHref,
+    openWindowOnUrl,
     handleRemove,
     fileName
   } from '@/api/sys/OSSService'
@@ -403,6 +408,7 @@
         dataListNew: [],
         title: '',
         method: '',
+        isSubmit: false,
         visible: false,
         loading: false,
         returnForm: {
@@ -508,7 +514,9 @@
         src: '',
         showVi: true,
         onedit: false,
-        type: ''
+        type: '',
+        loadProgress: 0, // 动态显示进度条
+        progressFlag: false // 关闭进度条
       }
     },
     components: {
@@ -521,41 +529,49 @@
       this.ossService = new OSSSerive()
       this.workClientService = new WorkClientService()
     },
+    mounted () {
+      window.onPreview = this.onPreview
+    },
     methods: {
-      async toHref (row) {
-        const link = document.createElement('a')
-        if (row.id === null || row.id === undefined || row.id === '') {
-          await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
-            const url = data.data // 完整的url则直接使用
-            // 这里是将url转成blob地址,
-            fetch(url).then(res => res.blob()).then(blob => { // 将链接地址字符内容转变成blob地址
-              link.href = URL.createObjectURL(blob)
-              console.log(link.href)
-              link.download = row.name || '' // 下载文件的名字
-              // a.download = url.split('/')[url.split('/').length -1] //  // 下载文件的名字
-              document.body.appendChild(link)
-              link.click()
-              // 在资源下载完成后 清除 占用的缓存资源
-              window.URL.revokeObjectURL(link.href)
-              document.body.removeChild(link)
-            })
+      uploadVideoProcess (event, file, fileList) {
+        this.progressFlag = true // 显示进度条
+        this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
+        if (this.loadProgress >= 100) {
+          this.loadProgress = 100
+          setTimeout(() => { this.progressFlag = false }, 1000) // 一秒后关闭进度条
+        }
+      },
+      isExistByName () {
+        let value = this.inputForm.workClientInfo.name
+        if (value !== null && value !== undefined && value !== '') {
+          this.workClientService.isExist(value).then((data) => {
+            console.log('data', data.data)
+            if (data.data !== 0) {
+              this.$message.error('该客户名称已存在')
+              this.isSubmit = true
+            } else {
+              this.isSubmit = false
+            }
           })
-        } else {
-          const url = row.temporaryUrl // 完整的url则直接使用
-          // 这里是将url转成blob地址,
-          fetch(url).then(res => res.blob()).then(blob => { // 将链接地址字符内容转变成blob地址
-            link.href = URL.createObjectURL(blob)
-            console.log(link.href)
-            link.download = row.name || '' // 下载文件的名字
-            // a.download = url.split('/')[url.split('/').length -1] //  // 下载文件的名字
-            document.body.appendChild(link)
-            link.click()
-            // 在资源下载完成后 清除 占用的缓存资源
-            window.URL.revokeObjectURL(link.href)
-            document.body.removeChild(link)
+        }
+      },
+      isExistByUscCode () {
+        let value = this.inputForm.workClientInfo.uscCode
+        if (value !== null && value !== undefined && value !== '') {
+          this.workClientService.isExist(value).then((data) => {
+            console.log('data', data.data)
+            if (data.data !== 0) {
+              this.$message.error('该统一社会信用代码已存在')
+              this.isSubmit = true
+            } else {
+              this.isSubmit = false
+            }
           })
         }
       },
+      async toHref (row) {
+        toHref(row)
+      },
       onPreview (url) {
         this.url = url
         this.showViewer = true
@@ -694,6 +710,10 @@
       },
       // 表单提交
       doSubmit () {
+        if (this.progressFlag === true) {
+          this.$message.warning('文件正在上传中,请稍等')
+          return
+        }
         this.$refs['inputForm'].validate((valid) => {
           if (valid) {
             this.loading = true
@@ -792,14 +812,12 @@
         this.showVi = true
       },
       httpRequest (file) {
-        httpRequest(file, fileName(file), 'projectRecords')
+        httpRequest(file, fileName(file), 'workClient')
       },
       handleRemove () {
         this.fileList = handleRemove()
       },
       changes (file, fileList) {
-        console.log('file', file)
-        console.log('22', fileList)
         this.dataListNew = []
         this.dataList.forEach((item) => {
           this.dataListNew.push(item)
@@ -809,8 +827,6 @@
           item.createBy = this.$store.state.user.name
           this.dataListNew.push(item)
         })
-        console.log('11', this.dataList)
-        console.log('33', this.dataListNew)
         const isLt2M = file.size / 1024 / 1024 < 300
         if (isLt2M === false) {
           this.$message.error('文件大小不能超过 ' + 300 + 'M !')
@@ -819,39 +835,7 @@
         }
       },
       async showFile (row) {
-        console.log('row', row)
-        let suffix = row.name.substring(row.name.lastIndexOf('.') + 1)
-        if (suffix === 'jpg' || suffix === 'png' || suffix === 'gif' || suffix === 'bmp' || suffix === 'jpeg') {
-          if (row.url !== null && row.url !== undefined && row.url !== '') {
-            this.onPreview(row.url)
-            return
-          } else {
-            await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
-              this.onPreview(data.data)
-            })
-            return
-          }
-        }
-        if (row.url !== null && row.url !== undefined && row.url !== '') {
-          if (suffix === 'pdf') {
-            window.open('https://view.xdocin.com/xdoc?_xdoc=' + row.url, '_blank')
-          } else if (suffix === 'rar' || suffix === 'zip' || suffix === 'jar' || suffix === '7z') {
-            window.open('http://ow365.cn/?i=25008&furl=' + row.url, '_blank')
-          } else {
-            window.open('https://view.officeapps.live.com/op/view.aspx?src=' + row.url, '_blank')
-          }
-        } else if (row.raw.url !== null && row.raw.url !== undefined && row.raw.url !== '') {
-          await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
-            this.rowurl = data.data
-          })
-          if (suffix === 'pdf') {
-            window.open('https://view.xdocin.com/xdoc?_xdoc=' + this.rowurl, '_blank')
-          } else if (suffix === 'rar' || suffix === 'zip' || suffix === 'jar' || suffix === '7z') {
-            window.open('http://ow365.cn/?i=25008&furl=' + this.rowurl, '_blank')
-          } else {
-            window.open('https://view.officeapps.live.com/op/view.aspx?src=' + this.rowurl, '_blank')
-          }
-        }
+        await openWindowOnUrl(row)
       },
       // 排序
       sortChangeHandle (column) {
@@ -862,7 +846,6 @@
         this.refreshList()
       },
       deleteMsgById (row, index) {
-        console.log(index)
         this.dataListNew.splice(index, 1)
         if (row.id !== null && row.id !== '' && row.id !== undefined) {
           this.ossService.deleteMsgById(row.id)
@@ -961,7 +944,6 @@
       async rowClick (event) {
         let id = this.gridData[event.rowIndex].companyid
         await this.workClientService.enterpriseTicketInfo(id).then((data) => {
-          console.log(data)
           this.inputForm.workClientInfo.name = data.data.ENTNAME
           this.inputForm.workClientInfo.uscCode = data.data.UNCID
           this.inputForm.workClientInfo.registerAddress = data.data.OPLOC

+ 84 - 3
src/views/modules/sys/workClient/WorkClientList.vue

@@ -6,7 +6,7 @@
                 <el-input size="small" v-model="searchForm.name" placeholder="请输入客户名称" clearable></el-input>
          </el-form-item>
 
-        <el-form-item prop="areaId">
+        <el-form-item label="地区" prop="areaId">
           <SelectTree
             ref="area"
             :props="{
@@ -23,6 +23,78 @@
             @getValue="(value) => {searchForm.areaId=value}"/>
         </el-form-item>
 
+        <el-form-item label="创建时间" prop="createDates">
+          <el-date-picker
+            v-model="searchForm.createDates"
+            type="datetimerange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期">
+          </el-date-picker>
+        </el-form-item>
+
+        <el-form-item label="客户性质" prop="companyType">
+          <el-select v-model="searchForm.companyType" placeholder="请选择" style="width:100%;">
+            <el-option
+              v-for="item in $dictUtils.getDictList('customer_nature')"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="客户行业" prop="companyIndustry">
+          <el-select v-model="searchForm.companyIndustry" placeholder="请选择" style="width:100%;">
+            <el-option
+              v-for="item in $dictUtils.getDictList('industry')"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="客户类型" prop="clientType">
+          <el-select v-model="searchForm.clientType" placeholder="请选择" style="width:100%;">
+            <el-option
+              v-for="item in $dictUtils.getDictList('customer_type')"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="统一社会信用代码" prop="uscCode">
+          <el-input size="small" v-model="searchForm.uscCode" placeholder="请输入统一社会信用代码" clearable></el-input>
+        </el-form-item>
+
+        <el-form-item label="创建人" prop="createBy">
+          <SelectUserTree
+            ref="companyTree"
+            :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+            :url="`/sys/user/treeUserDataAllOffice?type=2`"
+            :value="searchForm.createBy"
+            :clearable="true"
+            :accordion="true"
+            @getValue="(value) => {searchForm.createBy=value}"/>
+        </el-form-item>
+
+        <el-form-item label="代表方" prop="deputy">
+          <el-select v-model="searchForm.deputy" placeholder="请选择" style="width:100%;">
+            <el-option
+              v-for="item in $dictUtils.getDictList('representative')"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
 
           <el-form-item>
             <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
@@ -123,13 +195,21 @@
   import WorkClientForm from './WorkClientForm'
   import WorkClientService from '@/api/sys/WorkClientService'
   import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
   export default {
     data () {
       return {
         visible: false,
         searchForm: {
           name: '',
-          areaId: ''
+          areaId: '',
+          createDates: [],
+          companyType: '',
+          companyIndustry: '',
+          clientType: '',
+          uscCode: '',
+          createBy: '',
+          deputy: ''
         },
         dataList: [],
         tablePage: {
@@ -147,7 +227,8 @@
     },
     components: {
       WorkClientForm,
-      SelectTree
+      SelectTree,
+      SelectUserTree
     },
     activated () {
       this.refreshList()