Explorar el Código

前端:系统内添加通知通告及资料下载页面

baichengfei hace 5 años
padre
commit
2d12311676

+ 25 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/annualListener.go

@@ -6,8 +6,10 @@ import (
 	"dashoo.cn/backend/api/business/oilsupplier/infochange"
 	"dashoo.cn/backend/api/business/oilsupplier/oilcostmanage"
 	"dashoo.cn/backend/api/business/oilsupplier/supplier"
+	"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
 	"dashoo.cn/backend/api/business/paymentinfo"
 	"encoding/json"
+	"log"
 	"strconv"
 	"strings"
 	"time"
@@ -332,6 +334,29 @@ func (this *OilAnnualListenerController) WorkflowEndAudit() {
 	//sourceId, _ := strconv.Atoi(annualId)
 	//supplierLogService.SaveSupplierLogForAnnual(annualEntity.SupplierId, sourceId) // 年审
 
+	// 实际更新变更项
+	log.Print("年审实际变更信息:", annualEntity)
+	var qualDetail []annualaudit.OilAnnualChangeDetail
+	whereDetail := "SupplierId = " + utils.ToStr(annualEntity.SupplierId) + " and ParentId=" + strconv.Itoa(annualEntity.Id)
+	srv.GetEntities(&qualDetail, whereDetail)
+	if len(qualDetail) > 0 {
+		for i := 0; i < len(qualDetail); i++ {
+			var supFileModel supplierfile.OilSupplierFile
+			supFileModel.FileName = qualDetail[i].FileName
+			supFileModel.FileUrl = qualDetail[i].FileUrl
+			supFileModel.EffectDate = qualDetail[i].EffectDate
+			srv.UpdateEntityBytbl(OilSupplierFileName, qualDetail[i].FileId, &supFileModel, []string{"FileName", "FileUrl", "EffectDate"})
+		}
+	}
+
+	var infoItems []infochange.OilAnnualChangeItem
+	where := "SupplierId = " + utils.ToStr(annualEntity.SupplierId) + " and InfoId = " + utils.ToStr(annualEntity.Id)
+	srv.GetEntities(&infoItems, where)
+	err := this.updateSupplierAfterInStorage(OilSupplierName, annualEntity.SupplierId, infoItems)
+	if err != nil {
+		log.Print("年审实际变更信息出错: ", err)
+	}
+
 	this.Data["json"] = 1
 	this.ServeJSON()
 }

+ 166 - 0
src/dashoo.cn/frontend_web/src/pages/system/resource/document.vue

@@ -0,0 +1,166 @@
+<template>
+  <el-card style="min-height: calc(100vh - 92px);">
+    <div slot="header" style="height: 20px;">
+      <span style="float: left;">
+        <i class="icon icon-table2"></i>
+      </span>
+      <el-breadcrumb class="heading" style="float: left; margin-left: 5px">
+        <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
+        <el-breadcrumb-item>资料下载</el-breadcrumb-item>
+      </el-breadcrumb>
+    </div>
+    <div style="background-color: white; width: 100%; margin: 0 auto; ">
+      <el-table :data="fileList"
+                stripe
+                highlight-current-row
+                size="mini">
+        <el-table-column prop="Name"
+                         align="center"
+                         label="文件资料">
+          <template slot-scope="scope">
+            <el-link :href="getDownloadFile(scope.row.FileURL)"
+                     target="_blank"
+                     type="primary">{{ scope.row.Name }}</el-link>
+          </template>
+        </el-table-column>
+        <el-table-column prop="CreateOn"
+                         label="发布时间"
+                         align="center"
+                         width="141">
+          <template slot-scope="scope">{{ jsTImeHandle(scope.row.CreateOn+'') }}</template>
+        </el-table-column>
+        <el-table-column width="80">
+          <template slot-scope="scope"><span style="font-size: 15px; color: #f13f40">{{strNew(scope.row.CreateOn+'') }}</span></template>
+        </el-table-column>
+      </el-table>
+    </div>
+  </el-card>
+</template>
+
+<script>
+  export default {
+    name: 'notice',
+    data () {
+      return {
+        fileList: [] // 文档列表
+      }
+    },
+    created () {
+      this.initFileListData()
+    },
+    methods: {
+      // 获取文件列表
+      initFileListData () {
+        let _this = this
+        // 传递列名
+        const params = {
+          colName: 'DocTab',
+          RangeType: '1,3'
+        }
+        _this.$axios
+          .get('/document/getdocumentnameandtime', { params })
+          .then(function (response) {
+            _this.fileList = response.data
+          })
+          .catch(function (error) {
+            console.log(error)
+          })
+      },
+      getDownloadFile (val) {
+        let urlArr = val.split('|')
+        let retUrl = urlArr[0]
+        // 内网服务器专用
+        if (process.client && retUrl.indexOf('/upfile') === 0) {
+          const myDomain = window.location.host
+          retUrl = myDomain + '/' + retUrl
+        }
+        return 'http://' + retUrl
+      },
+      // 格式化时间
+      jsTImeHandle (val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T08:00:00+08:00') {
+          return '----'
+        } else if (val === '5000-01-01T23:59:59+08:00') {
+          return '永久'
+        } else {
+          val = val.replace('T', ' ')
+          return val.substring(0, 10)
+        }
+      },
+      strNew (val) {
+        try {
+          let b = this.jsTImeHandle(val).split('-')
+          let date = new Date(b[0], b[1], b[2])
+          let newDate = new Date()
+          if ((newDate - date) / (1000 * 60 * 60 * 24) < 30) {
+            return '新'
+          } else {
+            return ''
+          }
+        } catch (e) {
+          return ''
+        }
+      }
+    }
+  }
+</script>
+
+<style lang="scss">
+  .time {
+    font-size: 13px;
+    color: #999;
+  }
+
+  .bottom {
+    margin-top: 13px;
+    line-height: 12px;
+  }
+
+  .button {
+    padding: 0;
+    float: right;
+  }
+
+  .image {
+    width: 100%;
+    display: block;
+  }
+
+  .clearfix:before,
+  .clearfix:after {
+    display: table;
+    content: "";
+  }
+
+  .clearfix:after {
+    clear: both
+  }
+
+  .el-pagination {
+    margin: 1rem 0 2rem;
+    text-align: right;
+  }
+
+  .plab {
+    font-size: 13px;
+    color: #999;
+  }
+
+  .triggerone {
+    font-size: 13px;
+    margin-left: 80px;
+  }
+
+  .plab {
+    font-size: 13px;
+    color: #999;
+  }
+
+  .docdelete .el-radio {
+    padding: 8px 15px 0 0;
+    margin-left: -2px;
+  }
+
+</style>

+ 166 - 0
src/dashoo.cn/frontend_web/src/pages/system/resource/notice.vue

@@ -0,0 +1,166 @@
+<template>
+  <el-card style="min-height: calc(100vh - 92px);">
+    <div slot="header" style="height: 20px;">
+      <span style="float: left;">
+        <i class="icon icon-table2"></i>
+      </span>
+      <el-breadcrumb class="heading" style="float: left; margin-left: 5px">
+        <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
+        <el-breadcrumb-item>通知通告</el-breadcrumb-item>
+      </el-breadcrumb>
+    </div>
+    <div style="background-color: white; width: 100%; margin: 0 auto; ">
+      <el-table :data="noticeList"
+                stripe
+                highlight-current-row
+                size="mini">
+        <el-table-column prop="Name"
+                         align="center"
+                         label="通知通告">
+          <template slot-scope="scope">
+            <el-link :href="getDownloadFile(scope.row.FileURL)"
+                     target="_blank"
+                     type="primary">{{ scope.row.Name }}</el-link>
+          </template>
+        </el-table-column>
+        <el-table-column prop="CreateOn"
+                         label="发布时间"
+                         align="center"
+                         width="141">
+          <template slot-scope="scope">{{ jsTImeHandle(scope.row.CreateOn+'') }}</template>
+        </el-table-column>
+        <el-table-column width="80">
+          <template slot-scope="scope"><span style="font-size: 15px; color: #f13f40">{{strNew(scope.row.CreateOn+'') }}</span></template>
+        </el-table-column>
+      </el-table>
+    </div>
+  </el-card>
+</template>
+
+<script>
+    export default {
+      name: 'notice',
+      data () {
+        return {
+          noticeList: [] // 通知列表
+        }
+      },
+      created () {
+        this.initNoticeListData()
+      },
+      methods: {
+        // 获取通知列表
+        initNoticeListData () {
+          let _this = this
+          // 传递列名
+          const params = {
+            colName: 'NoticeTab',
+            RangeType: '1,3'
+          }
+          _this.$axios
+            .get('/document/getdocumentnameandtime', { params })
+            .then(function (response) {
+              _this.noticeList = response.data
+            })
+            .catch(function (error) {
+              console.log(error)
+            })
+        },
+        getDownloadFile (val) {
+          let urlArr = val.split('|')
+          let retUrl = urlArr[0]
+          // 内网服务器专用
+          if (process.client && retUrl.indexOf('/upfile') === 0) {
+            const myDomain = window.location.host
+            retUrl = myDomain + '/' + retUrl
+          }
+          return 'http://' + retUrl
+        },
+        // 格式化时间
+        jsTImeHandle (val) {
+          if (val === '') {
+            return '----'
+          } else if (val === '0001-01-01T08:00:00+08:00') {
+            return '----'
+          } else if (val === '5000-01-01T23:59:59+08:00') {
+            return '永久'
+          } else {
+            val = val.replace('T', ' ')
+            return val.substring(0, 10)
+          }
+        },
+        strNew (val) {
+          try {
+            let b = this.jsTImeHandle(val).split('-')
+            let date = new Date(b[0], b[1], b[2])
+            let newDate = new Date()
+            if ((newDate - date) / (1000 * 60 * 60 * 24) < 30) {
+              return '新'
+            } else {
+              return ''
+            }
+          } catch (e) {
+            return ''
+          }
+        }
+      }
+    }
+</script>
+
+<style lang="scss">
+  .time {
+    font-size: 13px;
+    color: #999;
+  }
+
+  .bottom {
+    margin-top: 13px;
+    line-height: 12px;
+  }
+
+  .button {
+    padding: 0;
+    float: right;
+  }
+
+  .image {
+    width: 100%;
+    display: block;
+  }
+
+  .clearfix:before,
+  .clearfix:after {
+    display: table;
+    content: "";
+  }
+
+  .clearfix:after {
+    clear: both
+  }
+
+  .el-pagination {
+    margin: 1rem 0 2rem;
+    text-align: right;
+  }
+
+  .plab {
+    font-size: 13px;
+    color: #999;
+  }
+
+  .triggerone {
+    font-size: 13px;
+    margin-left: 80px;
+  }
+
+  .plab {
+    font-size: 13px;
+    color: #999;
+  }
+
+  .docdelete .el-radio {
+    padding: 8px 15px 0 0;
+    margin-left: -2px;
+  }
+
+</style>