2
3
فهرست منبع

前后:资质导入对比列表

dubch 5 سال پیش
والد
کامیت
2393c5c0a5

+ 6 - 3
src/dashoo.cn/backend/api/controllers/oilsupplier/goodsaptitude.go

@@ -1986,7 +1986,8 @@ func (this *OilGoodsAptitudeController) GetDelCertSubList() {
 	where = where + " and Type in (1, 3)"
 	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
 	var list []suppliercertsub.Tmp_OilSupplierCertSub
-	total := svc.GetMyPagingEntitiesWithOrderBytbl(TmpOilSupplierCertSubName, page.CurrentPage, page.Size, orderby, asc, &list, where)
+	//total := svc.GetMyPagingEntitiesWithOrderBytbl(TmpOilSupplierCertSubName, page.CurrentPage, page.Size, orderby, asc, &list, where)
+	total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierCertSubName, page.CurrentPage, page.Size, orderby, asc, &list, where)
 	var datainfo DataInfo
 	datainfo.Items = list
 	datainfo.CurrentItemCount = total
@@ -2019,7 +2020,8 @@ func (this *OilGoodsAptitudeController) DelTmpSupplierCertSub() {
 	if id != "" {
 		wheredel += " and Id=" + id
 	}
-	svc.GetEntitysByWhere(TmpOilSupplierCertSubName, wheredel, &supplierCertSubList)
+	//svc.GetEntitysByWhere(TmpOilSupplierCertSubName, wheredel, &supplierCertSubList)
+	svc.GetEntitysByWhere(OilSupplierCertSubName, wheredel, &supplierCertSubList)
 
 	var errinfo ErrorInfo
 	for _, item := range supplierCertSubList {
@@ -2036,7 +2038,8 @@ func (this *OilGoodsAptitudeController) DelTmpSupplierCertSub() {
 
 	for _, item := range supplierCertSubList {
 		where := "Id = " + strconv.Itoa(item.Id)
-		err = svc.DeleteEntityBytbl(TmpOilSupplierCertSubName, where)
+		//err = svc.DeleteEntityBytbl(TmpOilSupplierCertSubName, where)
+		err = svc.DeleteEntityBytbl(OilSupplierCertSubName, where)
 	}
 
 	if err == nil {

+ 203 - 4
src/dashoo.cn/frontend_web/src/pages/oilsupplier/goodsaptitude/tmpsuppliercheck.vue

@@ -23,7 +23,7 @@
             </el-dropdown>
           </el-form-item>
           <el-form-item>
-            <el-button type="warning" size="mini">导出</el-button>
+            <el-button type="warning" size="mini" @click="exportExcel">导出</el-button>
           </el-form-item>
         </el-form>
       </div>
@@ -58,6 +58,11 @@
         <el-table-column label="法人代表"  width="100px" prop="LegalPerson" align="center"></el-table-column>
         <el-table-column label="注册资金(万元)"  width="170px" prop="RegCapital" sortable align="center"></el-table-column>
         <el-table-column label="移动电话"  width="120px" prop="Mobile" align="center"></el-table-column>
+        <el-table-column label="是否缺资质" width="130px" prop="Checked" sortable align="center">
+          <template slot-scope="scope" >
+            <span style="font-family:'黑体';font-size:13px">{{stringChecked(scope.row.Checked)}}</span>
+          </template>
+        </el-table-column>
         <!--<el-table-column label="最后一次年审" width="100px" prop="AuditDate" align="center">-->
         <!--<template slot-scope="scope">{{ jstimehandle(scope.row.AuditDate) }}</template>-->
         <!--</el-table-column>-->
@@ -67,7 +72,7 @@
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[10, 15, 20, 25]" :page-size="size"
                      layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount"></el-pagination>
     </el-card>
-    <el-dialog :visible.sync="dialogVisibleCertsSub" width="80%">
+    <el-dialog :visible.sync="dialogVisibleCertsSub" width="90%">
       <el-card class="box-card">
         <div slot="header" class="clearfix">
           <span style="font-weight: bold">准入范围</span>
@@ -136,6 +141,7 @@
 
 <script>
   import api from '@/api/oilsupplier/goodsaptitude'
+  import XLSX from "xlsx";
   export default {
     name: 'compareTmpSupplier',
     created () {
@@ -185,7 +191,74 @@
           FullName: '',
           CheckUserName: '',
           CheckUserId: ''
-        }
+        },
+        SupplierId: '',
+        Id: '',
+        SupplierCertId: '',
+        SupplierTypeCode: '',
+        SupplierName: '',
+        searchFormSub: {
+          Code: '',
+          Name: ''
+        },
+        // 分页参数
+        sizeSub: 10,
+        currentPageSub: 1,
+        currentItemCountSub: 0,
+        certsubList: [],
+        showcolumn: [],
+        tableColumns: [
+
+          {
+            prop: 'InFlag',
+            label: '状态',
+            width: 120,
+            sort: true
+          },
+          {
+            prop: 'AccessCardNo',
+            label: '准入编码',
+            width: 150,
+            sort: true
+          },
+
+          {
+            prop: 'SupplierName',
+            label: '企业名称',
+            width: 120,
+            sort: true
+          },
+
+          {
+            prop: 'SupplierTypeCode',
+            label: '准入类别',
+            width: 150,
+            sort: true
+          },
+
+          {
+            prop: 'LegalPerson',
+            label: '法人代表',
+            width: 120,
+            sort: true
+          },
+
+          {
+            prop: 'RegCapital',
+            label: '注册资金',
+            width: 150,
+            sort: true
+          },
+
+          {
+            prop: 'Mobile',
+            label: '移动电话',
+            width: 120,
+            sort: true
+          }
+
+        ],
+        dynamicTableColumns: [],
       }
     },
 
@@ -247,7 +320,15 @@
           return val
         }
       },
+      stringChecked(val) {
+        if (val === '1') {
+          return '否'
+        }  else {
+          return '是'
+        }
+      },
       initDatas () {
+        this.loading = true
         // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
@@ -272,12 +353,13 @@
         api.getCompareTmpSupplier(params, this.$axios).then(res => {
           this.conList = res.data.items
           this.currentItemCount = res.data.currentItemCount
+          this.loading = false
         }).catch(err => {
           console.error(err)
         })
       },
       opencertsub (row) {
-        // this.certsubList = []
+        this.certsubList = []
         this.dialogVisibleCertsSub = true
         this.Id = row.Id
         this.SupplierCertId = row.CertId
@@ -305,7 +387,124 @@
             console.error(err)
           })
       },
+      // 分页方法
+      handleCurrentChangeSub (value) {
+        this.currentPageSub = value
+        this.getCertSub()
+      },
+      handleSizeChangeSub (value) {
+        this.sizeSub = value
+        this.currentPageSub = 1
+        this.getCertSub()
+      },
+      // 导出准入范围到pdf
+      toPdf () {
+        api.pdfexport(this.Id, this.SupplierTypeCode, this.$axios)
+          .then(res => {
+            // response
+            if (res.data.code === 0) {
+              // this.$message({
+              //   type: 'success'
+              //   message: res.data.message
+              // })
+              let docurl = res.data.item
+              let pdfurl
+              // 内网服务器专用
+              if (process.client && docurl.indexOf('upfile') === 0) {
+                const myDomain = window.location.host
+                // location.href = 'http://' + myDomain + '/' + docurl
+                pdfurl = 'http://' + process.env.LOCAL_IP + '/' + docurl
+                let requestParams = {
+                  pdfUrl: pdfurl,
+                  watermark: this.SupplierName
+                }
+                this.$axios.post('supplierdataentry/word-to-pdf-watermark', requestParams)
+                  .then(function (res) {
+                    window.open('http://' + myDomain + '/' + res.data)
+                  })
+              } else {
+                // location.href = 'http://' + docurl
+                pdfurl = 'http://' + docurl
+                let requestParams = {
+                  pdfUrl: pdfurl,
+                  watermark: this.SupplierName
+                }
+                this.$axios.post('supplierdataentry/word-to-pdf-watermark', requestParams)
+                  .then(function (res) {
+                    window.open('http://' + res.data)
+                  })
+              }
+            }
+          }).catch(err => {
+          console.error(err)
+        })
+      },
+      search () {
+        this.getCertSub()
+      },
+      delcertsubbyid (row) {
+        console.log(row)
+        this.$confirm('是否删除准入项?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          let params = {
+            Id: row.Id
+          }
+          console.log(params)
+          api.delTmpSupplierCertSub(params, this.$axios).then(res => {
+            console.log(res)
+            if (res.data.code === 0) {
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+              this.getCertSub()
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          })
+        })
+      },
+      exportExcel () {
+        console.log('111111导出')
+        this.loading = true
+        // 显示列
+        Object.assign(this.showcolumn, this.tableColumns)
+        Object.assign(this.showcolumn, this.dynamicTableColumns)
+        let showcolumn = this.tableColumns.concat(this.dynamicTableColumns)
+        let showcolumnarr = []
+        let showcolumnnamearr = []
 
+        for (var i = 0; i < showcolumn.length; i++) {
+          showcolumnarr.push(showcolumn[i].label)
+          showcolumnnamearr.push(showcolumn[i].prop.replace(/,/g, ','))
+        }
+        let params = {
+          _currentPage: this.currentPage,
+          _size: this.size,
+          Order: this.Column.Order,
+          Prop: this.Column.Prop,
+          Edition: '1',
+          showcolumnarr: showcolumnarr + '',
+          showcolumnnamearr: showcolumnnamearr + ''
+        }
+        api.exportExcelAll(params, this.$axios).then(res => {
+          this.loading = false
+          let docurl = res.data
+          // 内网服务器专用
+          if (process.client && docurl.indexOf('upfile') === 0) {
+            const myDomain = window.location.host
+            location.href = 'http://' + myDomain + '/' + docurl
+          } else {
+            location.href = 'http://' + docurl
+          }
+        })
+      },
     }
 
   }