index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <!--化学品存放-->
  2. <template>
  3. <div class="app-container listPage">
  4. <div class="listPage-min" v-if="pageType == 1">
  5. <el-form :model="queryParamsData" ref="queryForm" :inline="true" label-width="68px">
  6. <el-form-item label="关键字" prop="searchValue">
  7. <el-input
  8. maxlength="20"
  9. v-model="queryParamsData.searchValue"
  10. placeholder="化学品名/别名/CAS号/编号/实验室"
  11. style="width:260px;"
  12. clearable/>
  13. </el-form-item>
  14. <el-form-item label="状态" prop="status">
  15. <el-select v-model="queryParamsData.status" clearable placeholder="请选择状态">
  16. <el-option
  17. v-for="item in optionsListTwo"
  18. :key="item.id"
  19. :label="item.name"
  20. :value="item.id">
  21. </el-option>
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item style="float: right;">
  25. <el-col :span="1.5">
  26. <p class="inquire-button-one"
  27. style="width:100px;"
  28. @click="pageToggle(2)"
  29. >化学品存放</p>
  30. </el-col>
  31. </el-form-item>
  32. <el-form-item>
  33. <p class="inquire-button-one" @click="handleQuery" style="margin-right:10px;">查询</p>
  34. <p class="reset-button-one" @click="resetQuery">重置</p>
  35. </el-form-item>
  36. </el-form>
  37. <el-table v-loading="loading" border :data="tableList">
  38. <el-table-column label="化学品编号" align="center" prop="joinNum" width="130px" show-overflow-tooltip/>
  39. <el-table-column label="容量规格" align="center" prop="chemicalAmountUnit" width="150px" show-overflow-tooltip/>
  40. <el-table-column label="容器规格" align="center" prop="tare" width="150px" show-overflow-tooltip/>
  41. <el-table-column label="过期时间" align="center" prop="expireTime" width="150px" show-overflow-tooltip>
  42. <template slot-scope="scope">{{scope.row.expireTime?scope.row.expireTime:'未设定'}}</template>
  43. </el-table-column>
  44. <el-table-column label="化学品柜" align="center" prop="cabinetName" width="130px" show-overflow-tooltip/>
  45. <el-table-column label="柜锁名称" align="center" prop="lockName" width="150px" show-overflow-tooltip v-if="$store.state.settings.smartAlarmType == 1"/>
  46. <el-table-column label="位置" align="center" prop="posi" show-overflow-tooltip/>
  47. <el-table-column label="化学品柜编号" align="center" prop="cabinetNum" width="148px"/>
  48. <el-table-column label="状态" align="center" prop="cabinetStatus" width="117px" />
  49. <el-table-column label="关联时间" align="center" prop="createTime" width="170px"/>
  50. </el-table>
  51. <pagination :page-sizes="[20, 30, 40, 50]"
  52. v-show="total>0"
  53. :total="total"
  54. :page.sync="queryParams.pageNum"
  55. :limit.sync="queryParams.pageSize"
  56. @pagination="getList"
  57. />
  58. </div>
  59. <add-page v-if="pageType == 2"></add-page>
  60. </div>
  61. </template>
  62. <script>
  63. import { getQueryByUser } from "@/api/studentApi/chemicalManagement/index";
  64. import addPage from "./addPage.vue"
  65. export default {
  66. name: "listPage",
  67. components: {
  68. addPage
  69. },
  70. data() {
  71. return {
  72. pageType:1,
  73. loading:false,
  74. //数据数量
  75. total:0,
  76. tableList:[],
  77. //状态列表
  78. optionsListTwo:[{id:"0",name:"未入库"},{id:"1",name:"已入库"},{id:"2",name:"已出库"}],
  79. // 搜索数据
  80. queryParamsData:{
  81. pageNum:1,
  82. pageSize:20,
  83. },
  84. // 搜索实际发送数据
  85. queryParams:{
  86. pageNum:1,
  87. pageSize:20,
  88. },
  89. // 查询
  90. selectList:[],
  91. //查询历史记录
  92. recordList:[],
  93. };
  94. },
  95. created() {
  96. },
  97. mounted(){
  98. this.getList();
  99. this.getRecord();
  100. },
  101. methods: {
  102. pageToggle(type){
  103. if(type == 1){
  104. this.pageType = 1;
  105. }else if(type == 2){
  106. this.pageType = 2;
  107. }
  108. },
  109. //获取数据列表
  110. getList(){
  111. this.queryParamsData = JSON.parse(JSON.stringify(this.queryParams));
  112. getQueryByUser(this.queryParamsData).then(response => {
  113. this.tableList = response.rows;
  114. this.total = response.total
  115. });
  116. },
  117. /** 搜索按钮操作 */
  118. handleQuery() {
  119. this.queryParamsData.pageNum = 1;
  120. this.queryParamsData.pageSize = 20;
  121. this.queryParams = JSON.parse(JSON.stringify(this.queryParamsData));
  122. this.getList();
  123. },
  124. /** 重置按钮操作 */
  125. resetQuery() {
  126. this.$set(this,'queryParamsData',{});
  127. this.$set(this,'queryParams',{});
  128. this.handleQuery();
  129. },
  130. //获取选择记录
  131. getRecord(){
  132. if(localStorage.getItem('subRecord')){
  133. //历史记录
  134. this.recordList = JSON.parse(localStorage.getItem('subRecord'));
  135. //当前列表
  136. this.selectList = JSON.parse(localStorage.getItem('subRecord'));
  137. }else{
  138. this.recordList = [];
  139. this.selectList = [];
  140. }
  141. },
  142. }
  143. }
  144. </script>
  145. <style scoped lang="scss">
  146. .listPage{
  147. flex:1;
  148. display: flex;
  149. flex-direction: column;
  150. overflow: hidden;
  151. font-weight:500;
  152. p{
  153. margin:0;
  154. padding:0;
  155. }
  156. .listPage-min{
  157. flex:1;
  158. display: flex;
  159. flex-direction: column;
  160. overflow: hidden;
  161. padding:20px;
  162. }
  163. }
  164. </style>
  165. <style lang="scss">
  166. .ChemicalInfo-listPage-dialog{
  167. p{
  168. margin:0;
  169. }
  170. .dialog-title{
  171. margin-left:10px;
  172. margin-bottom:20px;
  173. font-weight:700;
  174. }
  175. .for-max-big-box{
  176. padding:20px;
  177. background: #f5f5f5;
  178. margin-bottom:12px;
  179. .for-max-title-box{
  180. display: flex;
  181. p:nth-child(1){
  182. background: #0045AF;
  183. width: 3px;
  184. height: 16px;
  185. }
  186. p:nth-child(2){
  187. height: 16px;
  188. font-size: 16px;
  189. color: #333333;
  190. line-height: 16px;
  191. margin-left:12px;
  192. }
  193. }
  194. .for-big-box{
  195. margin-top:20px;
  196. .for-big-title-p{
  197. height:50px;
  198. line-height:50px;
  199. padding:0 22px;
  200. font-size: 16px;
  201. color:#333333;
  202. background: #CCE6FE;
  203. }
  204. .for-big-for-max-box{
  205. border:1px solid #E0E0E0;
  206. .for-big-for-max-title-box{
  207. height:60px;
  208. display: flex;
  209. p:nth-child(1){
  210. flex:1;
  211. font-size:14px;
  212. line-height:60px;
  213. margin-left:22px;
  214. }
  215. p:nth-child(2){
  216. width:80px;
  217. height: 30px;
  218. line-height:30px;
  219. border-radius: 6px;
  220. border: 1px solid #0045AF;
  221. text-align: center;
  222. margin:16px 14px;
  223. color:#0045AF;
  224. font-size:12px;
  225. cursor: pointer;
  226. }
  227. }
  228. .for-min-box{
  229. margin-bottom:10px;
  230. }
  231. }
  232. }
  233. input::-webkit-outer-spin-button,
  234. input::-webkit-inner-spin-button {
  235. -webkit-appearance: none!important;
  236. }
  237. /* 在Firefox浏览器下 */
  238. input[type="number"]{
  239. -moz-appearance: textfield!important;
  240. }
  241. .el-form-item__label{
  242. font-weight:400;
  243. }
  244. .el-form-item-button-box{
  245. .el-input-number__decrease{
  246. height:38px;
  247. width:38px;
  248. line-height:38px;
  249. }
  250. .el-input-number__increase{
  251. height:38px;
  252. width:38px;
  253. line-height:38px;
  254. }
  255. }
  256. }
  257. }
  258. </style>