index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <!--出库记录-->
  2. <template>
  3. <div class="app-container OutboundRecord">
  4. <advanced-search :searchData="searchData"></advanced-search>
  5. <div class="OutboundRecord-min">
  6. <el-table border :data="tableList" @selection-change="handleSelectionChange" ref="multipleTable" :row-key="getRowKeys">
  7. <el-table-column type="selection" width="50" align="center" :reserve-selection="true"/>
  8. <el-table-column label="出库时间" align="center" prop="outTime" width="183"/>
  9. <el-table-column label="化学品编号" align="center" prop="joinNum" width="130"/>
  10. <el-table-column label="化学品名" align="center" prop="chemicalName" width="180"/>
  11. <el-table-column label="CAS号" align="center" prop="casNum" width="180"/>
  12. <el-table-column label="分类" align="center" prop="classifyName" width="181"/>
  13. <el-table-column label="属性" align="center" prop="classifyAttribute" width="220" show-overflow-tooltip/>
  14. <el-table-column label="形态" align="center" prop="chemicalShape" width="120"/>
  15. <el-table-column label="容量规格" align="center" prop="chemicalAmountUnit" width="121"/>
  16. <el-table-column label="容器规格" align="center" prop="tareUnit" width="121"/>
  17. <el-table-column label="标签类型" align="center" prop="labelType" width="121"/>
  18. <el-table-column label="标签编号" align="center" prop="tagCode" width="130"/>
  19. <el-table-column label="化学品柜" align="center" prop="cabinetName" width="200" show-overflow-tooltip/>
  20. <el-table-column label="化学品柜位置" align="center" prop="posi" width="280" show-overflow-tooltip/>
  21. <el-table-column label="出库净重" align="center" prop="outUsages" width="120"/>
  22. <el-table-column label="出库方式" align="center" prop="stockStatus" width="120"/>
  23. <el-table-column label="操作人" align="center" prop="operator" width="220" show-overflow-tooltip/>
  24. <el-table-column label="身份验证" align="center" prop="verify" width="220" show-overflow-tooltip>
  25. <template slot-scope="scope">
  26. {{scope.row.verify?scope.row.verify:'无'}}
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="操作" align="center" prop="operator" width="114">
  30. <template slot-scope="scope">
  31. <div class="button-box">
  32. <p class="table-min-button"
  33. style="margin:0!important;"
  34. @click="lockVideo(scope.row)"
  35. >开关锁视频</p>
  36. </div>
  37. </template>
  38. </el-table-column>
  39. </el-table>
  40. <div style="display: flex;height:32px;margin-top:15px;">
  41. <!--<p style="flex:4;"></p>-->
  42. <p style="text-align: left;margin:0;line-height:32px;margin-right:20px;font-size:14px;color:#999;">
  43. <i class="el-icon-warning" style="color:#0183FA;"></i>
  44. 已选择 {{selectedNum}} 项
  45. </p>
  46. <div style="flex:5;">
  47. <pagination :page-sizes="[20, 30, 40, 50]"
  48. v-show="total>0"
  49. :total="total"
  50. style="margin:0;"
  51. :page.sync="queryParams.pageNum"
  52. :limit.sync="queryParams.pageSize"
  53. @pagination="getList"
  54. />
  55. </div>
  56. </div>
  57. </div>
  58. <el-dialog :title="videoTitle" :visible.sync="videoType" v-if="videoType"
  59. width="840px" append-to-body id="operationRecord-dialog-box">
  60. <video style="width:800px;height:450px;" controls="" autoplay="" name="media" :poster="videoCover">
  61. <source :src="videoData.url" type="video/mp4">
  62. </video>
  63. </el-dialog>
  64. </div>
  65. </template>
  66. <script>
  67. import { classifyList,getNoauthList } from "@/api/medicUniversity-3_1/index";
  68. import { getListOut } from "@/api/studentApi/chemicalManagement/index";
  69. import { listDepartments } from "@/api/system/dept";
  70. import advancedSearch from "@/components/ZDcomponents/advancedSearch.vue"
  71. export default {
  72. name: "OutboundRecord",
  73. components: {
  74. advancedSearch
  75. },
  76. data() {
  77. return {
  78. searchData:{
  79. searchList:[//搜索数组
  80. {
  81. name:"关键字",//描述名称
  82. key:"searchValue",//键名 用于返回数据
  83. value:"",//内容 用于组件内绑定数据
  84. placeholder:"化学品名/别名/CAS号/编号/实验室",//输入提示
  85. level:"1",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  86. type:"1",//类型 1.input 2.select 3.TimePicker
  87. universal:'20',//通用参数 input时为最大长度 //TimePicker时可不传
  88. labelWidth:'68px',//label-width宽度 可传可不传 不传时为默认宽度
  89. width:'260',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  90. },
  91. {
  92. name:"化学品分类",//描述名称
  93. key:"chemicalClassify",//键名 用于返回数据
  94. value:"",//内容 用于组件内绑定数据
  95. placeholder:"请选择化学品分类",//输入提示
  96. level:"2",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  97. type:"2",//类型 1.input 2.select 3.TimePicker
  98. universal:[],
  99. width:'175',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  100. },
  101. {
  102. name:"属性",//描述名称
  103. key:"classifyAttribute",//键名 用于返回数据
  104. value:"",//内容 用于组件内绑定数据
  105. placeholder:"请选择属性",//输入提示
  106. level:"2",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  107. type:"2",//类型 1.input 2.select 3.TimePicker
  108. universal:[],
  109. width:'175',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  110. },
  111. {
  112. name:"学院",//描述名称
  113. key:"deptId",//键名 用于返回数据
  114. value:"",//内容 用于组件内绑定数据
  115. placeholder:"请选择学院",//输入提示
  116. level:"2",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  117. type:"2",//类型 1.input 2.select 3.TimePicker
  118. universal:[],
  119. width:'175',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  120. },
  121. {
  122. name:"化学品柜",//描述名称
  123. key:"cabinetId",//键名 用于返回数据
  124. value:"",//内容 用于组件内绑定数据
  125. placeholder:"请选择化学品柜",//输入提示
  126. level:"1",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  127. type:"2",//类型 1.input 2.select 3.TimePicker
  128. universal:[],
  129. width:'175',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  130. },
  131. {
  132. name:"出库方式",//描述名称
  133. key:"status",//键名 用于返回数据
  134. value:"",//内容 用于组件内绑定数据
  135. placeholder:"请选择出库方式",//输入提示
  136. level:"1",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  137. type:"2",//类型 1.input 2.select 3.TimePicker
  138. universal:[ //通用参数 select时为列表数据 //TimePicker时可不传
  139. {label:"用结",value:"2"},{label:"作废",value:"3"}
  140. ],
  141. width:'175',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  142. },
  143. {
  144. name:"标签类型",//描述名称
  145. key:"labelType",//键名 用于返回数据
  146. value:"",//内容 用于组件内绑定数据
  147. placeholder:"请选择标签类型",//输入提示
  148. level:"2",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  149. type:"2",//类型 1.input 2.select 3.TimePicker
  150. universal:[ //通用参数 select时为列表数据 //TimePicker时可不传
  151. {label:"RFID",value:"1"},{label:"二维码",value:"2"}
  152. ],
  153. labelWidth:'68px',//label-width宽度 可传可不传 不传时为默认宽度
  154. width:'260',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  155. },
  156. {
  157. name:"出库时间",//描述名称
  158. key:"timeOne",//键名 用于返回数据
  159. value:"",//内容 用于组件内绑定数据
  160. placeholder:"请选择出库时间",//输入提示
  161. level:"1",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  162. type:"3",//类型 1.input 2.select 3.TimePicker
  163. labelWidth:'82px',//label-width宽度 可传可不传 不传时为默认宽度
  164. width:'260',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  165. },
  166. ],
  167. },
  168. // 搜索实际发送数据
  169. queryParams:{
  170. pageNum:1,
  171. pageSize:20,
  172. },
  173. //数据数量
  174. total:0,
  175. //数据数组
  176. tableList:[],
  177. //表格扩展选择器---需要在@selection-change绑定的方法内监控selection数组长度
  178. selectedNum:0,
  179. // 选中数组
  180. ids: [],
  181. // 非单个禁用
  182. single: true,
  183. // 非多个禁用
  184. multiple: true,
  185. //视频操作
  186. videoType:false,
  187. videoData:{},
  188. videoTitle:"",
  189. };
  190. },
  191. created() {
  192. },
  193. mounted(){
  194. this.classifyList();
  195. this.listDepartments();
  196. this.getNoauthList();
  197. this.getHxpClassifyattribute();
  198. this.getList();
  199. },
  200. methods: {
  201. //视频按钮
  202. lockVideo(row){
  203. if(!row.closeLockVideo){
  204. this.msgError('开关锁视频异常无法观看');
  205. return
  206. }
  207. let obj = {
  208. url:row.closeLockVideo
  209. }
  210. this.$set(this,'videoTitle','开关锁视频');
  211. this.$set(this,'videoData',obj);
  212. this.videoType = true;
  213. },
  214. //获取属性列表
  215. getHxpClassifyattribute(){
  216. this.getDicts("hxp_classifyattribute").then(response => {
  217. let list = [];
  218. for(let i=0;i<response.data.length;i++){
  219. let obj ={
  220. value:response.data[i].dictValue,
  221. label:response.data[i].dictLabel,
  222. }
  223. list.push(obj);
  224. }
  225. this.$set(this.searchData.searchList[2],'universal',list);
  226. })
  227. },
  228. //获取化学品柜列表
  229. getNoauthList(){
  230. getNoauthList().then(response => {
  231. let list = [];
  232. for(let i=0;i<response.rows.length;i++){
  233. let obj ={
  234. value:response.rows[i].id,
  235. label:response.rows[i].cabinetName,
  236. }
  237. list.push(obj);
  238. }
  239. this.$set(this.searchData.searchList[4],'universal',list);
  240. });
  241. },
  242. //获取学院列表
  243. listDepartments(){
  244. listDepartments().then(response => {
  245. let list = [];
  246. for(let i=0;i<response.data.length;i++){
  247. let obj ={
  248. value:response.data[i].deptId,
  249. label:response.data[i].deptName,
  250. }
  251. list.push(obj);
  252. }
  253. this.$set(this.searchData.searchList[3],'universal',list);
  254. });
  255. },
  256. //获取化学品分类列表
  257. classifyList(){
  258. classifyList().then(response => {
  259. let list = [];
  260. for(let i=0;i<response.rows.length;i++){
  261. let obj ={
  262. value:response.rows[i].id,
  263. label:response.rows[i].classifyName,
  264. }
  265. list.push(obj);
  266. }
  267. this.$set(this.searchData.searchList[1],'universal',list);
  268. });
  269. },
  270. getList(){
  271. getListOut(this.queryParams).then(response => {
  272. this.total = response.total;
  273. this.tableList = response.rows;
  274. });
  275. },
  276. //父组件必要此方法用于接收参数
  277. searchClick(type,data){
  278. let self = this;
  279. if(type == 1){ //type 1.查询
  280. this.queryParams = JSON.parse(JSON.stringify(data));
  281. if(data.timeOne){
  282. this.queryParams.outTimeBegin = data.timeOne[0];
  283. this.queryParams.outTimeEnd = data.timeOne[1];
  284. delete this.queryParams.timeOne
  285. }else{
  286. delete this.queryParams.timeOne
  287. }
  288. this.queryParams.pageNum = 1;
  289. this.queryParams.pageSize = 20;
  290. this.getList();
  291. }else if(type == 2){ //type 1.重置
  292. this.queryParams = {
  293. pageNum : 1,
  294. pageSize:20,
  295. };
  296. this.getList();
  297. }else if(type == 'export'){ //type 其他 自定义按钮
  298. let currentDate = this.getCurrentTime()
  299. if(data == 1){
  300. //导出全部
  301. self.$confirm(`确认导出全部数据?`, "提示", {
  302. confirmButtonText: "确定",
  303. cancelButtonText: "取消",
  304. type: "warning"
  305. }).then(async () => {
  306. self.download('/chemical/hxpStock/exportOut/', {...self.queryParams}, '出库记录-'+currentDate+'.xlsx')
  307. }).catch(() => {})
  308. }else if(data == 2){
  309. //导出选中
  310. if(self.ids.length>0) {
  311. self.$confirm(`确认导出选中数据?`, "提示", {
  312. confirmButtonText: "确定",
  313. cancelButtonText: "取消",
  314. type: "warning"
  315. }).then(async () => {
  316. let ids = self.ids.join(',');
  317. let obj = {
  318. ids :ids
  319. }
  320. self.download(`/chemical/hxpStock/exportOut/`,obj, '出库记录-'+currentDate+'.xlsx')
  321. }).catch(() => {})
  322. }else {
  323. this.msgError('请选择要导出的数据')
  324. }
  325. }
  326. }
  327. },
  328. /** 当前时间 */
  329. getCurrentTime () {
  330. const yy = new Date().getFullYear()
  331. const mm = new Date().getMonth() + 1
  332. const dd = new Date().getDate()
  333. const hh = new Date().getHours()
  334. const mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
  335. const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
  336. return yy + '-' + mm + '-' + dd
  337. },
  338. // 多选框选中数据
  339. handleSelectionChange(selection) {
  340. this.selectedNum = selection.length;
  341. this.ids = selection.map(item => item.id);
  342. this.single = selection.length != 1;
  343. this.multiple = !selection.length;
  344. },
  345. /*===记录勾选数据===
  346. 需要再el-table 添加 :row-key="getRowKeys"
  347. 需要在selection 添加 :reserve-selection="true"
  348. */
  349. getRowKeys(row) {
  350. return row.id
  351. },
  352. }
  353. }
  354. </script>
  355. <style scoped lang="scss">
  356. .OutboundRecord{
  357. flex:1;
  358. display: flex;
  359. flex-direction: column;
  360. overflow: hidden!important;
  361. padding-top:20px!important;
  362. p{
  363. margin:0;
  364. padding:0;
  365. }
  366. .OutboundRecord-min{
  367. flex:1;
  368. display: flex;
  369. flex-direction: column;
  370. overflow: hidden!important;
  371. padding:0 20px 20px!important;
  372. }
  373. }
  374. </style>