addPage.vue 29 KB

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