浏览代码

publisher

nanshan 2 年之前
父节点
当前提交
a288221d8f

+ 1 - 1
src/api/message/message.js

@@ -13,7 +13,7 @@ export function searchMessage(params) {
   console.log(params);
   return request({
     url: 'system/news/queryNews',
-    params
+    params 
   })
 }
 

+ 1 - 1
src/api/notice/notice.js

@@ -10,7 +10,7 @@ export function getNotice(params) {
 export function addNotice(data) {
     return request({
         url: '/system/poNotice',
-        method: 'post',
+        method: 'post', 
         data
     })
 }

+ 24 - 0
src/api/publisher/publish.js

@@ -0,0 +1,24 @@
+import request from '@/utils/request'
+// 新增发行人
+export function addpublish(data){
+    return request({
+        url: '/system/issuer',
+        method: 'post',
+        data
+    })
+}
+// 获取列表
+export function publishList(params){
+    return request({
+        url: '/system/issuer/list',
+        params
+    })
+}
+
+// 根据发行人编号 搜寻信息
+export function searchPublish(id){
+    return request({
+        url: '/system/issuer/' +id,
+        
+      })
+}

+ 1 - 1
src/views/message/messageList.vue

@@ -95,7 +95,7 @@ export default {
           newsTimeStart: startTime,
           newsTimeEnd: endTime
         }
-        searchMessage(searchCon).then((res) => {
+        searchMessage(searchCon).then((res) => { 
           this.tableData = res.rows;
           this.total = res.total;
         })

+ 63 - 44
src/views/notice/addNotice.vue

@@ -2,23 +2,44 @@
   <div>
     <div class="body">
       <div class="s-body">
-        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
-          <el-form-item label="公告名称: " prop="name">
-            <el-input v-model="ruleForm.name"></el-input>
+        <el-form
+          :model="ruleForm"
+          :rules="rules"
+          ref="ruleForm"
+          label-width="100px"
+          class="demo-ruleForm"
+        >
+          <el-form-item label="公告名称: " prop="noticeTitle">
+            <el-input v-model="ruleForm.noticeTitle"></el-input>
           </el-form-item>
-          <el-form-item label="发布时间: " required>
-            <el-date-picker v-model="ruleForm.date" type="date" placeholder="选择日期">
+          <el-form-item label="发布时间: " required prop="createTime">
+            <el-date-picker
+              v-model="ruleForm.createTime"
+              type="datetime"
+              placeholder="选择日期时间"
+              value-format="yyyy-MM-dd HH:mm:ss"
+            >
             </el-date-picker>
-            <el-time-picker placeholder="选择时间" v-model="ruleForm.time"></el-time-picker>
           </el-form-item>
-          <el-form-item label="公告内容:  " prop="name">
-            <mavon-editor ref="md" v-model="notice.noticeContent" style="height: calc(100vh - 400px)" />
+          <el-form-item label="公告内容:  " prop="noticeTitle">
+            <mavon-editor
+              ref="md"
+              v-model="ruleForm.noticeContent"
+              style="height: calc(100vh - 400px)"
+            />
           </el-form-item>
           <el-form-item>
-            <el-button type="danger" @click="confirmGG" style="float: right">发布公告</el-button>
+            <el-button type="danger" @click="confirmGG" style="float: right"
+              >发布公告</el-button
+            >
           </el-form-item>
         </el-form>
-        <el-dialog title="提示" :visible.sync="dialogVisible" width="20%" :before-close="handleClose">
+        <el-dialog
+          title="提示"
+          :visible.sync="dialogVisible"
+          width="20%"
+          :before-close="handleClose"
+        >
           <span>确认发布公告吗?</span>
           <span slot="footer" class="dialog-footer">
             <el-button @click="cancel">取 消</el-button>
@@ -31,29 +52,34 @@
 </template>
 
 <script>
-import { addNotice } from '../../api/notice/notice'
+import { addNotice } from "../../api/notice/notice";
+
 export default {
   name: "Addnotice",
   data() {
     return {
       ruleForm: {
-        name: '',
-        date: '',
-        time: '',
+        noticeTitle: "",
+        // date: "",
+        // time: "",
+        createTime: "",
+        noticeContent: "",
       },
       notice: {
         noticeContent: "",
       },
       rules: {
-        name: [
-          { required: true, message: '请输入公告名称', trigger: 'blur' },
+        noticeTitle: [
+          { required: true, message: "请输入公告名称", trigger: "blur" },
         ],
-        date: [
-          { required: true, type: 'date', message: '请选择日期', trigger: 'change' }
+        createTime: [
+          {
+            required: true,
+            // type: "date",
+            message: "请选择日期",
+            trigger: "change",
+          },
         ],
-        time: [
-          { required: true, type: 'date', message: '请选择时间', trigger: 'change' }
-        ]
       },
       dialogVisible: false,
     };
@@ -63,40 +89,33 @@ export default {
     submitForm() {
       this.$refs.ruleForm.validate((valid) => {
         if (valid) {
-          let nyr = this.$formatDate(this.ruleForm.date, 'yyyy-MM-dd');
-          let sfm = this.$formatDate(this.ruleForm.time, 'hh:mm:ss');
-          let notice = {
-            noticeTitle: this.ruleForm.name,
-            noticeContent: this.notice.noticeContent,
-            createTime: nyr + ' ' + sfm
-          }
-          addNotice(notice).then(() => {
-            this.ruleForm.name = '';
-            this.ruleForm.date = '';
-            this.ruleForm.time = '';
-            this.notice.noticeContent = '';
-          })
+          addNotice(this.ruleForm).then(() => {
+            this.ruleForm.name = "";
+            this.ruleForm.createTime = "";
+            this.ruleForm.noticeContent = "";
+          });
           this.$notify({
-            title: '成功',
-            message: '创建消息成功',
-            type: 'success'
+            title: "成功",
+            message: "创建消息成功",
+            type: "success",
           });
           this.$router.push("./noticeList");
         } else {
           this.$notify({
-            title: '警告',
-            message: '请填写内容',
-            type: 'warning'
+            title: "警告",
+            message: "请填写内容",
+            type: "warning",
           });
         }
       });
-      this.dialogVisible = false
+
+      this.dialogVisible = false;
     },
     cancel() {
-      this.dialogVisible = false
+      this.dialogVisible = false;
     },
     confirmGG() {
-      this.dialogVisible = true
+      this.dialogVisible = true;
     },
     resetForm(formName) {
       this.$refs[formName].resetFields();
@@ -106,7 +125,7 @@ export default {
         .then((_) => {
           done();
         })
-        .catch((_) => { });
+        .catch((_) => {});
     },
   },
 };

+ 3 - 2
src/views/notice/noticeList.vue

@@ -50,7 +50,7 @@
           </el-table-column>
         </el-table>
         <el-pagination @current-change="handleCurrentChange" background layout="total, prev, pager, next" :total="total"
-          id="page">
+          id="page" :page-size="10">
         </el-pagination>
       </div>
     </el-container>
@@ -84,7 +84,8 @@ export default {
     // 获取公告
     getnotice() {
       getNotice(this.pageInfo).then((data) => {
-        this.tableData = data.rows;
+        console.log(data);
+        this.tableData = data.rows; 
         this.total = data.total;
       })
     },

+ 72 - 32
src/views/publishers/addPublisher.vue

@@ -3,33 +3,33 @@
     <div class="addfrom">
       <div class="addcenter">
         <el-form
-          ref="form"
+          ref="pubform"
           label-width="100px"
           :style="{ border: '1px soild #ccc' }"
-          :model="publishForm"
+          :model="pubform"
           :rules="rules"
         >
-          <el-form-item label="发行方名称" prop="pname">
-            <el-input></el-input>
+          <el-form-item label="发行方名称" prop="collectionTitle">
+            <el-input v-model="pubform.collectionTitle"></el-input>
           </el-form-item>
 
-          <el-form-item label="联系人" prop="aname">
-            <el-input></el-input>
+          <el-form-item label="联系人" prop="issuerName">
+            <el-input v-model="pubform.issuerName"></el-input>
           </el-form-item>
 
-          <el-form-item label="联系电话" prop="tel">
-            <el-input></el-input>
+          <el-form-item label="联系电话" prop="issuerPhone">
+            <el-input v-model="pubform.issuerPhone"></el-input>
           </el-form-item>
 
           <el-form-item label="电子邮箱" prop="email">
-            <el-input></el-input>
+            <el-input v-model="pubform.email"></el-input>
           </el-form-item>
 
-          <el-form-item label="详细地址" prop="address">
-            <el-input></el-input>
+          <el-form-item label="详细地址" prop="issuerAddress">
+            <el-input v-model="pubform.issuerAddress"></el-input>
           </el-form-item>
 
-          <el-form-item label="上传头像" prop="avater">
+          <el-form-item label="上传头像" prop="headPortrait">
             <el-upload
               :show-file-list="false"
               :style="{
@@ -38,26 +38,34 @@
                 width: '178px',
                 height: '178px',
               }"
+              v-model="pubform.headPortrait"
+              action="aaa"
             >
-              <img v-if="imageUrl" :src="imageUrl" id="avatar" />
-              <i
-                v-else
-                class="el-icon-plus avatar-uploader-icon"
-                :style="{
-                  width: '178px',
-                  height: '178px',
+              <i slot="default" class="el-icon-plus" 
+              :style="{
+                  width: '178px',                
                   lineHeight: '178px',
-                  textAlign: 'center',
-                }"
-              ></i>
+                  textAlign: 'center'}"></i>
+              <div slot="file" slot-scope="{ file }">
+                <img
+                  class="el-upload-list__item-thumbnail"
+                  :src="file.url"
+                  alt=""
+                />
+                
+              </div>
             </el-upload>
           </el-form-item>
 
-          <el-form-item label="备注" prop="info">
-            <el-input type="textarea" :rows="4"></el-input>
+          <el-form-item label="备注" prop="remark">
+            <el-input
+              type="textarea"
+              :rows="4"
+              v-model="pubform.remark"
+            ></el-input>
           </el-form-item>
           <el-form-item>
-            <el-button type="primary">提交</el-button>
+            <el-button type="primary" @click="submitpub">提交</el-button>
             <el-button>重置</el-button>
           </el-form-item>
         </el-form>
@@ -67,18 +75,19 @@
 </template>
 
 <script>
+import { addpublish } from "../../api/publisher/publish";
 export default {
   name: "addPublisher",
   data() {
     return {
-      publishForm: {
-        pname: "",
-        aname: "",
-        tel: "",
+      pubform: {
+        collectionTitle: "",
+        issuerName: "",
+        issuerPhone: "",
         email: "",
-        address: "",
-        avater: "",
-        info: "",
+        issuerAddress: "",
+        headPortrait: "",
+        remark: "",
       },
 
       rules: {
@@ -88,6 +97,37 @@ export default {
       },
     };
   },
+  methods: {
+    
+
+     submitpub() {
+      this.$refs.pubform.validate((valid) => {
+        if (valid) {
+          addpublish(this.pubform).then(() => {
+            this.pubform.collectionTitle = '';
+            this.pubform.issuerName = '';
+            this.pubform. email= "",
+            this.pubform.issuerPhone='',
+            this.pubform.issuerAddress='',
+            this.pubform.headPortrait= '',
+            this.pubform.remark=''
+          })
+          this.$notify({
+            title: '成功',
+            message: '创建消息成功',
+            type: 'success'
+          });
+          this.$router.push("./publisherList");
+        } else {
+          this.$notify({
+            title: '警告',
+            message: '请填写内容',
+            type: 'warning'
+          });
+        }
+      });
+    },
+  },
 };
 </script>
 

+ 74 - 38
src/views/publishers/publisherList.vue

@@ -8,13 +8,17 @@
         </el-col>
         <el-col :span="12" :style="{ textAlign: 'right' }">
           <el-button>重置</el-button>
-          <el-button type="primary">查询搜索</el-button>
+          <el-button type="primary" @click="search">查询搜索</el-button>
         </el-col>
       </el-row>
       <el-row :style="{ marginLeft: '32px' }">
         <el-form inline>
-          <el-form-item label="发行方名称: ">
-            <el-input placeholder="筛选发行方名称" clearable></el-input>
+          <el-form-item label="发行方编号: ">
+            <el-input
+              placeholder="请输入发行方编号"
+              clearable
+              v-model="issuerId"
+            ></el-input>
           </el-form-item>
         </el-form>
       </el-row>
@@ -27,58 +31,90 @@
         </el-col>
 
         <el-col :span="12" :style="{ textAlign: 'right' }">
-          <el-button plain>添加</el-button>
+          <el-button plain @click="addPublish">添加</el-button>
         </el-col>
       </el-row>
     </div>
     <div class="pubform">
-      <el-table :data="tabletab"
+      <el-table
+        :data="tableData"
         stripe
         border
         :style="{ borderRadius: '4px' }"
         :header-cell-style="{ 'text-align': 'center' }"
-        :cell-style="{'text-align':'center'}"
+        :cell-style="{ 'text-align': 'center' }"
       >
-        <el-table-column prop="pid" label="ID"> </el-table-column>
-        <el-table-column prop="avater" label="头像"> </el-table-column>
-        <el-table-column prop="pname" label="发行方名称"> </el-table-column>
+        <el-table-column prop="issuerId" label="ID"> </el-table-column>
+        <el-table-column prop="headPortraits" label="头像"> </el-table-column>
+        <el-table-column prop="collectionTitle" label="发行方名称">
+        </el-table-column>
         <el-table-column prop="opreation" label="操作">
-      
-            <el-button type="text">修改</el-button>
-         <el-button type="text">删除</el-button>
-         
-       </el-table-column>
+          <el-button type="text">修改</el-button>
+          <el-button type="text">删除</el-button>
+        </el-table-column>
       </el-table>
       <el-row :style="{ marginTop: '16px' }">
-      <el-col :span="24" :style="{ textAlign: 'right' }">
-        <el-pagination
-         background
-          :page-size="10"
-          layout="total, prev, pager, next"
-          :total="100"
-        >
-        </el-pagination>
-      </el-col>
-    </el-row>
+        <el-col :span="24" :style="{ textAlign: 'right' }">
+          <el-pagination
+            background
+            :page-size="10"
+            layout="total, prev, pager, next"
+            :total="total"
+            @current-change="handleCurrentChange"
+          >
+          </el-pagination>
+        </el-col>
+      </el-row>
     </div>
-    
   </div>
 </template>
+
 <script>
+import { publishList } from "@/api/publisher/publish";
+import { searchPublish } from "@/api/publisher/publish";
 export default {
-   name:"publisherList",
-   data(){
-      return {
-         tabletab:[
-            {
-               pid:'1',
-               pname:'哈尔滨某公司',
-               
-            }
-         ]
-      }
-   }
-}
+  name: "publisherList",
+  data() {
+    return {
+      pageInfo: {
+        // 分页信息
+        pageNum: 1,
+        pageSize: 10,
+      },
+      tableData: [], // 具体数据
+      total: 1, // 数据个数
+
+      issuerId:'' //发行商ID
+
+    };
+  },
+  created() {
+    this.getpublishList();
+  },
+  methods: {
+    search() {
+        if(this.issuerId){
+          searchPublish(issuerId).then((res)=>{
+            console.log(res);
+          })
+        }
+    },
+    addPublish() {
+      this.$router.push("./addPublisher");
+    },
+    getpublishList() {
+      publishList(this.pageInfo).then((data) => {
+        console.log(data);
+        this.tableData = data.rows;
+        this.total = data.total;
+      });
+    },
+    handleCurrentChange(newPage) {
+      this.pageInfo.pageNum = newPage;
+      this.getpublishList();
+    },
+  },
+};
 </script>
 <style>
 .search {