index.vue 7.7 KB

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