|
@@ -1,18 +1,179 @@
|
|
|
<!--采购申请-->
|
|
|
<template>
|
|
|
<div class="app-container purchaseRequisition">
|
|
|
- <div class="purchaseRequisition-page">
|
|
|
+ <div class="purchaseRequisition-page" v-if="pageType == 1">
|
|
|
+ <el-form :model="queryParamsData" class="form-box" ref="queryForm" :inline="true">
|
|
|
+ <el-form-item label="关键字" prop="searchValue">
|
|
|
+ <el-input
|
|
|
+ maxLength="30"
|
|
|
+ v-model="queryParamsData.searchValue"
|
|
|
+ placeholder="编号/姓名/化学品名/实验室"
|
|
|
+ clearable
|
|
|
+ style="width: 200px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="状态" prop="deptId">
|
|
|
+ <el-select v-model="queryParamsData.deptId" clearable placeholder="请选择状态" style="width: 140px">
|
|
|
+ <el-option label="审批中" value="0"></el-option>
|
|
|
+ <el-option label="已通过" value="1"></el-option>
|
|
|
+ <el-option label="已拒绝" value="2"></el-option>
|
|
|
+ <el-option label="已撤销" value="3"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="申请时间" prop="terminalStatus">
|
|
|
+ <el-date-picker
|
|
|
+ :clearable="false"
|
|
|
+ v-model="dateRangeOne"
|
|
|
+ size="small"
|
|
|
+ style="width: 220px"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="-"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="完成时间" prop="terminalStatus">
|
|
|
+ <el-date-picker
|
|
|
+ :clearable="false"
|
|
|
+ v-model="dateRangeTwo"
|
|
|
+ size="small"
|
|
|
+ style="width: 220px"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="-"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <p class="inquire-button-one" @click="handleQuery" style="margin-right:10px;">查询</p>
|
|
|
+ <p class="reset-button-one" @click="resetQuery">重置</p>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item style="float: right;">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <p class="inquire-button-one"
|
|
|
+ style="width:100px;"
|
|
|
+ @click="pageToggle(3)"
|
|
|
+ >申购</p>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item style="float: right;">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <p class="add-button-one-90"
|
|
|
+ style="width:100px;"
|
|
|
+ @click="pageToggle(2)"
|
|
|
+ >草稿箱</p>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item style="float: right;">
|
|
|
+ <el-dropdown @command="exportButton">
|
|
|
+ <div class="form-dropdown-box">
|
|
|
+ <img src="@/assets/ZDimages/personnelManagement/icon_jzgxx_sc.png">
|
|
|
+ <p>导出</p>
|
|
|
+ <img src="@/assets/ZDimages/personnelManagement/icon_jzggl_xljt.png">
|
|
|
+ </div>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item style="border-bottom:1px solid #E0E0E0;margin:0 10px;color:#333;" :command="{command:1}">导出全部数据</el-dropdown-item>
|
|
|
+ <el-dropdown-item style="margin:0 10px;color:#666;" :command="{command:2}">导出选中数据</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-table border :data="tableList" ref="multipleTable" @selection-change="handleSelectionChange" :row-key="getRowKeys">
|
|
|
+ <el-table-column type="selection" width="50" align="center" :reserve-selection="true"/>
|
|
|
+ <el-table-column label="申购编号" align="center" prop="hardwareNum"/>
|
|
|
+ <el-table-column label="申购人" align="center" prop="deptName" width="250"/>
|
|
|
+ <el-table-column label="实验室" align="center" prop="posi" width="250" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="申购信息" align="center" prop="status" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="申请时间" align="center" prop="createTime" width="250"/>
|
|
|
+ <el-table-column label="完成时间" align="center" prop="createBy" width="150"/>
|
|
|
+ <el-table-column label="状态" align="center" prop="createBy" width="150"/>
|
|
|
+ <el-table-column label="审批人" align="center" prop="status" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" width="440" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="button-box">
|
|
|
+ <p class="table-min-button" style="margin-right:10px;">编辑</p>
|
|
|
+ <p class="table-min-button" style="margin-right:10px;">编辑</p>
|
|
|
+ <p class="table-min-button" style="margin-right:10px;">撤销</p>
|
|
|
+ <p class="table-min-button" style="margin-right:10px;">审批</p>
|
|
|
+ <p class="table-min-button" style="margin-right:10px;">审批单</p>
|
|
|
+ <p class="table-min-button">删除</p>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div style="display: flex;height:32px;margin-top:15px;">
|
|
|
+ <!--<p style="flex:4;"></p>-->
|
|
|
+ <p style="text-align: left;margin:0;line-height:32px;margin-right:20px;font-size:14px;color:#999;">
|
|
|
+ <i class="el-icon-warning" style="color:#0183FA;"></i>
|
|
|
+ 已选择 {{selectedNum}} 项
|
|
|
+ </p>
|
|
|
+ <div style="flex:5;">
|
|
|
+ <pagination :page-sizes="[20, 30, 40, 50]"
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ style="margin:0;"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <draft-Page :draftPagePropsData="draftPagePropsData" v-if="pageType == 2"></draft-Page>
|
|
|
+ <list-Page :listPagePropsData="listPagePropsData" v-if="pageType == 3"></list-Page>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import draftPage from "./draftPage.vue"
|
|
|
+ import listPage from "./listPage.vue"
|
|
|
export default {
|
|
|
name: "index",
|
|
|
+ components: {
|
|
|
+ draftPage,
|
|
|
+ listPage,
|
|
|
+ },
|
|
|
data(){
|
|
|
return{
|
|
|
-
|
|
|
+ // 传参数据
|
|
|
+ draftPagePropsData:{},
|
|
|
+ listPagePropsData:{},
|
|
|
+ //页面状态
|
|
|
+ pageType:1,
|
|
|
+ // 申请时间
|
|
|
+ dateRangeOne:[],
|
|
|
+ // 完成时间
|
|
|
+ dateRangeTwo:[],
|
|
|
+ // 搜索数据
|
|
|
+ queryParamsData:{
|
|
|
+ pageNum:1,
|
|
|
+ pageSize:20,
|
|
|
+ },
|
|
|
+ // 搜索实际发送数据
|
|
|
+ queryParams:{
|
|
|
+ pageNum:1,
|
|
|
+ pageSize:20,
|
|
|
+ },
|
|
|
+ //数据数量
|
|
|
+ total:0,
|
|
|
+ //数据数组
|
|
|
+ tableList:[{}],
|
|
|
+ // 选中用户组
|
|
|
+ userIds: [],
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ //表格扩展选择器---需要在@selection-change绑定的方法内监控selection数组长度
|
|
|
+ selectedNum:0,
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -22,7 +183,94 @@
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
+ pageToggle(type){
|
|
|
+ if(type == 1){
|
|
|
+ this.pageType = 1;
|
|
|
+ }else if(type == 2){
|
|
|
+ this.pageType = 2
|
|
|
+ }else if(type == 3){
|
|
|
+ this.pageType = 3
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //获取数据列表
|
|
|
+ getList(){
|
|
|
+ this.queryParamsData = JSON.parse(JSON.stringify(this.queryParams));
|
|
|
+ // listHardware(this.queryParamsData).then(response => {
|
|
|
+ // this.total = response.total;
|
|
|
+ // this.tableList = response.rows;
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParamsData.pageNum = 1;
|
|
|
+ this.queryParamsData.pageSize = 20;
|
|
|
+ this.queryParams = JSON.parse(JSON.stringify(this.queryParamsData));
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.$set(this,'queryParamsData',{});
|
|
|
+ this.$set(this,'queryParams',{});
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ /** 当前时间 */
|
|
|
+ getCurrentTime () {
|
|
|
+ const yy = new Date().getFullYear()
|
|
|
+ const mm = new Date().getMonth() + 1
|
|
|
+ const dd = new Date().getDate()
|
|
|
+ const hh = new Date().getHours()
|
|
|
+ const mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
|
|
|
+ const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
|
|
|
+ return yy + '-' + mm + '-' + dd
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ exportButton(item) {
|
|
|
+ let self = this;
|
|
|
+ let currentDate = this.getCurrentTime()
|
|
|
+ if(item.command == 1){
|
|
|
+ self.$confirm(`确认导出全部数据?`, "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(async () => {
|
|
|
+ self.download('/chemical/hxpChemical/export/', {...self.queryParamsData}, '化学品信息-'+currentDate+'.xlsx')
|
|
|
+ }).catch(() => {})
|
|
|
+ }else if(item.command == 2){
|
|
|
+ if(self.ids.length>0) {
|
|
|
+ self.$confirm(`确认导出选中数据?`, "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(async () => {
|
|
|
+ let ids = self.ids.join(',');
|
|
|
+ let obj = {
|
|
|
+ ids :ids
|
|
|
+ }
|
|
|
+ console.log("obj",obj)
|
|
|
+ self.download(`/chemical/hxpChemical/export/`,obj, '化学品信息-'+currentDate+'.xlsx')
|
|
|
+ }).catch(() => {})
|
|
|
+ }else {
|
|
|
+ this.msgError('请选择要导出的数据')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /*下载失败列表*/
|
|
|
+ failureExcel(){
|
|
|
+ this.download('/chemical/hxpChemical/importErrorData', {}, `失败报表.xlsx`)
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.selectedNum = selection.length;
|
|
|
+ this.userIds = selection.map(item => item.userId)
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ /*===记录勾选数据===
|
|
|
+ 需要再el-table 添加 :row-key="getRowKeys"
|
|
|
+ 需要在selection 添加 :reserve-selection="true"
|
|
|
+ */
|
|
|
+ getRowKeys(row) {
|
|
|
+ return row.id
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -44,6 +292,35 @@
|
|
|
flex-direction: column;
|
|
|
overflow: hidden;
|
|
|
padding:20px;
|
|
|
+ .form-box{
|
|
|
+ .form-dropdown-box{
|
|
|
+ display: flex;
|
|
|
+ margin:0;
|
|
|
+ padding:0 10px;
|
|
|
+ cursor: pointer;
|
|
|
+ height:40px;
|
|
|
+ img:nth-child(1){
|
|
|
+ width:16px;
|
|
|
+ height:16px;
|
|
|
+ margin-top:12px;
|
|
|
+ }
|
|
|
+ p{
|
|
|
+ width:47px;
|
|
|
+ text-align: center;
|
|
|
+ font-size:14px;
|
|
|
+ margin:0;
|
|
|
+ line-height:40px;
|
|
|
+ }
|
|
|
+ img:nth-child(3){
|
|
|
+ width:10px;
|
|
|
+ height:6px;
|
|
|
+ margin-top:17px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .button-box{
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|