ソースを参照

【新增】
1.采购管理-50%
2.文件下发
3.系统通知

莫绍宝 3 年 前
コミット
eba4c6f625

+ 9 - 0
src/api/common.js

@@ -25,4 +25,13 @@ export function getOssConfig(params) {
     method: 'get',
     params
   })
+}
+
+// 获取附件地址
+export function getFileUrl(params) {
+  return request({
+    url: '/common/file/get',
+    method: 'get',
+    params
+  })
 }

+ 46 - 0
src/api/issue.js

@@ -0,0 +1,46 @@
+import request from '@/utils/request'
+
+// 获取列表
+export function getList(params) {
+  return request({
+    url: '/com/list/list',
+    method: 'get',
+    params
+  })
+}
+
+// 获取下载列表
+export function getDownloadList(params) {
+  return request({
+    url: '/com/list/download/log',
+    method: 'get',
+    params
+  })
+}
+
+// 删除
+export function deleteData(params) {
+  return request({
+    url: '/com/list/delete',
+    method: 'post',
+    params
+  })
+}
+
+// 下载文件
+export function exportFile(params) {
+  return request({
+    url: '/com/list/download',
+    method: 'get',
+    params
+  })
+}
+
+// 导入
+export function handleImport(params) {
+  return request({
+    url: '/com/list/yonge',
+    method: 'post',
+    params
+  })
+}

+ 38 - 11
src/api/notice.js

@@ -1,7 +1,7 @@
 import request from '@/utils/request'
 
-// 获取消息列表
-export function getNoticeList(params) {
+// 获取列表
+export function getList(params) {
   return request({
     url: '/notice/list',
     method: 'get',
@@ -9,29 +9,56 @@ export function getNoticeList(params) {
   })
 }
 
-// 更改全部消息状态
-export function changeAllReadFlag(params) {
+// 获取详情
+export function getDetail(params) {
   return request({
-    url: '/notice/mark/read/all',
+    url: '/notice/detail',
+    method: 'get',
+    params
+  })
+}
+
+// 获取阅读记录
+export function getDownloadList(params) {
+  return request({
+    url: '/com/list/download/log',
+    method: 'get',
+    params
+  })
+}
+
+// 删除
+export function deleteData(params) {
+  return request({
+    url: '/notice/mark/del',
     method: 'post',
     params
   })
 }
 
-// 更改消息状态
-export function changeReadFlag(params) {
+// 新增
+export function addData(params) {
   return request({
-    url: '/notice/mark/read',
+    url: '/notice/add',
     method: 'post',
     data: params
   })
 }
 
-// 获取消息列表
-export function getNoticeListCount(params) {
+// 获取部门列表
+export function getDepartmentList(params) {
   return request({
-    url: '/notice/list/count',
+    url: '/admin/websit/tree',
     method: 'get',
     params
   })
 }
+
+// 查收
+export function confirmCheck(params) {
+  return request({
+    url: '/notice/mark/read',
+    method: 'post',
+    params
+  })
+}

+ 30 - 3
src/api/supply/purchase.js

@@ -1,10 +1,37 @@
 import request from '@/utils/request'
 
-// 获取列表
-export function getList(params) {
+// 获取采购单列表
+export function getPurchaseList(params) {
   return request({
-    url: '/admin/user/mch/list',
+    url: '/purchaseOrder/list',
     method: 'get',
     params
   })
 }
+
+// 获取采购单列表
+export function getPurchaseDetail(params) {
+  return request({
+    url: '/purchaseOrder/detail',
+    method: 'get',
+    params
+  })
+}
+
+// 获取采购入库单列表
+export function getEnterList(params) {
+  return request({
+    url: '/purchaseStockIn/list',
+    method: 'get',
+    params
+  })
+}
+
+// 获取采购入库单列表
+export function getEnterDetail(params) {
+  return request({
+    url: '/purchaseStockIn/detail',
+    method: 'get',
+    params
+  })
+}

+ 284 - 0
src/components/Common/image-upload.vue

@@ -0,0 +1,284 @@
+<template>
+	<div>
+		<el-upload
+			class="uploader"
+			:action="oss_url"
+			:data="dataObj"
+			:multiple="multiple"
+			name="file"
+			:accept="accept"
+			:show-file-list="false"
+			:on-success="uploadSuccess"
+			:before-upload="beforeUpload">
+		</el-upload>
+		<div class="images">
+			<div class="item" v-for="(item, index) in fileList" :key="index">
+				<div class="img" v-if="item.url" @mouseover="item.hover = true;" @mouseout="item.hover = false;">
+					<el-image ref="img" :src="imageURL + item.url" :preview-src-list="previewImages" v-if="checkFileType(item.url) == 'image'" style="width: 120px; height: 120px" fit="cover"></el-image>
+					<el-image ref="img" :src="imageURL + item.url" v-else style="width: 120px; height: 120px" fit="cover">
+						<div slot="error" class="image-slot">
+							<img class="file" src="@/assets/common/word.png" v-if="checkFileType(item.url) == 'word'">
+							<img class="file" src="@/assets/common/excel.png" v-if="checkFileType(item.url) == 'excel'">
+							<img class="file" src="@/assets/common/ppt.png" v-if="checkFileType(item.url) == 'ppt'">
+							<img class="file" src="@/assets/common/pdf.png" v-if="checkFileType(item.url) == 'pdf'">
+						</div>
+					</el-image>
+					<div class="mask" v-show="item.hover">
+						<i class="el-icon-zoom-in" @click="previewImage(item.url)" v-if="checkFileType(item.url) == 'image'"></i>
+						<i class="el-icon-upload2" @click="uploadImage(item.url)"></i>
+						<i class="el-icon-delete" @click="deleteImage(item.url)"></i>
+					</div>
+				</div>
+			</div>
+			<div class="add" @click="uploadImage()" v-if="multiple || (!multiple && fileList.length < 1)"><i class="el-icon-plus"></i></div>
+		</div>
+	</div>
+</template>
+<script>
+import { getOssConfig } from '@/api/common';
+import { findElem } from '@/utils/util'
+
+export default {
+	name: 'fileUpload',
+	props: {
+		// 接受上传的文件列表
+		fileList: Array,
+
+		// 接受上传的文件类型
+    fileType: {
+      type: Array,
+      default: () => ['image', 'word', 'excel', 'ppt', 'pdf']
+    },
+
+		// 是否支持多选文件
+		multiple: {
+			type: Boolean,
+			default: false,
+		}
+	},
+	data() {
+		return {
+      imageURL: this.$imageUrl,
+			oss_url: '',
+			dataObj: {},
+			uploadImageUrl: '',
+			waitUploadList: [],
+		};
+	},
+	created() {
+    getOssConfig().then(res => {
+      this.oss_url = res.data.host;
+    })
+	},
+	computed: {
+		isShowFileList: {
+			get: function() {
+				if (this.fileList.length > 0 && this.fileList[0].url) {
+					return true;
+				} else {
+					return false;
+				}
+			},
+			set: function(newValue) {}
+		},
+		accept() {
+			const imageList = ['.jpg', '.jpeg', '.png'];
+      const videoList = ['.mp4'];
+      const wordList = ['.doc', '.docx', '.dot', '.wps', '.wpt'];
+			const excelList = ['.xls', '.xlsx', '.xlt', '.et', '.ett'];
+			const pptList = ['.ppt', '.pptx', '.dps', '.dpt', '.pot', '.pps'];
+			const pdfList = ['.pdf'];
+
+      let whiteList = [];
+      this.fileType.includes('image') && (whiteList = whiteList.concat(imageList));
+      this.fileType.includes('video') && (whiteList = whiteList.concat(videoList));
+      this.fileType.includes('word') && (whiteList = whiteList.concat(wordList));
+      this.fileType.includes('excel') && (whiteList = whiteList.concat(excelList));
+      this.fileType.includes('ppt') && (whiteList = whiteList.concat(pptList));
+      this.fileType.includes('pdf') && (whiteList = whiteList.concat(pdfList));
+      
+			return whiteList.join(',');
+		},
+		previewImages() {
+      let fileList = [];
+      if(this.fileList && this.fileList.length > 0) {
+        this.fileList.forEach(item => {
+          if(this.checkFileType(item.url) == 'image') {
+            fileList.push(this.imageURL + item.url);
+          }
+        })
+      }
+      return fileList;
+    },
+	},
+	methods: {
+		getUUID() {
+			return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
+				return (c === 'x' ? (Math.random() * 16) | 0 : 'r&0x3' | '0x8').toString(16);
+			});
+		},
+		createName(name) {
+			const date = Date.now();
+			const uuid = this.getUUID();
+			const fileSuffix = name.substring(name.lastIndexOf(".") + 1);
+			return `${date}${uuid}.${fileSuffix}`;
+		},
+
+		// 检查文件类型
+    checkFileType(url) {
+      if(!url) return '';
+			const fileSuffix = url.substring(url.lastIndexOf(".") + 1);
+
+			if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
+				return 'image';
+			}else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
+				return 'word';
+			}else if(['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
+				return 'excel';
+			}else if(['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
+				return 'ppt';
+			}else if(['pdf'].includes(fileSuffix)) {
+				return 'pdf';
+			}else {
+        return '';
+      }
+		},
+
+		// 获取oss配置
+    async getOssConfig(fileName) {
+      const result = await new Promise((resolve, reject) => {
+				getOssConfig().then(res => {
+					const fileKey = this.createName(fileName);
+					res.data.name = fileName;
+					res.data.key = res.data.dir + fileKey;
+					resolve(res.data);
+				}).catch(res => {
+          resolve({});
+        })
+      })
+      return result;
+    },
+
+		// 预览图片
+    previewImage(url) {
+      let index = findElem(this.fileList, 'url', url);
+      this.$refs.img[index].showViewer = true;
+    },
+
+    // 删除图片
+    deleteImage(url) {
+      let index = findElem(this.fileList, 'url', url);
+      this.fileList.splice(index, 1);
+    },
+
+		// 点击上传
+		uploadImage(url) {
+      this.uploadImageUrl = url;
+      document.querySelector('.uploader input').click();
+    },
+
+		// 上传文件之前
+		async beforeUpload(file) {
+			const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+			this.dataObj = await this.getOssConfig(file.name);
+			this.waitUploadList.push(this.dataObj);
+		},
+
+		// 文件上传成功
+		uploadSuccess(res, file) {
+			const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+			if(this.uploadImageUrl) {
+        let index = findElem(this.fileList, 'url', this.uploadImageUrl);
+        this.$set(this.fileList, index, {
+					name: this.dataObj.name,
+					url: this.dataObj.key,
+					hover: false
+				});
+				this.waitUploadList = [];
+      }else {
+				let index = findElem(this.waitUploadList, 'name', file.name);
+				this.fileList.push({
+					name: this.waitUploadList[index].name,
+					url: this.waitUploadList[index].key,
+					hover: false
+				});
+        this.waitUploadList.splice(index, 1);
+      }
+			this.showFileList = true;
+			loading.close();
+		},
+	}
+};
+</script>
+
+<style scoped lang="scss">
+	.images {
+		display: flex;
+		flex-wrap: wrap;
+		.item {
+			margin-right: 20px;
+			.img {
+				width: 120px;
+				height: 120px;
+				border-radius: 5px;
+				overflow: hidden;
+				position: relative;
+				border: 1px dashed #eaeaea;
+				display: flex;
+				.el-image {
+					display: block;
+				}
+				.file {
+					width: 120px;
+					height: 120px;
+					display: block;
+					padding: 30px;
+				}
+				.mask {
+					position: absolute;
+					left: 0;
+					top: 0;
+					width: 120px;
+					height: 120px;
+					background: rgba($color: #000000, $alpha: 0.3);
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					i {
+						font-size: 20px;
+						color: #ffffff;
+						cursor: pointer;
+						margin: 0 8px;
+					}
+				}
+			}
+		}
+		.add {
+			width: 120px;
+			height: 120px;
+			border: 1px dashed #eaeaea;
+			border-radius: 5px;
+			cursor: pointer;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			i {
+				font-size: 30px;
+				color: #999;
+			}
+		}
+	}
+	.uploader {
+    height: 0;
+  }
+</style>

+ 1 - 1
src/layout/components/Sidebar/SidebarItem.vue

@@ -1,7 +1,7 @@
 <template>
   <div v-if="!item.hidden">
     <!-- <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren) && !item.alwaysShow"> -->
-    <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren || (onlyOneChild.children && onlyOneChild.children.length < 1 && (onlyOneChild.name == 'wxcustomer_index' || onlyOneChild.name == 'settlement_index' || onlyOneChild.name == 'freight_index' || onlyOneChild.name == 'storage_index' || onlyOneChild.name == 'notice_index' || onlyOneChild.name == 'dashboard'))) && !item.alwaysShow">
+    <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren || (onlyOneChild.children && onlyOneChild.children.length < 1 && (onlyOneChild.name == 'issue_index' || onlyOneChild.name == 'notice_index' || onlyOneChild.name == 'dashboard'))) && !item.alwaysShow">
       <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
         <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
           <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />

+ 17 - 3
src/permission.js

@@ -154,13 +154,27 @@ function buildRootRoute(route) {
       }
     )
   }
-  if (code == 'msg') {
+  if (code == 'issue') {
+    let children = route.children;
+    route.children = [];
+    route.children.push(
+      {
+        'code': "issue_index",
+        'moduleName': "文件下发",
+        'type': 2,
+        'url': '/index',
+        'children': children
+      }
+    )
+    item.alwaysShow = false;
+  }
+  if (code == 'notice') {
     let children = route.children;
     route.children = [];
     route.children.push(
       {
         'code': "notice_index",
-        'moduleName': "消息列表",
+        'moduleName': "系统通知",
         'type': 2,
         'url': '/index',
         'children': children
@@ -169,7 +183,7 @@ function buildRootRoute(route) {
     item.alwaysShow = false;
   }
   item.children = []
-  if ((route.hasOwnProperty('children') && type === 1) || code == 'wxcustomer' || code == 'settle_manage' || code == 'delivery_manage' || code == 'stockpile_manage' || code == 'msg' || code == 'index') {
+  if ((route.hasOwnProperty('children') && type === 1) || code == 'issue' || code == 'notice' || code == 'index') {
     for (var child of route.children) {
       item.children.push(buildRoute(child, url))
     }

+ 319 - 0
src/views/issue/index.vue

@@ -0,0 +1,319 @@
+<template>
+  <div class="app-container">
+    <!-- 筛选条件 -->
+    <div class="screen-container">
+      <el-form ref="screenForm" :model="screenForm" label-width="60px" size="small" label-position="left">
+        <el-row :gutter="20">
+          <el-col :xs="24" :sm="18" :lg="18">
+            <el-form-item label="标题" prop="title">
+              <el-input v-model="screenForm.title" placeholder="请输入标题"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="6" :lg="6" class="tr">
+            <el-form-item label="">
+              <el-button size="small" @click="resetScreenForm">清空</el-button>
+              <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+
+    <div class="mymain-container">
+      <div class="btn-group clearfix">
+        <div class="fl">
+          <el-button class="fl" size="small" type="primary" icon="el-icon-plus" @click="clickImport()">新增</el-button>
+          <div class="tips fl">导入模板第一行必须为空白行、第一列必须为公司编号(S9219801)</div>
+        </div>
+      </div>
+      <div class="table">
+        <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column align="center" label="操作" fixed="right" width="160">
+            <template slot-scope="scope">
+              <el-button type="text" @click="openDetail(scope.row.id)" v-if="checkBtnRole('edit')">详情</el-button>
+              <el-button type="text" @click="handleExport(scope.row)" v-if="checkBtnRole('edit')">下载</el-button>
+              <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="deleteData(scope.row.id)">
+                <el-button slot="reference" type="text">删除</el-button>
+              </el-popconfirm>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="标题" prop="title" min-width="140" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="操作人" prop="operatorUserName" min-width="140" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{scope.row.operatorNickName}}({{scope.row.operatorUserName}})
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="remark" label="备注" min-width="140" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="创建时间" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
+          
+        </el-table>
+      </div>
+      
+      <div class="pagination clearfix">
+        <div class="fr">
+          <el-pagination
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="listTotal">
+          </el-pagination>
+        </div>
+      </div>
+    </div>
+
+    <!-- 新增 -->
+    <el-dialog title="新增" :visible.sync="importFormDialog" :show-close="false" width="40%" :close-on-click-modal="false">
+      <el-form ref="importForm" label-position="left" label-width="80px">
+        <el-form-item label="标题" prop="title">
+          <el-input v-model="importForm.title" placeholder="请输入标题"></el-input>
+        </el-form-item>
+        <el-form-item label="上传文件" prop="fileUrl">
+          <FileUpload :fileList="fileList" :fileType="['excel']" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input type="textarea" v-model="importForm.remark" placeholder="请输入备注"></el-input>
+        </el-form-item>
+      </el-form>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancelImportForm">取 消</el-button>
+        <el-button type="primary" @click="submitImportForm">确 定</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 详情 -->
+    <el-dialog title="详情" :visible.sync="detailDialog" :show-close="false" width="70%" :close-on-click-modal="false">
+      <div class="table" style="margin: 10px 0 20px;">
+        <el-table 
+          v-loading="detailTable_listLoading" 
+          :data="detailTable_dataList" 
+          element-loading-text="Loading" 
+          tooltip-effect="dark" 
+          style="width: 100%" 
+          max-height="270">
+          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+          <el-table-column align="center" prop="title" label="标题" min-width="140" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" prop="websitNumber" label="网点名称" min-width="140" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{scope.row.websitName}}({{scope.row.websitNumber}})
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="remark" label="备注" min-width="140" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" prop="createTime" label="下载时间" min-width="160"></el-table-column>
+        </el-table>
+      </div>
+      <div class="pagination clearfix">
+        <div class="fr">
+          <el-pagination
+            @current-change="detailTableCurrentChange"
+            :current-page="detailTable_currentPage"
+            :page-size="detailTable_pageSize"
+            background
+            layout="prev, pager, next"
+            :total="detailTable_listTotal">
+          </el-pagination>
+        </div>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="detailDialog = false">关 闭</el-button>
+      </div>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import { getToken } from '@/utils/auth'
+import { getList, getDownloadList, deleteData, exportFile, handleImport } from '@/api/issue'
+import FileUpload from '@/components/Common/file-upload.vue'
+
+export default {
+  components: {
+    FileUpload
+  },
+  data() {
+    return {
+      imageURL: this.$imageUrl,
+      dataList: null, // 列表数据
+      listLoading: true, // 列表加载loading
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      screenForm: { // 筛选表单数据
+        title: '',
+      },
+      importForm: {
+        title: '',
+        remark: '',
+      },
+      importFormDialog: false,
+      fileList: [],
+
+      detailDialog: false, // 详情 - 弹窗
+      detailTable_dataList: null, // 详情 - 列表数据
+      detailTable_listLoading: true, // 详情 - 列表加载loading
+      detailTable_currentPage: 1, // 详情 - 当前页码
+      detailTable_pageSize: 10, // 详情 - 每页数量
+      detailTable_listTotal: 0, // 详情 - 列表总数
+    }
+  },
+  computed: {
+    
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    // 查询按钮权限
+    checkBtnRole(value) {
+      return true;
+      let btnRole = this.$route.meta.roles;
+      if(!btnRole) {return true}
+      let index = btnRole.indexOf(value);
+      return index >= 0 ? true : false;
+    },
+
+    // 获取列表
+    getList() {
+      this.listLoading = true;
+      let params = {
+        pageNo: this.currentPage,
+        pageSize: this.pageSize,
+        title: this.screenForm.title,
+      }
+      getList(params).then(res => {
+        this.listLoading = false;
+        this.dataList = res.data ? res.data.records : [];
+        this.listTotal = res.data ? res.data.total : 0;
+      })
+    },
+
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.getList();
+    },
+
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields();
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 操作 - 删除
+    deleteData(id) {
+      deleteData({id}).then(res => {
+        this.getList();
+        this.$successMsg();
+      })
+    },
+
+    // 详情 - 获取列表
+    getDownloadList() {
+      getDownloadList({
+        pageNo: this.detailTable_currentPage,
+        pageSize: this.detailTable_pageSize,
+        id: this.detailId
+      }).then(res => {
+        this.detailTable_dataList = res.data.records;
+        this.detailTable_listTotal = res.data.total;
+        this.detailTable_listLoading = false;
+      })
+    },
+
+    // 详情 - 打开弹窗
+    openDetail(id) {
+      this.detailId = id;
+      this.detailDialog = true;
+      this.detailTable_currentPage = 1;
+      this.getDownloadList();
+    },
+
+    // 详情 - 更改列表当前页
+    detailTableCurrentChange(val) {
+      this.detailTable_currentPage = val;
+      this.getDownloadList();
+    },
+
+    // 点击导入
+    clickImport() {
+      this.importFormDialog = true;
+    },
+
+    // 取消 导入
+    cancelImportForm(){
+      this.importFormDialog = false;
+      this.fileList = [];
+      this.importForm.title = '';
+      this.importForm.remark = '';
+    },
+
+    // 导入
+    async submitImportForm() {
+      if(!this.importForm.title) {
+        return this.$errorMsg('请填写标题');
+      }
+      if(this.fileList.length <= 0) {
+        return this.$errorMsg('请上传文件');
+      }
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      const formData = {
+        file: this.fileList[0].url,
+        title: this.importForm.title,
+        remark: this.importForm.remark
+      };
+      handleImport(formData).then(res => {
+        this.fileList = [];
+        this.getList();
+        this.importFormDialog = false;
+      }).catch(res => {
+        this.$errorMsg(res.message);
+      }).finally(res => {
+        loading.close();
+      })
+    },
+
+    // 下载
+    handleExport(item) {
+      exportFile({id: item.id}).then(res => {
+        if(res.data) {
+          window.open(this.imageURL + res.data);
+        }
+      })
+    },
+
+  }
+}
+</script>
+
+<style scoped>
+.tips {
+  font-size: 14px;
+  color: red;
+  line-height: 32px;
+  margin-left: 10px;
+}
+</style>

+ 484 - 107
src/views/notice/index.vue

@@ -2,21 +2,37 @@
   <div class="app-container">
     <!-- 筛选条件 -->
     <div class="screen-container">
-      <div class="top clearfix">
-        <div class="title fl">条件筛选</div>
-      </div>
-      <el-form ref="screenForm" :model="screenForm" label-width="50px" size="small" label-position="left">
+      <el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="标志" prop="readFlag">
-              <el-select v-model="screenForm.readFlag" placeholder="全部标志" size="small">
-                <el-option label="全部" value=""></el-option>
-                <el-option label="未读" value="false"></el-option>
-                <el-option label="已读" value="true"></el-option>
-              </el-select>
+            <el-form-item label="通知类型" prop="type">
+              <el-input v-model="screenForm.type" placeholder="请输入通知类型"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="文件编码" prop="code">
+              <el-input v-model="screenForm.code" placeholder="请输入文件编码"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="文件标题" prop="title">
+              <el-input v-model="screenForm.title" placeholder="请输入文件标题"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="发布日期" prop="date">
+              <el-date-picker
+                v-model="screenForm.date"
+                type="datetimerange"
+                range-separator="至"
+                style="width: 100%;"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期">
+              </el-date-picker>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :lg="18" class="tr">
+          <el-col :xs="24" :sm="24" :lg="24" class="tr">
             <el-form-item label="">
               <el-button size="small" @click="resetScreenForm">清空</el-button>
               <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
@@ -29,39 +45,33 @@
     <div class="mymain-container">
       <div class="btn-group clearfix">
         <div class="fl">
-          <el-button size="small" @click="changeReadFlag('ALL')">全部标为已读</el-button>
-          <el-button size="small" @click="changeReadFlag('SEL')">标为已读消息</el-button>
+          <el-button class="fl" size="small" type="primary" icon="el-icon-plus" @click="openMainForm()">新增</el-button>
+          <el-button class="fl" size="small" type="danger" icon="el-icon-minus" @click="batchDelete()">批量删除</el-button>
         </div>
       </div>
-
       <div class="table">
-        <el-table ref="noticeTable" v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-          <el-table-column align="center" type="selection" width="40" :selectable="checkSelRow"></el-table-column>
-          <el-table-column align="center" label="消息编号" prop="noticeId" min-width="180"></el-table-column>
-          <el-table-column align="center" label="订单编号" prop="objId" min-width="180"></el-table-column>
-          <el-table-column align="center" label="标题" prop="title" min-width="80"></el-table-column>
-          <el-table-column align="center" label="消息类型" prop="type">
-            <template slot-scope="scope">
-              {{ scope.row.type | NOTICE_CURRENT_TYPE_FILTER }}
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="消息内容" prop="content" min-width="200"></el-table-column>
-          <el-table-column align="center" label="状态" class-name="status-col">
+        <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe @selection-change="handleSelectionChange">
+          <el-table-column align="center" label="操作" fixed="right" width="120">
             <template slot-scope="scope">
-              <el-tag :type="scope.row.readFlag ? 'success' : 'danger'">{{ scope.row.readFlag ? '已读' : '未读'}}</el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="创建时间" prop="createTime" min-width="160"></el-table-column>
-          <el-table-column align="center" label="操作" fixed="right" width="100">
-            <template slot-scope="scope">
-              <template v-if="checkBtnRole('status')">
-                <el-button type="text" v-if="scope.row.type === 1" @click="goOrderDetail(scope.row)">查看记录</el-button>
-              </template>
+              <el-button type="text" @click="openDetail(scope.row.id)" v-if="checkBtnRole('edit')">浏览</el-button>
+              <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="deleteData(scope.row.noticeId)">
+                <el-button slot="reference" type="text">删除</el-button>
+              </el-popconfirm>
             </template>
           </el-table-column>
+          <el-table-column align="center" type="selection" width="55"></el-table-column>
+          <el-table-column align="center" label="通知类型" prop="type" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="文件编码" prop="code" min-width="140" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="文件标题" prop="title" min-width="140" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="接收人" prop="adminNickName" min-width="140" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="发送人" prop="issueNickName" min-width="140" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="发送人编号" prop="issueUserId" min-width="140" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="发布日期" prop="issueTime" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="创建时间" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
+          <!-- <el-table-column align="center" label="已确认" prop="readFlag" min-width="140" show-overflow-tooltip></el-table-column> -->
         </el-table>
       </div>
-
+      
       <div class="pagination clearfix">
         <div class="fr">
           <el-pagination
@@ -76,116 +86,483 @@
         </div>
       </div>
     </div>
+
+    <!-- 新增 -->
+    <el-dialog title="新增" :visible.sync="mainFormDialog" :show-close="false" width="60%" :close-on-click-modal="false">
+      <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-position="right" label-width="90px">
+        <el-row :gutter="20">
+          <el-col :xs="24" :sm="12" :lg="12">
+            <el-form-item label="通知类型" prop="type">
+              <el-input v-model="mainForm.type" placeholder="请输入通知类型"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="12">
+            <el-form-item label="文件编号" prop="code">
+              <el-input v-model="mainForm.code" placeholder="请输入文件编号"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="12">
+            <el-form-item label="文件标题" prop="title">
+              <el-input v-model="mainForm.title" placeholder="请输入文件标题"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="12">
+            <el-form-item label="来源" prop="source">
+              <el-input v-model="mainForm.source" placeholder="请输入来源"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="24">
+            <el-form-item label="发布日期" prop="date">
+              <el-date-picker
+                v-model="mainForm.date"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                style="width: 100%"
+                placeholder="选择发布日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="24">
+            <el-form-item label="发布内容" prop="content">
+              <el-input type="textarea" v-model="mainForm.content" placeholder="请输入发布内容" :autosize="{ minRows: 4, maxRows: 8}"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="24">
+            <el-form-item label="接收人" prop="department">
+              <el-tree
+                :data="departmentList"
+                show-checkbox
+                node-key="adminWebsitId"
+                ref="tree"
+                highlight-current
+                :props="props">
+              </el-tree>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="上传附件" prop="fileUrl">
+          <ImageUpload :fileList="fileList" :multiple="true" />
+        </el-form-item>
+        
+      </el-form>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="closeMainForm">取 消</el-button>
+        <el-button type="primary" @click="submitMainForm">确 定</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 已阅记录 -->
+    <el-dialog title="已阅记录" :visible.sync="recordDialog" :show-close="false" width="70%" :close-on-click-modal="false">
+      <div class="table" style="margin: 10px 0 20px;">
+        <el-table 
+          v-loading="detailTable_listLoading" 
+          :data="detailTable_dataList" 
+          element-loading-text="Loading" 
+          tooltip-effect="dark" 
+          style="width: 100%" 
+          max-height="270">
+          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+          <el-table-column align="center" prop="title" label="标题" min-width="140" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" prop="websitNumber" label="网点名称" min-width="140" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{scope.row.websitName}}({{scope.row.websitNumber}})
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="remark" label="备注" min-width="140" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" prop="createTime" label="下载时间" min-width="160"></el-table-column>
+        </el-table>
+      </div>
+      <div class="pagination clearfix">
+        <div class="fr">
+          <el-pagination
+            @current-change="detailTableCurrentChange"
+            :current-page="detailTable_currentPage"
+            :page-size="detailTable_pageSize"
+            background
+            layout="prev, pager, next"
+            :total="detailTable_listTotal">
+          </el-pagination>
+        </div>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="recordDialog = false">关 闭</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 详情 -->
+    <el-dialog title="浏览" :visible.sync="detailDialog" width="60%" :close-on-click-modal="false">
+      <div class="detail-container">
+        <div class="title">{{detailData.title}}</div>
+        <div class="text">发布人:{{detailData.issueNickName}}<el-divider direction="vertical"></el-divider>发布时间:{{detailData.issueTime}}</div>
+        <el-divider></el-divider>
+        <div class="content">{{detailData.content}}</div>
+        <el-divider v-if="detailData.files && detailData.files.length > 0"></el-divider>
+        <div class="file" v-if="detailData.files && detailData.files.length > 0">
+          <div>附件:</div>
+          <div class="file-list">
+            <div v-for="(item, index) in detailData.files" :key="index" class="item">
+              <el-image v-if="checkFileType(item.url) == 'image'" class="img" :src="imageURL + item.url" :preview-src-list="[imageURL + item.url]"></el-image>
+              <div v-else class="box2" @click="openLink(item.url)">
+                <img src="@/assets/common/word.png" v-if="checkFileType(item.url) == 'word'" />
+                <img src="@/assets/common/excel.png" v-if="checkFileType(item.url) == 'excel'" />
+                <img src="@/assets/common/ppt.png" v-if="checkFileType(item.url) == 'ppt'" />
+                <img src="@/assets/common/pdf.png" v-if="checkFileType(item.url) == 'pdf'" />
+                <div class="name ellipsis-3">{{ item.name }}</div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="confirmCheck(detailData.id)" v-if="!detailData.readFlag">确认接收</el-button>
+        <el-button @click="detailDialog = false" v-if="detailData.readFlag">关 闭</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
 <script>
-import { getNoticeList, changeAllReadFlag, changeReadFlag } from "@/api/notice";
+import { getList, getDownloadList, deleteData, addData, getDepartmentList, getDetail, confirmCheck } from '@/api/notice'
+import { getFileUrl } from '@/api/common';
+import ImageUpload from '@/components/Common/image-upload.vue'
 
 export default {
-  name: "index",
+  components: {
+    ImageUpload
+  },
   data() {
     return {
+      imageURL: this.$imageUrl,
       dataList: null, // 列表数据
       listLoading: true, // 列表加载loading
-      screenForm: { // 筛选表单数据
-        readFlag: '' //
-      },
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
-      listTotal: 0 // 列表总数
+      listTotal: 0, // 列表总数
+      screenForm: { // 筛选表单数据
+        type: '',
+        code: '',
+        title: '',
+        date: '',
+      },
+      mainForm: {
+        type: '',
+        code: '',
+        title: '',
+        source: '',
+        department: '',
+        date: '',
+        content: '',
+      },
+      mainFormRules: {
+        type: [
+          { required: true, message: '请输入通知类型', trigger: 'blur' }
+        ],
+        title: [
+          { required: true, message: '请输入文件标题', trigger: 'blur' }
+        ],
+        date: [
+          { required: true, message: '请选择发布日期', trigger: 'change' }
+        ],
+        content: [
+          { required: true, message: '请输入发布内容', trigger: 'blur' }
+        ],
+      },
+      mainFormDialog: false,
+      fileList: [],
+
+      departmentList: [],
+      props: {
+        multiple: true,
+        value: 'adminWebsitId',
+        label: 'name',
+        children: 'children',
+      },
+
+      detailDialog: false, // 详情 - 弹窗
+      detailData: {},
+
+      multipleSelection: [],
+
+      recordDialog: false, // 已阅记录 - 弹窗
+      detailTable_dataList: null, // 已阅记录 - 列表数据
+      detailTable_listLoading: true, // 已阅记录 - 列表加载loading
+      detailTable_currentPage: 1, // 已阅记录 - 当前页码
+      detailTable_pageSize: 10, // 已阅记录 - 每页数量
+      detailTable_listTotal: 0, // 已阅记录 - 列表总数
     }
   },
+  computed: {
+    
+  },
   created() {
-    this.getList()
+    this.getList();
   },
   methods: {
     // 查询按钮权限
     checkBtnRole(value) {
-      // let btnRole = this.$route.meta.roles;
-      // if(!btnRole) {return true}
-      // let index = btnRole.indexOf(value);
-      // return index >= 0 ? true : false;
-      return true
+      return true;
+      let btnRole = this.$route.meta.roles;
+      if(!btnRole) {return true}
+      let index = btnRole.indexOf(value);
+      return index >= 0 ? true : false;
+    },
+
+    // 获取部门列表
+    getTree() {
+      getDepartmentList().then(res => {
+        this.departmentList = res.data;
+      })
     },
+
+    // 获取列表
     getList() {
+      this.listLoading = true;
       let params = {
-        readFlag: this.screenForm.readFlag,
         pageNum: this.currentPage,
-        pageSize: this.pageSize
+        pageSize: this.pageSize,
+        type: this.screenForm.type,
+        code: this.screenForm.code,
+        title: this.screenForm.title,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
       }
-
-      getNoticeList(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
+      getList(params).then(res => {
+        this.listLoading = false;
+        this.dataList = res.data ? res.data.records : [];
+        this.listTotal = res.data ? res.data.total : 0;
       })
     },
-    // 检查行能否选中
-    checkSelRow(row) {
-      return !row.readFlag
+
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.getList();
     },
+
     // 提交筛选表单
     submitScreenForm() {
-      this.currentPage = 1
-      this.getList()
+      this.currentPage = 1;
+      this.getList();
     },
+
     // 重置筛选表单
     resetScreenForm() {
-      this.$refs.screenForm.resetFields()
-      this.currentPage = 1
-      this.getList()
+      this.$refs.screenForm.resetFields();
+      this.currentPage = 1;
+      this.getList();
     },
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val
-      this.currentPage = 1
-      this.getList()
+
+    // 表格选择
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
     },
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getList()
-    },
-    changeReadFlag(type) {
-      if (type === 'ALL') {
-        changeAllReadFlag().then(() => {
-          this.getList()
-          this.$successMsg('全部标为已读成功')
+
+    // 批量删除
+    batchDelete() {
+      if(this.multipleSelection.length < 1) {
+        return this.$errorMsg('请选择信息');
+      }
+      this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let ids = [];
+        this.multipleSelection.forEach(item => {
+          ids.push(item.noticeId);
+        });
+        deleteData({noticeIds: ids.join(',')}).then(res => {
+          this.$successMsg('删除成功');
+          this.getList();
         })
-      } else {
-        if (this.$refs['noticeTable'].selection.length > 0) {
-          let noticeIds = []
-          this.$refs['noticeTable'].selection.forEach(row => {
-            noticeIds.push(row.noticeId)
-          })
-          changeReadFlag(noticeIds).then(() => {
-            this.getList()
-            this.$successMsg('标为已读成功')
+      }).catch(() => {});
+    },
+
+    // 操作 - 删除
+    deleteData(id) {
+      deleteData({noticeIds: id}).then(res => {
+        this.$successMsg('删除成功');
+        this.getList();
+      })
+    },
+
+    // 详情 - 打开弹窗
+    openDetail(id) {
+      getDetail({id}).then(res => {
+        this.detailData = res.data;
+        this.detailDialog = true;
+      })
+    },
+
+    // 检查文件类型
+    checkFileType(url) {
+      if(!url) return '';
+			const fileSuffix = url.substring(url.lastIndexOf(".") + 1);
+
+			if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
+				return 'image';
+			}else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
+				return 'word';
+			}else if(['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
+				return 'excel';
+			}else if(['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
+				return 'ppt';
+			}else if(['pdf'].includes(fileSuffix)) {
+				return 'pdf';
+			}else {
+        return '';
+      }
+		},
+
+    // 打开链接
+    openLink(url) {
+      getFileUrl({key: url}).then(res => {
+        window.open(res.data);
+      })
+    },
+
+    // 确认查收
+    confirmCheck(id) {
+      confirmCheck({noticeIds: id}).then(res => {
+        this.$successMsg('查收成功');
+        this.detailDialog = false;
+        this.getList();
+      })
+    },
+
+    // 已阅记录 - 获取列表
+    getDownloadList() {
+      getDownloadList({
+        pageNo: this.detailTable_currentPage,
+        pageSize: this.detailTable_pageSize,
+        id: this.recordId
+      }).then(res => {
+        this.detailTable_dataList = res.data.records;
+        this.detailTable_listTotal = res.data.total;
+        this.detailTable_listLoading = false;
+      })
+    },
+
+    // 已阅记录 - 打开弹窗
+    openRecord(id) {
+      this.recordId = id;
+      this.recordDialog = true;
+      this.detailTable_currentPage = 1;
+      this.getDownloadList();
+    },
+
+    // 已阅记录 - 更改列表当前页
+    detailTableCurrentChange(val) {
+      this.detailTable_currentPage = val;
+      this.getDownloadList();
+    },
+
+    // 打开 表单
+    openMainForm() {
+      this.getTree();
+      this.mainFormDialog = true;
+    },
+
+    // 关闭 表单
+    closeMainForm(){
+      this.mainFormDialog = false;
+      this.fileList = [];
+      this.$refs.mainForm.resetFields();
+    },
+
+    // 提交 表单
+    async submitMainForm() {
+      this.$refs.mainForm.validate((valid) => {
+        if (valid) {
+          let params = {
+            type: this.mainForm.type,
+            code: this.mainForm.code,
+            title: this.mainForm.title,
+            source: this.mainForm.source,
+            issueTime: this.mainForm.date,
+            content: this.mainForm.content,
+            adminWebsitIds: this.$refs.tree.getCheckedKeys(),
+            files: this.fileList,
+          };
+          addData(params).then(res => {
+            this.closeMainForm();
+            this.getList();
+            this.mainFormDialog = false;
           })
-        } else {
-          this.$errorMsg("请先选择消息!")
         }
-      }
+      })
     },
-    goOrderDetail(row) {
-      let noticeIds = []
-      noticeIds.push(row.noticeId)
-      changeReadFlag(noticeIds)
-      let {href} = this.$router.resolve({path: `/order/detail?orderId=${row.objId}`});
-      window.open(href, '_blank');
-      // this.$router.push({
-      //   path: '/order/detail',
-      //   query: {
-      //     orderId: row.objId,
-      //     type: 'notice'
-      //   }
-      // })
-    }
+
   }
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped lang="scss">
+  .detail-container {
+    .title {
+      font-size: 16px;
+      color: #333333;
+      font-weight: 600;
+    }
+    .text {
+      font-size: 14px;
+      color: #999999;
+      margin-top: 10px;
+    }
+    .content {
+      font-size: 14px;
+      color: #666666;
+      line-height: 20px;
+    }
+    .file {
+      .file-list {
+        display: flex;
+        .item {
+          margin-top: 10px;
+          margin-right: 10px;
+        }
+      }
+      .img {
+        width: 80px;
+        height: 80px;
+        display: block;
+        border: 1px solid #e4e7ed;
+      }
+      .box2 {
+        flex: 1;
+        display: flex;
+        padding: 10px;
+        align-items: center;
+        border: 1px solid #e4e7ed;
+        width: 240px;
+        height: 80px;
+        cursor: pointer;
+        img {
+          width: 40px;
+          height: 40px;
+          display: block;
+        }
+        .name {
+          flex: 1;
+          color: #222;
+          font-weight: 600;
+          margin-left: 10px;
+        }
+      }
+    }
+  }
+  .el-divider--horizontal {
+    margin: 16px 0;
+  }
+</style>

+ 53 - 60
src/views/supply/purchase/components/enter_detail.vue

@@ -4,83 +4,63 @@
 
     <div id="printData">
       <div class="main-title">
-        <div class="title">入库单</div>
+        <div class="title">采购入库单</div>
       </div>
 
-      <div class="diy-form-1">
-        <el-row :gutter="20">
+      <div class="diy-table-1">
+        <el-row>
           <el-col :span="8" class="item">
-            <div class="label">入库单号</div>
-            <div class="value">212212121212121</div>
+            <div class="label">入库单号</div>
+            <div class="value">{{detailData.billNo}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">入库日期</div>
-            <div class="value">2022-12-22</div>
+            <div class="label">入库日期</div>
+            <div class="value">{{detailData.fdate | dateToDayFilter}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">仓库</div>
-            <div class="value">212212121212121</div>
+            <div class="label">仓库</div>
+            <div class="value">{{detailData.stockId}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">供货单位</div>
-            <div class="value">212212121212121</div>
+            <div class="label">供货单位</div>
+            <div class="value">{{detailData.supplyName}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">审核日期</div>
-            <div class="value">2022-12-22</div>
+            <div class="label">审核日期</div>
+            <div class="value">{{detailData.approveDate}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">备注</div>
-            <div class="value">212212121212121</div>
+            <div class="label">备注</div>
+            <div class="value">{{detailData.abcdRemarks}}</div>
           </el-col>
         </el-row>
       </div>
 
-      <div class="diy-table-2">
-        <div class="head">
-          <el-row :gutter="20">
-            <el-col :span="2">序号</el-col>
-            <el-col :span="4">产品编号</el-col>
-            <el-col :span="8">产品名称</el-col>
-            <el-col :span="2">规格型号</el-col>
-            <el-col :span="2">内机编码</el-col>
-            <el-col :span="2">外机编码</el-col>
-            <el-col :span="2">单位</el-col>
-            <el-col :span="2">数量</el-col>
-          </el-row>
-        </div>
-        <div class="body">
-          <el-row v-for="(item, index) in goodsList" :key="item.goodsId" :gutter="20">
-            <el-col :span="2">{{ index + 1 }}</el-col>
-            <el-col :span="4">{{ item.goodsId || 0 }}</el-col>
-            <el-col :span="8">{{ item.goodsName || 0 }}</el-col>
-            <el-col :span="2">{{ item.salesUnit || 0 }}</el-col>
-            <el-col :span="2">{{ item.price || 0 }}</el-col>
-            <el-col :span="2">{{ item.saleQty || 0 }}</el-col>
-            <el-col :span="2">{{ item.saleValue || 0 }}</el-col>
-            <el-col :span="2">{{ item.saleValue || 0 }}</el-col>
-          </el-row>
-        </div>
-        <div class="foot">
-          <el-row :gutter="20">
-            <el-col :span="24">合计</el-col>
-          </el-row>
-        </div>
+      <div class="table" style="margin-top: 20px; margin-bottom: 20px">
+        <el-table :data="detailData.kingDeePurchaseStockInItems" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+          <el-table-column align="center" label="存货编号" prop="materialNumber" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="存货名称" prop="materialName" min-width="180" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="规格型号" prop="model" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="主计量单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="原币含税单价" prop="taxPrice" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="原币单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="原币税额" prop="entryTaxAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="原币价税合计" prop="billAllAmount" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="税率" prop="entryTaxRate" min-width="100" show-overflow-tooltip></el-table-column>
+        </el-table>
       </div>
 
-      <div class="diy-form-1">
-        <el-row :gutter="20">
+      <div class="diy-table-1">
+        <el-row>
           <el-col :span="8" class="item">
-            <div class="label">制单人</div>
-            <div class="value">张三</div>
+            <div class="label">制单人</div>
+            <div class="value">{{detailData.createBy}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">审核人:</div>
-            <div class="value">李四</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">现存量:</div>
-            <div class="value">200</div>
+            <div class="label">审核人</div>
+            <div class="value">{{detailData.approverName}}</div>
           </el-col>
         </el-row>
       </div>
@@ -101,7 +81,7 @@
 
 <script>
 import print from 'vue-print-nb'
-import { getList } from "@/api/supply/purchase";
+import { getEnterDetail } from "@/api/supply/purchase";
 
 export default {
   name: 'EnterDetail',
@@ -110,14 +90,20 @@ export default {
   directives: {
     print
   },
+  filters: {
+    businessTypeFilter(val) {
+      const MAP = {
+        CG: '标准采购'
+      }
+      return MAP[val]
+    }
+  },
   data() {
     return {
       printObj: {
         id: 'printData'
       },
-      goodsList: [{
-        goodsId: 1,
-      }]
+      detailData: {},
     }
   },
 
@@ -134,7 +120,7 @@ export default {
   },
 
   created() {
-
+    this.getDetail();
   },
 
   methods: {
@@ -142,6 +128,13 @@ export default {
     goBack() {
       this.$emit('backListFormDetail');
     },
+
+    // 获取详情
+    getDetail() {
+      getEnterDetail({id: this.listItem.id}).then(res => {
+        this.detailData = res.data;
+      })
+    },
   }
 }
 </script>

+ 66 - 81
src/views/supply/purchase/components/purchase_detail.vue

@@ -4,115 +4,87 @@
 
     <div id="printData">
       <div class="main-title">
-        <div class="title">入库单</div>
+        <div class="title">采购订单</div>
       </div>
 
-      <div class="diy-form-1">
-        <el-row :gutter="20">
+      <div class="diy-table-1">
+        <el-row>
           <el-col :span="8" class="item">
-            <div class="label">业务类型</div>
-            <div class="value">212212121212121</div>
+            <div class="label">业务类型</div>
+            <div class="value">{{detailData.businessType}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">订单日期:</div>
-            <div class="value">2022-12-22</div>
+            <div class="label">采购日期</div>
+            <div class="value">{{detailData.fdate | dateToDayFilter}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">订单编号</div>
-            <div class="value">212212121212121</div>
+            <div class="label">订单编号</div>
+            <div class="value">{{detailData.billNo}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">采购类型</div>
-            <div class="value">212212121212121</div>
+            <div class="label">采购类型</div>
+            <div class="value">{{detailData.businessType | businessTypeFilter}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">供应商</div>
-            <div class="value">2022-12-22</div>
+            <div class="label">供应商</div>
+            <div class="value">{{detailData.assignSupplierId}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">部门</div>
-            <div class="value">212212121212121</div>
+            <div class="label">部门</div>
+            <div class="value">{{detailData.purchaseDeptId}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">业务员</div>
-            <div class="value">212212121212121</div>
+            <div class="label">业务员</div>
+            <div class="value">{{detailData.purchaserId}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">税率</div>
-            <div class="value">212212121212121</div>
+            <div class="label">税率</div>
+            <div class="value">{{detailData.billTaxAmount}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">付款条件</div>
-            <div class="value">212212121212121</div>
+            <div class="label">付款条件</div>
+            <div class="value">{{detailData.payConditionId}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">币种</div>
-            <div class="value">212212121212121</div>
+            <div class="label">币种</div>
+            <div class="value">{{detailData.settleCurr}}</div>
           </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">任务日期:</div>
-            <div class="value">212212121212121</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">备注:</div>
-            <div class="value">212212121212121</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">登录编号:</div>
-            <div class="value">212212121212121</div>
+          <el-col :span="16" class="item">
+            <div class="label">备注</div>
+            <div class="value">{{detailData.abcdRemarks}}</div>
           </el-col>
         </el-row>
       </div>
 
-      <div class="diy-table-2">
-        <div class="head">
-          <el-row :gutter="20">
-            <el-col :span="2">序号</el-col>
-            <el-col :span="4">产品编号</el-col>
-            <el-col :span="8">产品名称</el-col>
-            <el-col :span="2">规格型号</el-col>
-            <el-col :span="2">内机编码</el-col>
-            <el-col :span="2">外机编码</el-col>
-            <el-col :span="2">单位</el-col>
-            <el-col :span="2">数量</el-col>
-          </el-row>
-        </div>
-        <div class="body">
-          <el-row v-for="(item, index) in goodsList" :key="item.goodsId" :gutter="20">
-            <el-col :span="2">{{ index + 1 }}</el-col>
-            <el-col :span="4">{{ item.goodsId || 0 }}</el-col>
-            <el-col :span="8">{{ item.goodsName || 0 }}</el-col>
-            <el-col :span="2">{{ item.salesUnit || 0 }}</el-col>
-            <el-col :span="2">{{ item.price || 0 }}</el-col>
-            <el-col :span="2">{{ item.saleQty || 0 }}</el-col>
-            <el-col :span="2">{{ item.saleValue || 0 }}</el-col>
-            <el-col :span="2">{{ item.saleValue || 0 }}</el-col>
-          </el-row>
-        </div>
-        <div class="foot">
-          <el-row :gutter="20">
-            <el-col :span="24">合计</el-col>
-          </el-row>
-        </div>
+      <div class="table" style="margin-top: 20px; margin-bottom: 20px">
+        <el-table :data="detailData.kingDeePurchaseOrderItems" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+          <el-table-column align="center" label="存货编号" prop="materialNumber" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="存货名称" prop="materialName" min-width="180" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="规格型号" prop="model" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="主计量单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="原币含税单价" prop="taxPrice" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="原币单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="原币税额" prop="entryTaxAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="原币价税合计" prop="billAllAmount" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="采购单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
+        </el-table>
       </div>
 
-      <div class="diy-form-1">
-        <el-row :gutter="20">
-          <el-col :span="8" class="item">
-            <div class="label">制单人:</div>
-            <div class="value">张三</div>
-          </el-col>
+      <div class="diy-table-1">
+        <el-row>
           <el-col :span="8" class="item">
-            <div class="label">审核人:</div>
-            <div class="value">李四</div>
+            <div class="label">制单人</div>
+            <div class="value">{{detailData.createBy}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">变更人:</div>
-            <div class="value">李四</div>
+            <div class="label">审核人</div>
+            <div class="value">{{detailData.approverName}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">现存量:</div>
-            <div class="value">200</div>
+            <div class="label">变更人</div>
+            <div class="value">{{detailData.changerName}}</div>
           </el-col>
         </el-row>
       </div>
@@ -133,7 +105,7 @@
 
 <script>
 import print from 'vue-print-nb'
-import { getList } from "@/api/supply/purchase";
+import { getPurchaseDetail } from "@/api/supply/purchase";
 
 export default {
   name: 'PurchaseDetail',
@@ -142,14 +114,20 @@ export default {
   directives: {
     print
   },
+  filters: {
+    businessTypeFilter(val) {
+      const MAP = {
+        CG: '标准采购'
+      }
+      return MAP[val]
+    }
+  },
   data() {
     return {
       printObj: {
         id: 'printData'
       },
-      goodsList: [{
-        goodsId: 1,
-      }]
+      detailData: {},
     }
   },
 
@@ -166,7 +144,7 @@ export default {
   },
 
   created() {
-
+    this.getDetail();
   },
 
   methods: {
@@ -174,6 +152,13 @@ export default {
     goBack() {
       this.$emit('backListFormDetail');
     },
+
+    // 获取详情
+    getDetail() {
+      getPurchaseDetail({id: this.listItem.id}).then(res => {
+        this.detailData = res.data;
+      })
+    },
   }
 }
 </script>

+ 43 - 60
src/views/supply/purchase/enter_list.vue

@@ -38,18 +38,8 @@
                 <el-input v-model="screenForm.company" placeholder="请输入供货单位"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="厂对应单号" prop="factoryNum">
-                <el-input v-model="screenForm.factoryNum" placeholder="请输入厂对应单号"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="厂产品代码" prop="factoryCode">
-                <el-input v-model="screenForm.factoryCode" placeholder="请输入厂产品代码"></el-input>
-              </el-form-item>
-            </el-col>
             
-            <el-col :xs="24" :sm="12" :lg="6" class="tr">
+            <el-col :xs="24" :sm="12" :lg="18" class="tr">
               <el-form-item label="">
                 <el-button size="small" @click="resetScreenForm">清空</el-button>
                 <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
@@ -67,30 +57,31 @@
         </div>
         <div class="table">
           <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-            <el-table-column align="center" label="入库单号" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="入库日期" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="仓库" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="供货单位" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核日期" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="备注" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="厂对应单号" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="厂产品代码" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="存货编码" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="存货名称" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="规格型号" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="主计量" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="数量" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="原币含税单价" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="原币金额" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="原币税额" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="原币价税合计" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="税率" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="制单人" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核人" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="现存量" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="操作" width="120" fixed="right">
+            <el-table-column align="center" label="入库单号" prop="billNo" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="入库日期" prop="fdate" min-width="120" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{scope.row.fdate | dateToDayFilter}}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="仓库" prop="stockId" min-width="140" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="供货单位" prop="supplyName" min-width="200" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审核日期" prop="approveDate" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="备注" prop="abcdRemarks" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="存货编码" prop="materialNumber" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="存货名称" prop="materialName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="规格型号" prop="uom" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="主计量" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="数量" prop="auxUnitQty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="原币含税单价" prop="taxPrice" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="原币金额" prop="amount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="原币税额" prop="entryTaxAmount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="原币价税合计" prop="allAmount" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="税率" prop="entryTaxRate" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审核人" prop="approverId" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="操作" width="100" fixed="right">
               <template slot-scope="scope">
-                <el-button type="text" @click="toDetail('detail', scope.row)">详情</el-button>
+                <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -117,8 +108,7 @@
 </template>
 
 <script>
-import { COMMON_SELECT } from '@/utils/select_data'
-import { getList } from "@/api/supply/purchase";
+import { getEnterList } from "@/api/supply/purchase";
 import EnterDetail from "@/views/supply/purchase/components/enter_detail";
 
 export default {
@@ -134,19 +124,12 @@ export default {
       listLoading: false, // 列表加载loading
       screenForm: { // 筛选表单数据
         orderNum: '',
-        jxsName: '',
         chName: '',
-        model: '',
+        chNum: '',
         date: '',
-        jxsNum: '',
-        status: '',
+        company: '',
       },
-      select_status: [ // 筛选字段 - 状态
-        { label: '正常', value: true },
-        { label: '冻结', value: false }
-      ],
 
-      jumpType: '',
       queryItem: {},
     }
   },
@@ -154,15 +137,16 @@ export default {
   computed: {
     exParams() {
       return {
-        userName: this.screenForm.account,
-        nickName: this.screenForm.nickName,
-        linkPhone: this.screenForm.phone,
-        email: this.screenForm.email,
-        status: this.screenForm.status,
+        billNo: this.screenForm.orderNum,
+        materialName: this.screenForm.chName,
+        materialNumber: this.screenForm.chNum,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        supplyName: this.screenForm.company,
       }
     },
     isShowDetail() {
-      return this.queryItem.hasOwnProperty('adminUserId') && this.jumpType == 'detail';
+      return this.queryItem.hasOwnProperty('id');
     },
   },
 
@@ -187,13 +171,14 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        userName: this.screenForm.account,
-        nickName: this.screenForm.nickName,
-        linkPhone: this.screenForm.phone,
-        email: this.screenForm.email,
-        status: this.screenForm.status,
+        billNo: this.screenForm.orderNum,
+        materialName: this.screenForm.chName,
+        materialNumber: this.screenForm.chNum,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        supplyName: this.screenForm.company,
       };
-      getList(params).then((res) => {
+      getEnterList(params).then((res) => {
         this.dataList = res.data.records;
         this.listTotal = res.data.total;
         this.listLoading = false;
@@ -227,13 +212,11 @@ export default {
     },
 
     // 进入详情
-    toDetail(type, item) {
-      this.jumpType = type;
+    toDetail(item) {
       this.queryItem = item;
     },
 
     backList() {
-      this.jumpType = '';
       this.queryItem = {};
     },
   }

+ 61 - 73
src/views/supply/purchase/purchase_list.vue

@@ -3,25 +3,20 @@
     <div v-show="!isShowDetail">
       <!-- 筛选条件 -->
       <div class="screen-container">
-        <el-form ref="screenForm" :model="screenForm" label-width="90px" size="small" label-position="left">
+        <el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
           <el-row :gutter="20">
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="业务类型" prop="orderNum">
-                <el-input v-model="screenForm.orderNum" placeholder="请输入业务类型"></el-input>
+              <el-form-item label="业务类型" prop="business">
+                <el-input v-model="screenForm.business" placeholder="请输入业务类型"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="采购类型" prop="chName">
-                <el-input v-model="screenForm.chName" placeholder="请输入采购类型"></el-input>
+              <el-form-item label="供应商" prop="supplier">
+                <el-input v-model="screenForm.supplier" placeholder="请输入供应商"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="供应商" prop="chName">
-                <el-input v-model="screenForm.chName" placeholder="请输入供应商"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="订单日期" prop="date">
+              <el-form-item label="采购日期" prop="date">
                 <el-date-picker
                   v-model="screenForm.date"
                   type="datetimerange"
@@ -34,7 +29,7 @@
               </el-form-item>
             </el-col>
             
-            <el-col :xs="24" :sm="24" :lg="24" class="tr">
+            <el-col :xs="24" :sm="12" :lg="6" class="tr">
               <el-form-item label="">
                 <el-button size="small" @click="resetScreenForm">清空</el-button>
                 <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
@@ -52,40 +47,39 @@
         </div>
         <div class="table">
           <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-            <el-table-column align="center" label="业务类型" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单日期" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单编号" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="采购类型" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="供应商" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="部门" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="业务员" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="税率" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="付款条件" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="币种" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="任务日期" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="备注" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="登录编号" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="厂对应单号" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="存货编码" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="存货名称" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="规格型号" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="主计量" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="数量" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="原币含税单价" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="原币单价" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="原币税额" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="原币价税合计" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="采购单价" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="计划到货日期" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="行关闭人" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="预留" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="制单人" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核人" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="变更人" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="现存量" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="操作" width="120" fixed="right">
+            <el-table-column align="center" label="业务类型" prop="businessType" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{scope.row.businessType | businessTypeFilter}}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="采购日期" prop="fdate" min-width="120" show-overflow-tooltip>
               <template slot-scope="scope">
-                <el-button type="text" @click="toDetail('detail', scope.row)">详情</el-button>
+                {{scope.row.fdate | dateToDayFilter}}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="订单编号" prop="billNo" min-width="200" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="供应商" prop="assignSupplierId" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="部门" prop="purchaseDeptId" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="业务员" prop="purchaserId" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="付款条件" prop="payConditionId" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="币种" prop="settleCurr" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="备注" prop="abcdRemarks" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="存货编码" prop="materialNumber" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="存货名称" prop="materialName" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="规格型号" prop="model" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="主计量" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="原币含税单价" prop="taxPrice" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="原币单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="原币税额" prop="entryTaxAmount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="原币价税合计" prop="billAllAmount" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="采购单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审核人" prop="approverName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="变更人" prop="changerName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="操作" width="100" fixed="right">
+              <template slot-scope="scope">
+                <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -112,14 +106,21 @@
 </template>
 
 <script>
-import { COMMON_SELECT } from '@/utils/select_data'
-import { getList } from "@/api/supply/purchase";
+import { getPurchaseList } from "@/api/supply/purchase";
 import PurchaseDetail from "@/views/supply/purchase/components/purchase_detail";
 
 export default {
   components: {
     PurchaseDetail,
   },
+  filters: {
+    businessTypeFilter(val) {
+      const MAP = {
+        CG: '标准采购'
+      }
+      return MAP[val]
+    }
+  },
   data() {
     return {
       currentPage: 1, // 当前页码
@@ -128,20 +129,11 @@ export default {
       dataList: null, // 列表数据
       listLoading: false, // 列表加载loading
       screenForm: { // 筛选表单数据
-        orderNum: '',
-        jxsName: '',
-        chName: '',
-        model: '',
+        business: '',
+        supplier: '',
         date: '',
-        jxsNum: '',
-        status: '',
       },
-      select_status: [ // 筛选字段 - 状态
-        { label: '正常', value: true },
-        { label: '冻结', value: false }
-      ],
 
-      jumpType: '',
       queryItem: {},
     }
   },
@@ -149,15 +141,14 @@ export default {
   computed: {
     exParams() {
       return {
-        userName: this.screenForm.account,
-        nickName: this.screenForm.nickName,
-        linkPhone: this.screenForm.phone,
-        email: this.screenForm.email,
-        status: this.screenForm.status,
+        businessType: this.screenForm.business,
+        assignSupplierId: this.screenForm.supplier,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
       }
     },
     isShowDetail() {
-      return this.queryItem.hasOwnProperty('adminUserId') && this.jumpType == 'detail';
+      return this.queryItem.hasOwnProperty('id');
     },
   },
 
@@ -182,13 +173,12 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        userName: this.screenForm.account,
-        nickName: this.screenForm.nickName,
-        linkPhone: this.screenForm.phone,
-        email: this.screenForm.email,
-        status: this.screenForm.status,
+        businessType: this.screenForm.business,
+        assignSupplierId: this.screenForm.supplier,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
       };
-      getList(params).then((res) => {
+      getPurchaseList(params).then((res) => {
         this.dataList = res.data.records;
         this.listTotal = res.data.total;
         this.listLoading = false;
@@ -222,13 +212,11 @@ export default {
     },
 
     // 进入详情
-    toDetail(type, item) {
-      this.jumpType = type;
+    toDetail(item) {
       this.queryItem = item;
     },
 
     backList() {
-      this.jumpType = '';
       this.queryItem = {};
     },
   }