index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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" v-if="scope.row.closeLockVideo">
  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. videoCover:window.location.href.split('://')[0]+'://' + this.judgmentNetworkReturnAddress() + "/admin/" + localStorage.getItem('videoCover'),
  79. searchData:{
  80. searchList:[//搜索数组
  81. {
  82. name:"关键字",//描述名称
  83. key:"searchValue",//键名 用于返回数据
  84. value:"",//内容 用于组件内绑定数据
  85. placeholder:"化学品名/别名/CAS号/编号/实验室",//输入提示
  86. level:"1",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  87. type:"1",//类型 1.input 2.select 3.TimePicker
  88. universal:'20',//通用参数 input时为最大长度 //TimePicker时可不传
  89. labelWidth:'68px',//label-width宽度 可传可不传 不传时为默认宽度
  90. width:'260',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  91. },
  92. {
  93. name:"化学品分类",//描述名称
  94. key:"chemicalClassify",//键名 用于返回数据
  95. value:"",//内容 用于组件内绑定数据
  96. placeholder:"请选择化学品分类",//输入提示
  97. level:"2",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  98. type:"2",//类型 1.input 2.select 3.TimePicker
  99. universal:[],
  100. width:'175',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  101. },
  102. {
  103. name:"属性",//描述名称
  104. key:"classifyAttribute",//键名 用于返回数据
  105. value:"",//内容 用于组件内绑定数据
  106. placeholder:"请选择属性",//输入提示
  107. level:"2",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  108. type:"2",//类型 1.input 2.select 3.TimePicker
  109. universal:[],
  110. width:'175',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  111. },
  112. {
  113. name:"学院",//描述名称
  114. key:"deptId",//键名 用于返回数据
  115. value:"",//内容 用于组件内绑定数据
  116. placeholder:"请选择学院",//输入提示
  117. level:"2",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  118. type:"2",//类型 1.input 2.select 3.TimePicker
  119. universal:[],
  120. width:'175',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  121. },
  122. {
  123. name:"化学品柜",//描述名称
  124. key:"cabinetId",//键名 用于返回数据
  125. value:"",//内容 用于组件内绑定数据
  126. placeholder:"请选择化学品柜",//输入提示
  127. level:"1",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  128. type:"2",//类型 1.input 2.select 3.TimePicker
  129. universal:[],
  130. width:'175',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  131. },
  132. {
  133. name:"出库方式",//描述名称
  134. key:"status",//键名 用于返回数据
  135. value:"",//内容 用于组件内绑定数据
  136. placeholder:"请选择出库方式",//输入提示
  137. level:"1",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  138. type:"2",//类型 1.input 2.select 3.TimePicker
  139. universal:[ //通用参数 select时为列表数据 //TimePicker时可不传
  140. {label:"用结",value:"2"},{label:"作废",value:"3"}
  141. ],
  142. width:'175',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  143. },
  144. {
  145. name:"标签类型",//描述名称
  146. key:"labelType",//键名 用于返回数据
  147. value:"",//内容 用于组件内绑定数据
  148. placeholder:"请选择标签类型",//输入提示
  149. level:"2",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  150. type:"2",//类型 1.input 2.select 3.TimePicker
  151. universal:[ //通用参数 select时为列表数据 //TimePicker时可不传
  152. {label:"RFID",value:"1"},{label:"二维码",value:"2"}
  153. ],
  154. labelWidth:'68px',//label-width宽度 可传可不传 不传时为默认宽度
  155. width:'260',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  156. },
  157. {
  158. name:"出库时间",//描述名称
  159. key:"timeOne",//键名 用于返回数据
  160. value:"",//内容 用于组件内绑定数据
  161. placeholder:"请选择出库时间",//输入提示
  162. level:"1",//1.普通搜索 2.高级搜索 普通搜索默认会在高级搜索时显示
  163. type:"3",//类型 1.input 2.select 3.TimePicker
  164. labelWidth:'82px',//label-width宽度 可传可不传 不传时为默认宽度
  165. width:'260',//el-form-item 长度 可传可不传 不传时input/select默认180长度 TimePicker默认240长度
  166. },
  167. ],
  168. },
  169. // 搜索实际发送数据
  170. queryParams:{
  171. pageNum:1,
  172. pageSize:20,
  173. },
  174. //数据数量
  175. total:0,
  176. //数据数组
  177. tableList:[],
  178. //表格扩展选择器---需要在@selection-change绑定的方法内监控selection数组长度
  179. selectedNum:0,
  180. // 选中数组
  181. ids: [],
  182. // 非单个禁用
  183. single: true,
  184. // 非多个禁用
  185. multiple: true,
  186. //视频操作
  187. videoType:false,
  188. videoData:{},
  189. videoTitle:"",
  190. };
  191. },
  192. created() {
  193. },
  194. mounted(){
  195. this.classifyList();
  196. this.listDepartments();
  197. this.getNoauthList();
  198. this.getHxpClassifyattribute();
  199. this.getList();
  200. },
  201. methods: {
  202. //视频按钮
  203. lockVideo(row){
  204. if(!row.closeLockVideo){
  205. this.msgError('开关锁视频异常无法观看');
  206. return
  207. }
  208. let obj = {
  209. url:window.location.href.split('://')[0]+'://' + this.judgmentNetworkReturnAddress() + "/admin/" + row.closeLockVideo
  210. }
  211. this.$set(this,'videoTitle','开关锁视频');
  212. this.$set(this,'videoData',obj);
  213. this.videoType = true;
  214. },
  215. //获取属性列表
  216. getHxpClassifyattribute(){
  217. this.getDicts("hxp_classifyattribute").then(response => {
  218. let list = [];
  219. for(let i=0;i<response.data.length;i++){
  220. let obj ={
  221. value:response.data[i].dictValue,
  222. label:response.data[i].dictLabel,
  223. }
  224. list.push(obj);
  225. }
  226. this.$set(this.searchData.searchList[2],'universal',list);
  227. })
  228. },
  229. //获取化学品柜列表
  230. getNoauthList(){
  231. getNoauthList({}).then(response => {
  232. let list = [];
  233. for(let i=0;i<response.data.length;i++){
  234. let obj ={
  235. value:response.data[i].id,
  236. label:response.data[i].cabinetName,
  237. }
  238. list.push(obj);
  239. }
  240. this.$set(this.searchData.searchList[4],'universal',list);
  241. });
  242. },
  243. //获取学院列表
  244. listDepartments(){
  245. listDepartments().then(response => {
  246. let list = [];
  247. for(let i=0;i<response.data.length;i++){
  248. let obj ={
  249. value:response.data[i].deptId,
  250. label:response.data[i].deptName,
  251. }
  252. list.push(obj);
  253. }
  254. this.$set(this.searchData.searchList[3],'universal',list);
  255. });
  256. },
  257. //获取化学品分类列表
  258. classifyList(){
  259. classifyList().then(response => {
  260. let list = [];
  261. for(let i=0;i<response.rows.length;i++){
  262. let obj ={
  263. value:response.rows[i].id,
  264. label:response.rows[i].classifyName,
  265. }
  266. list.push(obj);
  267. }
  268. this.$set(this.searchData.searchList[1],'universal',list);
  269. });
  270. },
  271. getList(){
  272. getListOut(this.queryParams).then(response => {
  273. this.total = response.total;
  274. this.tableList = response.rows;
  275. });
  276. },
  277. //父组件必要此方法用于接收参数
  278. searchClick(type,data){
  279. let self = this;
  280. if(type == 1){ //type 1.查询
  281. this.queryParams = JSON.parse(JSON.stringify(data));
  282. if(data.timeOne){
  283. this.queryParams.outTimeBegin = data.timeOne[0];
  284. this.queryParams.outTimeEnd = data.timeOne[1];
  285. delete this.queryParams.timeOne
  286. }else{
  287. delete this.queryParams.timeOne
  288. }
  289. this.queryParams.pageNum = 1;
  290. this.queryParams.pageSize = 20;
  291. this.getList();
  292. }else if(type == 2){ //type 1.重置
  293. this.queryParams = {
  294. pageNum : 1,
  295. pageSize:20,
  296. };
  297. this.getList();
  298. }else if(type == 'export'){ //type 其他 自定义按钮
  299. let currentDate = this.getCurrentTime()
  300. if(data == 1){
  301. //导出全部
  302. self.$confirm(`确认导出全部数据?`, "提示", {
  303. confirmButtonText: "确定",
  304. cancelButtonText: "取消",
  305. type: "warning"
  306. }).then(async () => {
  307. self.download('/chemical/hxpStock/exportOut/', {...self.queryParams}, '出库记录-'+currentDate+'.xlsx')
  308. }).catch(() => {})
  309. }else if(data == 2){
  310. //导出选中
  311. if(self.ids.length>0) {
  312. self.$confirm(`确认导出选中数据?`, "提示", {
  313. confirmButtonText: "确定",
  314. cancelButtonText: "取消",
  315. type: "warning"
  316. }).then(async () => {
  317. let ids = self.ids.join(',');
  318. let obj = {
  319. ids :ids
  320. }
  321. self.download(`/chemical/hxpStock/exportOut/`,obj, '出库记录-'+currentDate+'.xlsx')
  322. }).catch(() => {})
  323. }else {
  324. this.msgError('请选择要导出的数据')
  325. }
  326. }
  327. }
  328. },
  329. /** 当前时间 */
  330. getCurrentTime () {
  331. const yy = new Date().getFullYear()
  332. const mm = new Date().getMonth() + 1
  333. const dd = new Date().getDate()
  334. const hh = new Date().getHours()
  335. const mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
  336. const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
  337. return yy + '-' + mm + '-' + dd
  338. },
  339. // 多选框选中数据
  340. handleSelectionChange(selection) {
  341. this.selectedNum = selection.length;
  342. this.ids = selection.map(item => item.id);
  343. this.single = selection.length != 1;
  344. this.multiple = !selection.length;
  345. },
  346. /*===记录勾选数据===
  347. 需要再el-table 添加 :row-key="getRowKeys"
  348. 需要在selection 添加 :reserve-selection="true"
  349. */
  350. getRowKeys(row) {
  351. return row.id
  352. },
  353. }
  354. }
  355. </script>
  356. <style scoped lang="scss">
  357. .OutboundRecord{
  358. flex:1;
  359. display: flex;
  360. flex-direction: column;
  361. overflow: hidden!important;
  362. padding-top:20px!important;
  363. p{
  364. margin:0;
  365. padding:0;
  366. }
  367. .OutboundRecord-min{
  368. flex:1;
  369. display: flex;
  370. flex-direction: column;
  371. overflow: hidden!important;
  372. padding:0 20px 20px!important;
  373. }
  374. }
  375. </style>