index.vue 15 KB

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