addPage.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  1. <!--化学品存放-->
  2. <template>
  3. <div class="addPage studentChemicalInfo-add-page">
  4. <div class="addPage-min">
  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="chemicalClassify" label-width="90px">
  15. <el-select v-model="queryParamsData.chemicalClassify" clearable placeholder="请选择化学品分类">
  16. <el-option
  17. v-for="item in optionsListOne"
  18. :key="item.id"
  19. :label="item.classifyName"
  20. :value="item.id">
  21. </el-option>
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label="属性" prop="classifyAttribute" label-width="50px">
  25. <el-select v-model="queryParamsData.classifyAttribute" clearable placeholder="请选择属性">
  26. <el-option
  27. v-for="item in optionsListTwo"
  28. :key="item.dictValue"
  29. :label="item.dictLabel"
  30. :value="item.dictValue">
  31. </el-option>
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item style="float: right;">
  35. <el-col :span="1.5">
  36. <p class="reset-button-one"
  37. style="width:100px;margin-right:20px;"
  38. @click="backPage"
  39. >返回</p>
  40. <p class="inquire-button-one"
  41. style="width:100px;"
  42. @click="handleAdd"
  43. >确定</p>
  44. </el-col>
  45. </el-form-item>
  46. <el-form-item>
  47. <p class="inquire-button-one" @click="handleQuery" style="margin-right:10px;">查询</p>
  48. <p class="reset-button-one" @click="resetQuery">重置</p>
  49. </el-form-item>
  50. </el-form>
  51. <el-table v-loading="loading" border :data="tableList" ref="multipleTable" :row-key="getRowKeys"
  52. tooltip-effect="dark" @select-all="dialogCheck" @select="dialogCheck">
  53. <el-table-column type="selection" width="50" align="center" :reserve-selection="true"/>
  54. <el-table-column label="ID" align="center" prop="id" width="150" show-overflow-tooltip/>
  55. <el-table-column label="化学品名" align="center" prop="chemicalName" width="250" show-overflow-tooltip/>
  56. <el-table-column label="CAS号" align="center" prop="casNum" width="200" show-overflow-tooltip/>
  57. <el-table-column label="分类" align="center" prop="classifyName" width="250" show-overflow-tooltip/>
  58. <el-table-column label="属性" align="center" prop="classifyAttribute" show-overflow-tooltip/>
  59. <el-table-column label="形态" align="center" prop="chemicalShapeInfo" width="180" show-overflow-tooltip/>
  60. <el-table-column label="纯度" align="center" prop="purity" width="150" show-overflow-tooltip/>
  61. </el-table>
  62. <pagination :page-sizes="[20, 30, 40, 50]"
  63. v-show="total>0"
  64. :total="total"
  65. :page.sync="queryParams.pageNum"
  66. :limit.sync="queryParams.pageSize"
  67. @pagination="getList"
  68. />
  69. </div>
  70. <el-dialog title="化学品存放" :visible.sync="dialogType" v-if="dialogType" width="990px" append-to-body class="ChemicalInfo-addPage-dialog">
  71. <!--<p class="dialog-title">{{dialogDeptName}}</p>-->
  72. <el-form :model="dialogData" ref="dialogForm" :inline="true" :rules="rules" label-width="70px">
  73. <el-form-item label="实验室" prop="subId">
  74. <el-select
  75. style="width:485px;"
  76. v-model="dialogData.subId"
  77. filterable
  78. remote
  79. clearable
  80. @focus="selectFocus"
  81. reserve-keyword
  82. @change="selectClick"
  83. @clear="clearClick"
  84. placeholder="搜索选择实验室"
  85. :remote-method="getSelectList"
  86. :loading="loading">
  87. <el-option
  88. v-for="item in selectList"
  89. :key="item.id"
  90. :label="item.name"
  91. :value="item.id">
  92. </el-option>
  93. </el-select>
  94. </el-form-item>
  95. <p style="margin:0 0 20px 15px;font-weight:700;font-size:14px;" v-if="dialogData.maxList[0]&&dialogData.subId">设置要存放的化学品规格和数量</p>
  96. <p style="margin:0 0 0 70px;font-weight:700;font-size:14px;color:#FF6666;" v-if="!dialogData.maxList[0]&&dialogData.subId">该实验室未配置化学品柜</p>
  97. <div class="scrollbar-box" style="width:950px;margin:0 auto;max-height:500px;overflow-y: scroll" v-if="$store.state.settings.smartAlarmType == 1">
  98. <div class="for-max-big-box" v-for="(item,index) in dialogData.maxList">
  99. <div class="for-max-title-box">
  100. <p></p>
  101. <p>{{item.name}}</p>
  102. <p>{{selectioned.chemicalName}}可存放量:{{item.maxNum}}{{selectioned.chemicalUnit}}</p>
  103. </div>
  104. <div class="for-big-box" v-for="(bigItem,bigIndex) in item.chemicalJoinCabinetSonList">
  105. <p class="for-big-title-p">{{bigItem.lockName}}</p>
  106. <div class="for-big-for-max-box">
  107. <div class="for-big-for-max-title-box">
  108. <p>化学品存放规格</p>
  109. <p @click="addList(index,bigIndex)">+添加</p>
  110. </div>
  111. <div class="for-min-box" v-for="(minItem,minIndex) in bigItem.list">
  112. <el-form-item class="num-input-item" label="容器容量规格" label-width="120px" :prop="'maxList.'+ index +'.chemicalJoinCabinetSonList.'+bigIndex+'.list.'+minIndex+'.chemicalAmount'" :rules="rules.chemicalAmount">
  113. <div class="num-input-min-box">
  114. <el-input-number
  115. style="width:110px;"
  116. :min="null"
  117. :max="5000"
  118. :precision="2"
  119. :step="0.01"
  120. v-model="minItem.chemicalAmount"
  121. placeholder="请输入">
  122. </el-input-number>
  123. <p class="num-title-span">{{selectioned.chemicalUnit}}</p>
  124. </div>
  125. </el-form-item>
  126. <el-form-item class="num-input-item" label="容器重量规格" label-width="120px" :prop="'maxList.'+ index +'.chemicalJoinCabinetSonList.'+bigIndex+'.list.'+minIndex+'.tare'" :rules="rules.tare">
  127. <div class="num-input-min-box">
  128. <el-input-number
  129. style="width:110px;"
  130. :min="null"
  131. :max="5000"
  132. :precision="2"
  133. :step="0.01"
  134. v-model="minItem.tare"
  135. placeholder="请输入">
  136. </el-input-number>
  137. <p class="num-title-span">g</p>
  138. </div>
  139. </el-form-item>
  140. <el-form-item label="存放数量" label-width="90px" :prop="'maxList.'+ index +'.chemicalJoinCabinetSonList.'+bigIndex+'.list.'+minIndex+'.storageNum'" :rules="rules.storageNum" class="el-form-item-button-box">
  141. <el-input-number
  142. style="width:150px;"
  143. :min="1"
  144. :max="1000"
  145. :step="1"
  146. v-model="minItem.storageNum"
  147. placeholder="请输入">
  148. </el-input-number>
  149. </el-form-item>
  150. <span class="el-icon-delete" style="margin-left:30px;color:#999;line-height:40px;font-size:24px;cursor: pointer;" @click="delList(index,bigIndex,minIndex)"></span>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. <div class="scrollbar-box" style="width:950px;margin:0 auto;max-height:500px;overflow-y: scroll" v-if="$store.state.settings.smartAlarmType == 0">
  157. <div class="for-max-big-box" v-for="(item,index) in dialogData.maxList">
  158. <div class="for-max-title-box">
  159. <p></p>
  160. <p>{{item.name}}</p>
  161. <p>{{selectioned.chemicalName}}可存放量:{{item.maxNum}}{{selectioned.chemicalUnit}}</p>
  162. </div>
  163. <div class="for-big-box">
  164. <div class="for-big-for-max-box">
  165. <div class="for-big-for-max-title-box">
  166. <p>化学品存放规格</p>
  167. <p @click="addList(index)">+添加</p>
  168. </div>
  169. <div class="for-min-box" v-for="(bigItem,bigIndex) in item.list">
  170. <el-form-item class="num-input-item" label="容器容量规格" label-width="120px" :prop="'maxList.'+ index +'.list.'+ bigIndex+'.chemicalAmount'" :rules="rules.chemicalAmount">
  171. <div class="num-input-min-box">
  172. <el-input-number
  173. style="width:110px;"
  174. :min="null"
  175. :max="5000"
  176. :precision="2"
  177. :step="0.01"
  178. v-model="bigItem.chemicalAmount"
  179. placeholder="请输入">
  180. </el-input-number>
  181. <p class="num-title-span">{{selectioned.chemicalUnit}}</p>
  182. </div>
  183. </el-form-item>
  184. <el-form-item class="num-input-item" label="容器重量规格" label-width="120px" :prop="'maxList.'+ index +'.list.'+ bigIndex+'.tare'" :rules="rules.tare">
  185. <div class="num-input-min-box">
  186. <el-input-number
  187. style="width:110px;"
  188. :min="null"
  189. :max="5000"
  190. :precision="2"
  191. :step="0.01"
  192. v-model="bigItem.tare"
  193. placeholder="请输入">
  194. </el-input-number>
  195. <p class="num-title-span">g</p>
  196. </div>
  197. </el-form-item>
  198. <el-form-item label="存放数量" label-width="90px" :prop="'maxList.'+ index +'.list.'+ bigIndex+'.storageNum'" :rules="rules.storageNum" class="el-form-item-button-box">
  199. <el-input-number
  200. style="width:150px;"
  201. :min="1"
  202. :max="1000"
  203. :step="1"
  204. v-model="bigItem.storageNum"
  205. placeholder="请输入">
  206. </el-input-number>
  207. </el-form-item>
  208. <span class="el-icon-delete" style="margin-left:30px;color:#999;line-height:40px;font-size:24px;cursor: pointer;" @click="delList(index,bigIndex)"></span>
  209. </div>
  210. </div>
  211. </div>
  212. </div>
  213. </div>
  214. </el-form>
  215. <div slot="footer" class="dialog-footer">
  216. <el-button @click="cancel">取 消</el-button>
  217. <el-button type="primary" @click="submitForm">确 定</el-button>
  218. </div>
  219. </el-dialog>
  220. </div>
  221. </template>
  222. <script>
  223. import { filterDept,getSubList,getCabinetBySubId,hxpChemicalJoinCabinet,getRestStockByManyCabinet,classifyList } from "@/api/medicUniversity-3_1/index";
  224. import { getHxpQueryByUser } from "@/api/studentApi/chemicalManagement/index";
  225. import { getLogoInfo } from "@/api/system/publicConfig";
  226. export default {
  227. name: "addPage",
  228. props:{
  229. listPropsData:{},
  230. },
  231. data() {
  232. const computingCapacity = (rule, value, callback) => {
  233. console.log('rule',rule)
  234. const list = rule.field.split('.');
  235. let index = parseInt(list[1]);
  236. let max = parseInt(this.dialogData.maxList[index].maxNum);
  237. if(value>max){
  238. callback(new Error("超出该机柜可存放量"));
  239. }else{
  240. callback();
  241. }
  242. };
  243. return {
  244. //限制时间范围
  245. pickerBeginOption: {
  246. disabledDate: (time) => {
  247. return time.getTime() < Date.now()-1 * 24 * 60 * 60 * 1000
  248. }
  249. },
  250. loading:false,
  251. //数据数量
  252. total:0,
  253. tableList:[],
  254. //实验室列表
  255. optionsListOne:[],
  256. //状态列表
  257. optionsListTwo:[],
  258. // 搜索数据
  259. queryParamsData:{
  260. pageNum:1,
  261. pageSize:20,
  262. },
  263. // 搜索实际发送数据
  264. queryParams:{
  265. pageNum:1,
  266. pageSize:20,
  267. },
  268. dialogType:false,
  269. dialogData:{
  270. subId:"",
  271. chemicalId:"",
  272. maxList:[],
  273. },
  274. // 查询
  275. selectList:[],
  276. //校验
  277. rules:{
  278. subId:[
  279. { required: true, message: '请搜索选择实验室', trigger: 'blur' },
  280. ],
  281. chemicalAmount:[
  282. { required: true, message: '请输入容器容量', trigger: 'blur' },
  283. { required: true, message: "请输入容器容量", validator: this.spaceJudgment, trigger: "blur" },
  284. { required: true, message: "超出该机柜可存放量", validator: computingCapacity, trigger: "blur" },
  285. ],
  286. tare:[
  287. { required: true, message: '请输入容器自重', trigger: 'blur' },
  288. { required: true, message: "请输入容器自重", validator: this.spaceJudgment, trigger: "blur" }
  289. ],
  290. storageNum:[
  291. { required: true, message: '请输入存放数量', trigger: 'blur' },
  292. { required: true, message: "请输入存放数量", validator: this.spaceJudgment, trigger: "blur" }
  293. ],
  294. },
  295. //查询历史记录
  296. recordList:[],
  297. dialogDeptName:"",
  298. dialogDeptId:"",
  299. //选中
  300. selectioned:{},
  301. };
  302. },
  303. created() {
  304. },
  305. mounted(){
  306. this.getList();
  307. this.getRecord();
  308. this.getDicts("hxp_classifyattribute").then(response => {
  309. this.optionsListTwo = response.data;
  310. })
  311. this.classifyList();
  312. },
  313. methods: {
  314. //获取化学品分类列表
  315. classifyList(){
  316. classifyList().then(response => {
  317. this.optionsListOne = response.rows;
  318. });
  319. },
  320. selectFocus(){
  321. if(!this.selectList[0]){
  322. this.getSubList();
  323. }
  324. },
  325. timeChange(){
  326. this.$forceUpdate();
  327. },
  328. //删除规格
  329. delList(index,bigIndex,minIndex){
  330. if(this.$store.state.settings.smartAlarmType == 1){
  331. this.dialogData.maxList[index].chemicalJoinCabinetSonList[bigIndex].list.splice(minIndex,1);
  332. }else{
  333. this.dialogData.maxList[index].list.splice(bigIndex,1);
  334. }
  335. },
  336. //新增规格
  337. addList(index,bigIndex){
  338. if(this.$store.state.settings.smartAlarmType == 1){
  339. this.dialogData.maxList[index].chemicalJoinCabinetSonList[bigIndex].list.push({chemicalAmount:"",tare:"",storageNum:1,})
  340. }else{
  341. this.dialogData.maxList[index].list.push({chemicalAmount:"",tare:"",storageNum:1,})
  342. }
  343. },
  344. // 提交
  345. submitForm(){
  346. let self = this;
  347. this.$refs["dialogForm"].validate(valid => {
  348. if (valid) {
  349. if(this.$store.state.settings.smartAlarmType == 0){
  350. for(let i=0;i<self.dialogData.maxList.length;i++){
  351. let maxNum = parseFloat(self.dialogData.maxList[i].maxNum);
  352. let num = 0;
  353. for(let o=0;o<self.dialogData.maxList[i].list.length;o++){
  354. num = num + parseFloat(self.dialogData.maxList[i].list[o].chemicalAmount)
  355. }
  356. if(num>maxNum){
  357. this.msgError(self.dialogData.maxList[i].name+' 总容器容量大于可存放量');
  358. return
  359. }
  360. }
  361. }else if(this.$store.state.settings.smartAlarmType == 1){
  362. for(let i=0;i<self.dialogData.maxList.length;i++){
  363. let maxNum = parseFloat(self.dialogData.maxList[i].maxNum);
  364. let num = 0;
  365. for(let o=0;o<self.dialogData.maxList[i].chemicalJoinCabinetSonList.length;o++){
  366. for(let x=0;x<self.dialogData.maxList[i].chemicalJoinCabinetSonList[o].list.length;x++){
  367. num = num + parseFloat(self.dialogData.maxList[i].chemicalJoinCabinetSonList[o].list[x].chemicalAmount)
  368. }
  369. }
  370. if(num>maxNum){
  371. this.msgError(self.dialogData.maxList[i].name+' 总容器容量大于可存放量');
  372. return
  373. }
  374. }
  375. }
  376. let obj = {
  377. subId:this.dialogData.subId,
  378. chemicalId:this.selectioned.id,
  379. chemicalJoinCabinetSonList:[],
  380. }
  381. if(this.$store.state.settings.smartAlarmType == 1){
  382. for(let i=0;i<self.dialogData.maxList.length;i++){
  383. for(let o=0;o<self.dialogData.maxList[i].chemicalJoinCabinetSonList.length;o++){
  384. for(let x=0;x<self.dialogData.maxList[i].chemicalJoinCabinetSonList[o].list.length;x++){
  385. let newObj = {
  386. cabinetId:self.dialogData.maxList[i].cabinetId,
  387. cabinetlockId:self.dialogData.maxList[i].chemicalJoinCabinetSonList[o].id,
  388. chemicalAmount:self.dialogData.maxList[i].chemicalJoinCabinetSonList[o].list[x].chemicalAmount,
  389. chemicalAmountUnit:self.selectioned.chemicalUnit,
  390. storageNum:self.dialogData.maxList[i].chemicalJoinCabinetSonList[o].list[x].storageNum,
  391. tare:self.dialogData.maxList[i].chemicalJoinCabinetSonList[o].list[x].tare,
  392. }
  393. obj.chemicalJoinCabinetSonList.push(newObj);
  394. }
  395. }
  396. }
  397. }else{
  398. for(let i=0;i<self.dialogData.maxList.length;i++){
  399. for(let o=0;o<self.dialogData.maxList[i].list.length;o++){
  400. console.log(self.dialogData.maxList[i].list[o]);
  401. let newObj = {
  402. cabinetId:self.dialogData.maxList[i].cabinetId,
  403. chemicalAmount:self.dialogData.maxList[i].list[o].chemicalAmount,
  404. chemicalAmountUnit:self.selectioned.chemicalUnit,
  405. storageNum:self.dialogData.maxList[i].list[o].storageNum,
  406. tare:self.dialogData.maxList[i].list[o].tare,
  407. }
  408. obj.chemicalJoinCabinetSonList.push(newObj);
  409. }
  410. }
  411. }
  412. if(obj.chemicalJoinCabinetSonList[0]){
  413. hxpChemicalJoinCabinet(obj).then(response => {
  414. self.dialogType = false;
  415. self.msgSuccess(response.msg)
  416. self.$parent.pageToggle(1);
  417. });
  418. }else{
  419. self.msgError('请添加规格')
  420. }
  421. }
  422. })
  423. },
  424. //取消
  425. cancel(){
  426. this.dialogType = false;
  427. },
  428. //选中触发
  429. selectClick(data){
  430. let self = this;
  431. if(data){
  432. for(let i=0;i<self.selectList.length;i++){
  433. if(data == self.selectList[i].id){
  434. let num = 0;
  435. for(let o=0;o<self.recordList.length;o++){
  436. if(data == self.recordList[o].id){
  437. num ++
  438. }
  439. }
  440. if(num == 0){
  441. if(self.recordList.length>9){
  442. self.recordList.splice(0,1)
  443. }
  444. self.recordList.push(self.selectList[i])
  445. this.$forceUpdate();
  446. localStorage.setItem('subRecord',JSON.stringify(self.recordList))
  447. break
  448. }
  449. }
  450. }
  451. let obj ={
  452. subId:data,
  453. cabinetStatus:1
  454. }
  455. getCabinetBySubId(obj).then(response => {
  456. let list = [];
  457. for(let i=0;i<response.data.length;i++){
  458. if(self.$store.state.settings.smartAlarmType == 1){
  459. if(response.data[i].cabinetLockList[0]){
  460. let obj ={
  461. name:response.data[i].cabinetName,
  462. cabinetId:response.data[i].id,
  463. chemicalJoinCabinetSonList:response.data[i].cabinetLockList
  464. };
  465. for(let o=0;o<obj.chemicalJoinCabinetSonList.length;o++){
  466. obj.chemicalJoinCabinetSonList[o].list = [];
  467. }
  468. list.push(obj);
  469. }
  470. }else{
  471. let obj ={
  472. name:response.data[i].cabinetName,
  473. cabinetId:response.data[i].id,
  474. list:[]
  475. };
  476. list.push(obj);
  477. }
  478. }
  479. let newObj = {
  480. chemicalId:self.selectioned.id,
  481. cabinetIds:"",
  482. }
  483. for(let i=0;i<list.length;i++){
  484. if(i==0){
  485. newObj.cabinetIds = list[i].cabinetId;
  486. }else{
  487. newObj.cabinetIds = newObj.cabinetIds +','+ list[i].cabinetId;
  488. }
  489. }
  490. if(list[0]){
  491. getRestStockByManyCabinet(newObj).then(response => {
  492. for(let i=0;i<response.data.length;i++){
  493. for(let o=0;o<list.length;o++){
  494. if(response.data[i].cabinetId == list[o].cabinetId){
  495. list[o].maxNum = response.data[i].restStock;
  496. }
  497. }
  498. }
  499. this.$set(this.dialogData,"maxList",list);
  500. })
  501. }else{
  502. this.$set(this.dialogData,"maxList",list);
  503. }
  504. });
  505. }
  506. },
  507. //清空触发
  508. clearClick(){
  509. // this.optionsUser = [];
  510. // this.getList();
  511. this.getRecord();
  512. this.dialogData.maxList = [];
  513. },
  514. //查询
  515. getSelectList(val){
  516. let self = this;
  517. let list = [];
  518. for(let i=0;i<self.selectListData.length;i++){
  519. if(self.selectListData[i].name.indexOf(val) != -1){
  520. list.push(self.selectListData[i]);
  521. }
  522. }
  523. this.selectList = JSON.parse(JSON.stringify(list))
  524. },
  525. //化学品存放
  526. handleAdd(){
  527. //查询当前院系
  528. filterDept().then(response => {
  529. if(!this.selectioned.id){
  530. this.msgError('请勾选化学品')
  531. return
  532. }
  533. let text = "";
  534. let idText = "";
  535. for(let i=0;i<response.data.length;i++){
  536. if(i==0){
  537. text = text + response.data[i].deptName;
  538. idText = idText + response.data[i].deptId;
  539. }else{
  540. text = text +'-'+ response.data[i].deptName;
  541. idText = idText +','+ response.data[i].deptId;
  542. }
  543. }
  544. this.$set(this,'dialogDeptName',text);
  545. this.$set(this,'dialogDeptId',idText);
  546. this.getSubList();
  547. });
  548. },
  549. backPage(){
  550. this.$parent.pageToggle(0);
  551. },
  552. //获取数据列表
  553. getList(){
  554. this.queryParamsData = JSON.parse(JSON.stringify(this.queryParams));
  555. // this.queryParamsData.chemicalId = this.listPropsData.id;
  556. getHxpQueryByUser(this.queryParamsData).then(response => {
  557. this.tableList = response.rows;
  558. this.total = response.total
  559. });
  560. },
  561. /** 搜索按钮操作 */
  562. handleQuery() {
  563. this.queryParamsData.pageNum = 1;
  564. this.queryParamsData.pageSize = 20;
  565. this.queryParams = JSON.parse(JSON.stringify(this.queryParamsData));
  566. this.getList();
  567. },
  568. /** 重置按钮操作 */
  569. resetQuery() {
  570. this.$set(this,'queryParamsData',{});
  571. this.$set(this,'queryParams',{});
  572. this.handleQuery();
  573. },
  574. //获取选择记录
  575. getRecord(){
  576. if(localStorage.getItem('subRecord')){
  577. //历史记录
  578. this.recordList = JSON.parse(localStorage.getItem('subRecord'));
  579. //当前列表
  580. this.selectList = JSON.parse(localStorage.getItem('subRecord'));
  581. }else{
  582. this.recordList = [];
  583. this.selectList = [];
  584. }
  585. },
  586. //根据所属院系或多个院系获取实验室列表
  587. getSubList(){
  588. let ids = this.dialogDeptId+'';
  589. getSubList(ids).then(response => {
  590. this.$set(this,'dialogData',{
  591. subId:"",
  592. chemicalId:"",
  593. maxList:[],
  594. });
  595. //当前列表
  596. this.selectList = JSON.parse(JSON.stringify(response.data));
  597. //原始列表数据
  598. this.selectListData = JSON.parse(JSON.stringify(response.data));
  599. this.dialogType = true;
  600. });
  601. },
  602. dialogCheck (selection, row) {
  603. console.log("selection",selection)
  604. console.log("row",row)
  605. this.$refs.multipleTable.clearSelection()
  606. if (selection.length === 0) {
  607. // 判断selection是否有值存在
  608. this.selectioned = {};
  609. }else{
  610. this.selectioned = row
  611. this.$refs.multipleTable.toggleRowSelection(row, true)
  612. }
  613. },
  614. /*===记录勾选数据===
  615. 需要再el-table 添加 :row-key="getRowKeys"
  616. 需要在selection 添加 :reserve-selection="true"
  617. */
  618. getRowKeys(row) {
  619. return row.id
  620. },
  621. }
  622. }
  623. </script>
  624. <style scoped lang="scss">
  625. .addPage{
  626. flex:1;
  627. display: flex;
  628. flex-direction: column;
  629. overflow: hidden;
  630. font-weight:500;
  631. p{
  632. margin:0;
  633. padding:0;
  634. }
  635. .addPage-min{
  636. flex:1;
  637. display: flex;
  638. flex-direction: column;
  639. overflow: hidden;
  640. padding:20px;
  641. }
  642. }
  643. </style>
  644. <style lang="scss">
  645. .ChemicalInfo-addPage-dialog{
  646. p{
  647. margin:0;
  648. }
  649. .dialog-title{
  650. margin-left:10px;
  651. margin-bottom:20px;
  652. font-weight:700;
  653. }
  654. .for-max-big-box{
  655. padding:20px;
  656. background: #f5f5f5;
  657. margin-bottom:12px;
  658. .for-max-title-box{
  659. display: flex;
  660. p:nth-child(1){
  661. background: #0045AF;
  662. width: 3px;
  663. height: 16px;
  664. }
  665. p:nth-child(2){
  666. flex:1;
  667. height: 16px;
  668. font-size: 16px;
  669. color: #333333;
  670. line-height: 16px;
  671. margin-left:12px;
  672. }
  673. p:nth-child(3){
  674. font-size:16px;
  675. line-height: 16px;
  676. color:#0183FA;
  677. }
  678. }
  679. .for-big-box{
  680. margin-top:20px;
  681. .for-big-title-p{
  682. height:50px;
  683. line-height:50px;
  684. padding:0 22px;
  685. font-size: 16px;
  686. color:#333333;
  687. background: #CCE6FE;
  688. }
  689. .for-big-for-max-box{
  690. border:1px solid #E0E0E0;
  691. .for-big-for-max-title-box{
  692. height:60px;
  693. display: flex;
  694. p:nth-child(1){
  695. flex:1;
  696. font-size:14px;
  697. line-height:60px;
  698. margin-left:22px;
  699. }
  700. p:nth-child(2){
  701. width:80px;
  702. height: 30px;
  703. line-height:30px;
  704. border-radius: 6px;
  705. border: 1px solid #0045AF;
  706. text-align: center;
  707. margin:16px 14px;
  708. color:#0045AF;
  709. font-size:12px;
  710. cursor: pointer;
  711. }
  712. }
  713. .for-min-box{
  714. margin-bottom:10px;
  715. }
  716. }
  717. }
  718. input::-webkit-outer-spin-button,
  719. input::-webkit-inner-spin-button {
  720. -webkit-appearance: none!important;
  721. }
  722. /* 在Firefox浏览器下 */
  723. input[type="number"]{
  724. -moz-appearance: textfield!important;
  725. }
  726. .el-form-item__label{
  727. font-weight:400;
  728. }
  729. .el-form-item-button-box{
  730. .el-input-number__decrease{
  731. height:38px;
  732. width:38px;
  733. line-height:38px;
  734. }
  735. .el-input-number__increase{
  736. height:38px;
  737. width:38px;
  738. line-height:38px;
  739. }
  740. }
  741. }
  742. }
  743. .studentChemicalInfo-add-page{
  744. .el-table__header-wrapper{
  745. .el-checkbox{
  746. display: none;
  747. }
  748. }
  749. }
  750. .num-input-item{
  751. .num-input-min-box{
  752. display: flex;
  753. .el-input-number__increase{
  754. display: none;
  755. }
  756. .el-input-number__decrease{
  757. display: none;
  758. }
  759. input{
  760. padding:0 20px!important;
  761. border-top-right-radius: 0;
  762. border-bottom-right-radius: 0;
  763. }
  764. .num-title-span{
  765. display: inline-block;
  766. width:40px;
  767. height:40px;
  768. text-align: center;
  769. border: 1px solid #DCDFE6;
  770. border-left:none;
  771. border-top-right-radius: 4px;
  772. border-bottom-right-radius: 4px;
  773. }
  774. }
  775. }
  776. </style>