瀏覽代碼

feature(项目):
1、项目升级上传文件问题改走文件服务器
2、创建项目添加招标信息

ZZH-wl 2 年之前
父節點
當前提交
327e4e4dbf

+ 2 - 0
.env.development

@@ -21,3 +21,5 @@ VUE_APP_ParentPath=dashoo.opms.parent-0.0.1
 
 # 文件上传
 VUE_APP_UPLOAD_WEED='http://192.168.0.252:9333/dir/assign'
+# 文件一步上传
+VUE_APP_UPLOAD_FILE_WEED='http://192.168.0.218:9933/weedfs/upload'

+ 2 - 0
.env.production

@@ -14,3 +14,5 @@ VUE_APP_ParentPath=dashoo.opms.parent-0.0.1
 # 文件上传
 VUE_APP_PROTOCOL='https://'
 VUE_APP_UPLOAD_WEED='https://oms.dashoo.cn/dir/assign'
+# 文件一步上传
+VUE_APP_UPLOAD_FILE_WEED='https://oms.dashoo.cn/weedfs/upload'

+ 1 - 0
package.json

@@ -7,6 +7,7 @@
     "serve": "vue-cli-service serve --mode development",
     "build:dev": "vue-cli-service build --mode development",
     "build": "vue-cli-service build -mode production",
+    "build:test": "vue-cli-service build --mode test",
     "lint": "vue-cli-service lint",
     "lint:eslint": "eslint {src,mock}/**/*.{vue,js} --fix",
     "lint:prettier": "prettier {src,mock}/**/*.{html,vue,css,sass,scss,js,md} --write",

+ 222 - 0
src/components/select/SelectCustomerBid.vue

@@ -0,0 +1,222 @@
+<template>
+  <el-dialog append-to-body :title="title" :visible.sync="innerVisible" @close="close">
+    <el-row>
+      <el-col :span="24">
+        <el-input
+          v-model="queryForm.searchText"
+          clearable
+          placeholder="招标产品名称/招标信息标题/中标单位"
+          style="width: 30%; margin-right: 10px"
+          suffix-icon="el-icon-search"
+          @keyup.enter.native="fetchData" />
+        <el-button icon="el-icon-search" type="primary" @click="fetchData">查询</el-button>
+        <table-tool
+          :columns="columns"
+          :show-columns.sync="showColumns"
+          style="float: right"
+          table-type="selectCustomerBidTable" />
+      </el-col>
+    </el-row>
+    <el-table ref="bidTable" v-loading="listLoading" :data="list" @selection-change="setSelectRows">
+      <el-table-column align="center" type="selection" />
+      <el-table-column
+        v-for="(item, index) in showColumns"
+        :key="index + Math.random()"
+        align="center"
+        :label="item.label"
+        :prop="item.prop"
+        show-overflow-tooltip
+        :sortable="item.sortable"
+        :width="item.width">
+        <template #default="{ row }">
+          <span v-if="item.prop === 'infoType'">
+            {{ selectDictLabel(bidInfoTypeOptions, row.infoType) }}
+          </span>
+          <span v-else-if="item.prop === 'publishedTime'">
+            {{ parseTime(row.publishedTime, '{y}-{m}-{d}') }}
+          </span>
+          <span v-else-if="item.prop === 'biddingTime'">
+            {{ parseTime(row.biddingTime, '{y}-{m}-{d}') }}
+          </span>
+          <span v-else>{{ row[item.prop] }}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      background
+      :current-page="queryForm.pageNum"
+      :layout="layout"
+      :page-size="queryForm.pageSize"
+      :total="total"
+      @current-change="handleCurrentChange"
+      @size-change="handleSizeChange" />
+    <span slot="footer">
+      <el-button size="mini" type="primary" @click="save">保存</el-button>
+      <el-button size="mini" @click="innerVisible = false">取消</el-button>
+    </span>
+    <!-- 新建联系人弹窗 -->
+    <customer-contact ref="contact" @contactSave="fetchData" />
+  </el-dialog>
+</template>
+
+<script>
+  import customerApi from '@/api/customer/index'
+  import TableTool from '@/components/table/TableTool'
+  import CustomerContact from '@/views/customer/components/Contact'
+
+  export default {
+    name: 'SelectContact',
+    components: {
+      TableTool,
+      CustomerContact,
+    },
+    props: {
+      title: {
+        type: String,
+        default: '选择客户联系人',
+      },
+      add: Boolean,
+      multiple: Boolean,
+      // 示例{ custId: id, custName: custName}
+      defaultCustomer: {
+        type: Object,
+        default() {
+          return {}
+        },
+      },
+      queryParams: {
+        type: Object,
+        default() {
+          return {}
+        },
+      },
+    },
+    data() {
+      return {
+        innerVisible: false,
+        queryForm: {
+          searchText: '',
+          custId: 1,
+          pageNum: 1,
+          pageSize: 10,
+        },
+        showColumns: [],
+        columns: [
+          {
+            label: '客户名称',
+            width: '200px',
+            prop: 'cuctName',
+            disableCheck: true,
+          },
+          {
+            label: '招标产品名称',
+            width: '180px',
+            prop: 'productName',
+          },
+          {
+            label: '发布招标日期',
+            width: '150px',
+            prop: 'publishedTime',
+          },
+          {
+            label: '项目预算',
+            width: 'auto',
+            prop: 'budget',
+          },
+          {
+            label: '招标信息标题',
+            width: '200px',
+            prop: 'title',
+          },
+          {
+            label: '信息分类',
+            width: '150px',
+            prop: 'infoType',
+            formatter: this.infoTypeFormat,
+          },
+          {
+            label: '中标单位',
+            width: '200px',
+            prop: 'bidder',
+          },
+          {
+            label: '创建招标日期',
+            width: '150px',
+            prop: 'biddingTime',
+          },
+        ],
+        list: [],
+        listLoading: true,
+        layout: 'total, sizes, prev, pager, next, jumper',
+        total: 0,
+        selectRows: [],
+        bidInfoTypeOptions: [],
+      }
+    },
+    mounted() {
+      this.getDicts('bid_info_type').then((response) => {
+        this.bidInfoTypeOptions = response.data.values || []
+      })
+    },
+    methods: {
+      infoTypeFormat(row) {
+        return this.selectDictLabel(this.bidInfoTypeOptions, row.infoType)
+      },
+      open() {
+        this.innerVisible = true
+        this.fetchData()
+      },
+      close() {
+        this.selectRows = []
+        this.queryForm = this.$options.data().queryForm
+        this.$refs.bidTable.clearSelection()
+      },
+      save() {
+        this.innerVisible = false
+        console.log(this.selectRows)
+        this.$emit('save', this.selectRows)
+      },
+      handleAdd() {
+        this.$refs.contact.contactForm.custId = this.defaultCustomer.custId
+        this.$refs.contact.contactForm.custName = this.defaultCustomer.custName
+        this.$refs.contact.contactVisible = true
+      },
+      async fetchData() {
+        this.listLoading = true
+        let query = Object.assign(this.queryForm, this.queryParams)
+        const {
+          data: { list, total },
+        } = await customerApi.bidList(query)
+        this.list = list
+        this.total = total
+        this.listLoading = false
+      },
+      setSelectRows(val) {
+        if (!this.multiple && val.length === this.list.length && val.length > 1) {
+          // 返回单条数据情况下-控制全选情况下单选第一条数据
+          this.$refs.bidTable.clearSelection()
+          if (this.selectRows.length === 1) {
+            return
+          }
+          this.$refs.bidTable.toggleRowSelection(val.shift(), true)
+        } else if (!this.multiple && val.length > 1) {
+          // 返回单条数据情况下-控制选择当前点击数据
+          this.$refs.bidTable.clearSelection()
+          this.$refs.bidTable.toggleRowSelection(val.pop(), true)
+        } else {
+          this.selectRows = val
+        }
+      },
+      handleSizeChange(val) {
+        this.queryForm.pageSize = val
+        this.fetchData()
+      },
+      handleCurrentChange(val) {
+        this.queryForm.pageNum = val
+        this.fetchData()
+      },
+    },
+  }
+</script>
+
+<style scoped></style>

+ 46 - 0
src/views/proj/business/components/BusinessAdd.vue

@@ -87,6 +87,21 @@
               @focus="handleSelectDistributor" />
           </el-form-item>
         </el-col>
+        <el-col :span="8">
+          <el-form-item label="是否来自招投标" prop="isBid">
+            <el-switch v-model="isBid" active-text="是" inactive-text="否" style="width: 100%" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="招标信息" prop="bidInfo">
+            <el-input
+              v-model="form.bidInfo"
+              :disabled="!isBid"
+              readonly
+              suffix-icon="el-icon-search"
+              @focus="handleSelectCustomerBid" />
+          </el-form-item>
+        </el-col>
         <el-col :span="8">
           <el-form-item label="项目预算" prop="nboBudget">
             <amount-input v-model.trim="form.nboBudget" placeholder="请输入金额" />
@@ -203,6 +218,8 @@
       :default-customer="customerInfo"
       :query-params="queryContact"
       @save="selectContact" />
+    <!-- 选择客户招标信息弹窗 -->
+    <select-customer-bid ref="selectCustomerBid" :query-params="queryContact" @save="selectCustomerBid" />
     <!-- 选择销售工程师弹窗 -->
     <select-user
       ref="selectSales"
@@ -223,6 +240,7 @@
   import businessApi from '@/api/proj/business'
   import AmountInput from '@/components/currency'
   import ProductTable from './ProductTable'
+  import SelectCustomerBid from '@/components/select/SelectCustomerBid'
   import SelectContact from '@/components/select/SelectCustomerContact'
   import SelectCustomer from '@/components/select/SelectCustomer'
   import SelectUser from '@/components/select/SelectUser'
@@ -239,6 +257,7 @@
       SelectDistributor,
       SelectCustomer,
       SelectUser,
+      SelectCustomerBid,
     },
     props: {
       // 客户信息{ custId: id, custName: custName}
@@ -284,6 +303,8 @@
           remark: undefined,
           products: undefined,
           nboType: '30',
+          bidId: undefined,
+          bidInfo: undefined,
           // 跟进
           followTime: new Date(),
           followUserId: undefined,
@@ -315,6 +336,7 @@
         queryContact: {},
         customerInfo: {},
         productData: [],
+        isBid: true,
       }
     },
     computed: {
@@ -394,6 +416,16 @@
       handleSelectFollowUser() {
         this.$refs.selectFollowUser.open()
       },
+      handleSelectCustomerBid() {
+        if (!this.isBid) {
+          return
+        }
+        if (!this.queryContact.custId) {
+          this.$message.warning('请先选择客户')
+          return
+        }
+        this.$refs.selectCustomerBid.open()
+      },
       selectCustomer(val) {
         if (val && val.length > 0) {
           this.queryContact.custId = val[0].id
@@ -448,6 +480,13 @@
         this.productData.push(...projData)
         this.productData = this.removeDuplicateObj(this.productData)
       },
+      selectCustomerBid(val) {
+        console.log(val)
+        if (val && val.length > 0) {
+          this.form.bidId = val[0].id
+          this.form.bidInfo = val[0].title
+        }
+      },
       // 数组对象去重
       removeDuplicateObj(arr) {
         let obj = {}
@@ -484,6 +523,10 @@
         } else {
           this.title = '编辑'
           this.form = Object.assign({}, row)
+          this.isBid = false
+          if (this.form.bidId) {
+            this.isBid = true
+          }
           this.queryContact.custId = this.form.custId
           this.customerInfo = {
             custId: this.form.custId,
@@ -534,4 +577,7 @@
   .el-form-item--small.el-form-item {
     margin-bottom: 10px;
   }
+  .el-col-8 {
+    height: 75px;
+  }
 </style>

+ 46 - 20
src/views/proj/business/components/BusinessEdit.vue

@@ -87,6 +87,21 @@
               @focus="handleSelectDistributor" />
           </el-form-item>
         </el-col>
+        <el-col :span="8">
+          <el-form-item label="是否来自招投标" prop="isBid">
+            <el-switch v-model="isBid" active-text="是" inactive-text="否" style="width: 100%" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="招标信息" prop="bidInfo">
+            <el-input
+              v-model="form.bidInfo"
+              :disabled="!isBid"
+              readonly
+              suffix-icon="el-icon-search"
+              @focus="handleSelectCustomerBid" />
+          </el-form-item>
+        </el-col>
         <el-col :span="8">
           <el-form-item label="项目预算" prop="nboBudget">
             <amount-input v-model.trim="form.nboBudget" placeholder="请输入金额" />
@@ -138,26 +153,6 @@
             <el-input v-model="form.intervention" />
           </el-form-item>
         </el-col>
-        <el-col :span="8">
-          <el-form-item label="下次联系时间" prop="nextFollowTime">
-            <el-date-picker
-              v-model="form.nextFollowTime"
-              :disabled="true"
-              placeholder="选择日期"
-              style="width: 100%"
-              type="datetime" />
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item label="最新跟进时间" prop="finalFollowTime">
-            <el-date-picker
-              v-model="form.finalFollowTime"
-              :disabled="true"
-              placeholder="选择日期"
-              style="width: 100%"
-              type="datetime" />
-          </el-form-item>
-        </el-col>
         <el-col :span="8">
           <el-form-item label="技术支持时间" prop="technicalSupportTime">
             <el-date-picker
@@ -296,6 +291,8 @@
       :default-customer="customerInfo"
       :query-params="queryContact"
       @save="selectContact" />
+    <!-- 选择客户招标信息弹窗 -->
+    <select-customer-bid ref="selectCustomerBid" :query-params="queryContact" @save="selectCustomerBid" />
     <!-- 选择销售工程师弹窗 -->
     <select-user
       ref="selectSales"
@@ -316,6 +313,7 @@
   import to from 'await-to-js'
   import { mapGetters } from 'vuex'
   import ProductTable from './ProductTable'
+  import SelectCustomerBid from '@/components/select/SelectCustomerBid'
   import SelectContact from '@/components/select/SelectCustomerContact'
   import SelectCustomer from '@/components/select/SelectCustomer'
   import SelectUser from '@/components/select/SelectUser'
@@ -332,6 +330,7 @@
       SelectDistributor,
       SelectCustomer,
       SelectUser,
+      SelectCustomerBid,
     },
     props: {
       // 客户信息{ custId: id, custName: custName}
@@ -376,6 +375,8 @@
           intervention: undefined,
           remark: undefined,
           products: undefined,
+          bidId: undefined,
+          bidInfo: undefined,
 
           // 跟进
           followTime: new Date(),
@@ -426,6 +427,7 @@
         queryContact: {},
         customerInfo: {},
         productData: [],
+        isBid: true,
       }
     },
     computed: {
@@ -505,6 +507,16 @@
       handleSelectFollowUser() {
         this.$refs.selectFollowUser.open()
       },
+      handleSelectCustomerBid() {
+        if (!this.isBid) {
+          return
+        }
+        if (!this.queryContact.custId) {
+          this.$message.warning('请先选择客户')
+          return
+        }
+        this.$refs.selectCustomerBid.open()
+      },
       selectCustomer(val) {
         if (val && val.length > 0) {
           this.queryContact.custId = val[0].id
@@ -559,6 +571,13 @@
         this.productData.push(...projData)
         this.productData = this.removeDuplicateObj(this.productData)
       },
+      selectCustomerBid(val) {
+        console.log(val)
+        if (val && val.length > 0) {
+          this.form.bidId = val[0].id
+          this.form.bidInfo = val[0].title
+        }
+      },
       // 数组对象去重
       removeDuplicateObj(arr) {
         let obj = {}
@@ -595,6 +614,10 @@
         } else {
           this.title = '编辑'
           this.form = Object.assign({}, row)
+          this.isBid = false
+          if (this.form.bidId) {
+            this.isBid = true
+          }
           this.queryContact.custId = this.form.custId
           this.customerInfo = {
             custId: this.form.custId,
@@ -645,4 +668,7 @@
   .el-form-item--small.el-form-item {
     margin-bottom: 10px;
   }
+  .el-col-8 {
+    height: 75px;
+  }
 </style>

+ 31 - 27
src/views/proj/business/components/BusinessGradation.vue

@@ -159,7 +159,7 @@
           <el-col v-if="form.isAdoptDashoo === '10'" :span="8">
             <el-form-item label="参数文件" prop="dashooParamFile" :required="form.isAdoptDashoo === '10'">
               <el-upload
-                action="#"
+                :action="uploadFileUrl"
                 :auto-upload="false"
                 :file-list="dashooParamFileList"
                 :limit="1"
@@ -191,15 +191,10 @@
               prop="quotationFile"
               :required="form.nboType === '10' || form.nboType === '20'">
               <el-upload
-                action="#"
-                :auto-upload="false"
+                :action="uploadFileUrl"
                 :file-list="quotationFileList"
                 :limit="1"
-                :on-change="
-                  (file) => {
-                    return setQuotationFile(file)
-                  }
-                ">
+                :on-success="setQuotationFile">
                 <el-button size="mini" type="primary">点击上传</el-button>
               </el-upload>
             </el-form-item>
@@ -357,6 +352,7 @@
         // 大数参数文件
         dashooParamFileList: [],
         quotationFileList: [],
+        uploadFileUrl: process.env.VUE_APP_UPLOAD_FILE_WEED,
         fileSettings: {
           // 文件配置信息
           fileSize: 52428800,
@@ -378,13 +374,21 @@
     },
     methods: {
       // 上传图片
-      setDashooParamFile(file) {
-        this.form.dashooParamFile = file.raw
-        return true
+      setDashooParamFile(res) {
+        // 如果上传成功
+        if (res.Code == 200) {
+          this.form.dashooParamFile = res.Data
+        } else {
+          this.$message.error('上传文件失败')
+        }
       },
-      setQuotationFile(file) {
-        this.form.quotationFile = file.raw
-        return true
+      setQuotationFile(res) {
+        // 如果上传成功
+        if (res.Code == 200) {
+          this.form.quotationFile = res.Data
+        } else {
+          this.$message.error('上传文件失败')
+        }
       },
       handleSelectContact() {
         if (!this.queryContact.custId) {
@@ -446,21 +450,21 @@
             this.$baseConfirm('你确定要对当前项目' + this.title + '吗', null, async () => {
               this.loading = true
               if (this.type === 'up') {
-                if (this.form.nboType === '10' || this.form.nboType === '20') {
-                  const [err, res] = await to(businessApi.BusinessUpgradeAorB(this.form))
-                  if (err) {
-                    this.$baseMessage(res.msg, 'error')
-                  } else {
-                    this.$baseMessage(res.msg, 'success')
-                  }
+                // if (this.form.nboType === '10' || this.form.nboType === '20') {
+                //   const [err, res] = await to(businessApi.BusinessUpgradeAorB(this.form))
+                //   if (err) {
+                //     this.$baseMessage(res.msg, 'error')
+                //   } else {
+                //     this.$baseMessage(res.msg, 'success')
+                //   }
+                // } else {
+                const [err, res] = await to(businessApi.businessUpgrade(this.form))
+                if (err) {
+                  this.$baseMessage(res.msg, 'error')
                 } else {
-                  const [err, res] = await to(businessApi.businessUpgrade(this.form))
-                  if (err) {
-                    this.$baseMessage(res.msg, 'error')
-                  } else {
-                    this.$baseMessage(res.msg, 'success')
-                  }
+                  this.$baseMessage(res.msg, 'success')
                 }
+                // }
               }
               if (this.type === 'down') {
                 const [err, res] = await to(businessApi.businessDowngrade(this.form))