commonpopup.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. <template>
  2. <view class="pop-container">
  3. <uni-popup ref="popup" type="dialog" >
  4. <uni-popup-dialog
  5. :title="title"
  6. message=""
  7. :duration="2000"
  8. :before-close="true"
  9. @close="handleCancel"
  10. @confirm="handleOk">
  11. <view class="dialog-content">
  12. <view class="header-container">
  13. <uni-row class="demo-uni-row">
  14. <uni-col :span="5" style="padding-left: 10px;text-align: center" >
  15. <view class="gjz-title">关键字</view>
  16. </uni-col>
  17. <uni-col :span="19">
  18. <uni-search-bar
  19. v-model="keyWord"
  20. @input="input"
  21. @cancel="cancel"
  22. @clear="clear"
  23. cancelButton="none"
  24. />
  25. </uni-col>
  26. </uni-row>
  27. <uni-row class="demo-uni-row">
  28. <uni-col :span="24" style="text-align: center;">
  29. <button class="mini-btn" type="primary" size="mini" @click="search">查询</button>
  30. </uni-col>
  31. </uni-row>
  32. </view>
  33. <view style="height: 200px">
  34. <zb-table
  35. ref="zbTable"
  36. :show-header="true"
  37. :stripe="false"
  38. :columns="column"
  39. :data="data"
  40. :highlight="true"
  41. @currentChange="currentChange"
  42. :border="true"
  43. >
  44. </zb-table>
  45. </view>
  46. </view>
  47. <!-- <view slot="footer">
  48. <button type="primary" @click="handleOk">确定</button>
  49. <button @click="handleCancel">取消</button>
  50. </view> -->
  51. </uni-popup-dialog>
  52. </uni-popup>
  53. </view>
  54. </template>
  55. <script>
  56. import { getDicts } from "@/api/system/dict/data"; // 字典
  57. import { listStockMove, ListStockMoveHead, listTaskMove, listRwbm, listDepartment, listEmployee, listExtend, listWarehouse, listLocation, listUser, listPallet, listPackage, listCurrent, listCustomer } from "@/api/wms/stockMove.js";
  58. export default {
  59. props: {
  60. title: {
  61. type: String,
  62. required: true
  63. },
  64. idxFlag:{
  65. type: String,
  66. required: true
  67. },
  68. formData:{
  69. type: Object,
  70. require: true
  71. }
  72. },
  73. mounted() {
  74. },
  75. created: function(option) {
  76. },
  77. data() {
  78. return {
  79. currentFlag: '',
  80. keyWord: '', // 输入查询的值
  81. column: [], // 表头数据
  82. data: [], // 表体数据
  83. currentSelectData: {}, //当前选中数据行
  84. };
  85. },
  86. methods:{
  87. handleOk() {
  88. let returnData = {
  89. currentFlag: this.currentFlag,
  90. selectData: this.currentSelectData
  91. }
  92. this.$emit("sendData", returnData);
  93. // 点击确定按钮的处理逻辑
  94. this.currentSelectData = {}
  95. this.$refs.popup.close()
  96. },
  97. handleCancel() {
  98. // 点击取消按钮的处理逻辑
  99. this.$refs.popup.close()
  100. },
  101. showPopup() {
  102. // 传递的哪个跳转标志位
  103. this.currentFlag = this.idxFlag;
  104. let that = this;
  105. let cFlag = that.idxFlag;
  106. switch (cFlag){
  107. case "rwbm": //任务编码
  108. // 出库类型
  109. let inTypeObj = {}
  110. getDicts("out_type").then(response => {
  111. // that.inTypeOption = response.data;
  112. let tmpArr = response.data;
  113. if(tmpArr.length > 0){
  114. tmpArr.forEach((item,index)=>{
  115. inTypeObj[item.dictValue] = item.dictLabel;
  116. })
  117. }
  118. });
  119. // 任务编码表头
  120. that.column = [
  121. { name: 'taskCode', label:'任务编号', width:170,align:'center', emptyString:'--' },
  122. { name: 'taskDate', label:'任务日期', width:120,align:'center', emptyString:'--'},
  123. ];
  124. that.getRwbmList();
  125. break;
  126. case "bmOut": // 部门
  127. case "bmIn":
  128. // 部门表头
  129. that.column = [
  130. { name: 'deptCode', label:'部门编码', width:130,align:'center', emptyString:'--' },
  131. { name: 'deptName', label:'部门名称', width:120,align:'center', emptyString:'--'},
  132. ];
  133. that.getBmList();
  134. break;
  135. case "zyOut": // 移出职员
  136. // 职员表头
  137. that.column = [
  138. { name: 'employeeCode', label:'职员编码', width:120,align:'center', emptyString:'--' },
  139. { name: 'employeeName', label:'职员名称', width:100,align:'center', emptyString:'--'},
  140. ];
  141. that.getZyOutList();
  142. break;
  143. case "zyIn": // 移入职员
  144. // 职员表头
  145. that.column = [
  146. { name: 'employeeCode', label:'职员编码', width:120,align:'center', emptyString:'--' },
  147. { name: 'employeeName', label:'职员名称', width:100,align:'center', emptyString:'--'},
  148. ];
  149. that.getZyInList();
  150. break;
  151. // case "zyIn":
  152. // // 职员表头
  153. // that.column = [
  154. // { name: 'employeeCode', label:'职员编码', width:120,align:'center', emptyString:'--' },
  155. // { name: 'employeeName', label:'职员名称', width:100,align:'center', emptyString:'--'},
  156. // ];
  157. // that.getZyList();
  158. // break;
  159. case "sflbOut": // 出库类别
  160. that.column = [
  161. { name: 'extendClassName', label:'类', width:60, align:'center', emptyString:'--' },
  162. { name: 'extendCode', label:'编码', width:100, align:'center', emptyString:'--'},
  163. { name: 'extendName', label: '名称', width:150, align:'center', emptyString:'--'},
  164. ];
  165. that.getSflbOutList();
  166. break;
  167. case "sflbIn": // 入库类别
  168. that.column = [
  169. { name: 'extendClassName', label:'类', width:60, align:'center', emptyString:'--' },
  170. { name: 'extendCode', label:'编码', width:100, align:'center', emptyString:'--'},
  171. { name: 'extendName', label: '名称', width:150, align:'center', emptyString:'--'},
  172. ];
  173. that.getSflbInList();
  174. break;
  175. case "khIn": // 入客户
  176. that.column = [
  177. { name: 'customerCode', label:'客户编码', width:100,align:'center', emptyString:'--' },
  178. { name: 'customerName', label:'客户名称', width:300,align:'center', emptyString:'--'},
  179. ];
  180. that.getKhList();
  181. break;
  182. case "tpIn": // 托盘
  183. // 托盘表头
  184. that.column = [
  185. { name: 'palletCode', label:'托盘编码', width:100, align:'center', emptyString:'--'},
  186. { name: 'palletName', label: '托盘名称', width:130, align:'center', emptyString:'--'},
  187. ];
  188. that.getTpList();
  189. break;
  190. case "bzIn": // 包装
  191. // 包装表头
  192. that.column = [
  193. { name: 'packageCode', label:'包装编码', width:100, align:'center', emptyString:'--'},
  194. { name: 'packageName', label: '包装名称', width:130, align:'center', emptyString:'--'},
  195. ];
  196. that.getBzList();
  197. break;
  198. case "wareOut": // 仓库
  199. case "wareIn":
  200. // 仓库表头
  201. that.column = [
  202. { name: 'warehouseCode', label:'仓库编码', width:110, align:'center', emptyString:'--'},
  203. { name: 'warehouseName', label: '仓库名称', width:140, align:'center', emptyString:'--'},
  204. ];
  205. that.getWareList();
  206. break;
  207. case "locaOut": //移出货位选库存
  208. that.column = [
  209. { name: 'locationCode', label:'货位编码', width:140, align:'center', emptyString:'--'},
  210. { name: 'stockQty', label: '数量', width:120, align:'center', emptyString:'--'},
  211. ];
  212. that.getCurrList();
  213. break;
  214. case "locaIn": //移入货位
  215. that.column = [
  216. { name: 'locationCode', label:'货位编码', width:140, align:'center', emptyString:'--'},
  217. { name: 'locationName', label: '货位名称', width:180, align:'center', emptyString:'--'},
  218. ];
  219. that.getLocaList();
  220. break;
  221. case "shr": // 审核人
  222. that.column = [
  223. { name: 'userId', label:'编码', width:120,align:'center', emptyString:'--' },
  224. { name: 'nickName', label:'名称', width:100,align:'center', emptyString:'--'},
  225. ];
  226. that.getShrList();
  227. break;
  228. case "stock": // 单据
  229. that.column = [
  230. { name: 'stockCode', label:'单据编号', width:150, align:'center', emptyString:'--'},
  231. { name: 'deptName', label: '部门', width:130, align:'center', emptyString:'--'},
  232. { name: 'warehouseName', label: '仓库', width:150, align:'center', emptyString:'--'},
  233. { name: 'rowCount', label: '行数', width:90, align:'center', emptyString:'--'},
  234. ];
  235. that.getStockList();
  236. break;
  237. default:
  238. break;
  239. }
  240. },
  241. hidePopup() {
  242. this.$refs.popup.close();
  243. },
  244. // 单选当前行
  245. currentChange(row,index){
  246. this.currentSelectData = row;
  247. },
  248. // searchBar
  249. input(value) {// uniSearchBar 的 value 改变时触发事件,返回参数为uniSearchBar的 value e=value
  250. this.keyWord = value;
  251. },
  252. clear(res) {
  253. this.keyWord = "";
  254. },
  255. cancel(res) {
  256. this.keyWord = "";
  257. },
  258. // 查询按钮点击事件
  259. search(){
  260. let that = this;
  261. let cFlag = that.idxFlag;
  262. switch (cFlag){
  263. case "rwbm": // 任务编码
  264. this.getRwbmList();
  265. break;
  266. case "bmOut": // 部门
  267. case "bmIn":
  268. that.getBmList();
  269. break;
  270. case "zyOut": // 移出职员
  271. this.getZyOutList();
  272. break;
  273. case "zyIn": // 移入职员
  274. this.getZyInList();
  275. break;
  276. case "sflbOut": // 出库类别
  277. this.getSflbOutList();
  278. break;
  279. case "sflbIn": //入库类别
  280. this.getSflbInList();
  281. break;
  282. case "khIn": //入客户
  283. this.getKhList();
  284. break;
  285. case "tpIn": //托盘
  286. this.getTpList();
  287. break;
  288. case "bzIn": //包装
  289. that.getBzList();
  290. break;
  291. case "wareOut": // 仓库
  292. case "wareIn":
  293. this.getWareList();
  294. break;
  295. case "locaOut": // 货位
  296. this.getCurrList();
  297. break;
  298. case "locaIn":
  299. this.getLocaList();
  300. break;
  301. case "shr": // 审核人
  302. this.getShrList();
  303. break;
  304. case "stock": //单据
  305. this.getStockList();
  306. break;
  307. default:
  308. break;
  309. }
  310. },
  311. // 审核人
  312. getShrList(){
  313. let that = this;
  314. let params = {
  315. status: '0', //(固定)
  316. params: {
  317. "userids": that.formData.userids,
  318. "keyWord":that.keyWord,
  319. "limit":50
  320. },
  321. }
  322. listUser(params).then(res => {
  323. if(res.code === 200){
  324. that.data = res.rows;
  325. this.$refs.popup.open();
  326. }
  327. });
  328. },
  329. // 仓库数据
  330. getWareList(){
  331. let that = this;
  332. let params = {
  333. status: '0', //(固定)
  334. params: {
  335. "keyWord":that.keyWord,
  336. "limit":50
  337. },
  338. }
  339. listWarehouse(params).then(res => {
  340. if(res.code === 200){
  341. that.data = res.rows;
  342. this.$refs.popup.open();
  343. }
  344. });
  345. },
  346. // 现存量
  347. getCurrList(){
  348. let that = this;
  349. let params = {
  350. params: {
  351. "limit":50
  352. },
  353. labelCode: that.formData.labelCode,
  354. warehouseCode: that.formData.warehouseCodeOut,
  355. }
  356. listCurrent(params).then(res => {
  357. if(res.code === 200){
  358. that.data = res.rows;
  359. this.$refs.popup.open();
  360. }
  361. });
  362. },
  363. // 货位数据
  364. getLocaList(){
  365. let that = this;
  366. let params = {
  367. status: '0', //(固定)
  368. warehouseCode: that.formData.warehouseCodeIn,
  369. params: {
  370. "keyWord":that.keyWord,
  371. "limit":50
  372. },
  373. }
  374. listLocation(params).then(res => {
  375. if(res.code === 200){
  376. that.data = res.rows;
  377. this.$refs.popup.open();
  378. }
  379. });
  380. },
  381. // 获取任务编码数据
  382. getRwbmList(){
  383. let that = this;
  384. let params = {
  385. billTypeCode: that.formData.taskBillTypeCode,
  386. isControlTask: that.formData.isControlTask,
  387. params: {
  388. "keyWord":that.keyWord,
  389. "limit":50
  390. },
  391. }
  392. listTaskMove(params).then(res => {
  393. if(res.code === 200){
  394. console.log(res)
  395. that.data = res.rows.map(item => {
  396. let a1 = item.wmsTaskMoves;
  397. let a2 = item;
  398. return Object.assign({}, a2, a1);
  399. });
  400. this.$refs.popup.open();
  401. }
  402. });
  403. },
  404. // 获取部门数据
  405. getBmList(){
  406. let that = this;
  407. let params = {
  408. status: '0', //(固定)
  409. params: {
  410. "keyWord":that.keyWord,
  411. "limit":50
  412. },
  413. }
  414. listDepartment(params).then(res => {
  415. if(res.code === 200){
  416. that.data = res.rows;
  417. this.$refs.popup.open();
  418. }
  419. });
  420. },
  421. // 移出职员
  422. getZyOutList(){
  423. let that = this;
  424. if(that.formData.deptCode === ""){
  425. uni.showToast({
  426. title: "请先选择部门",
  427. icon: "none",
  428. })
  429. return;
  430. }
  431. let params = {
  432. status: '0', //(固定)
  433. deptCode: that.formData.deptCodeOut,
  434. params: {
  435. "keyWord":that.keyWord,
  436. "limit":50
  437. },
  438. }
  439. listEmployee(params).then(res => {
  440. if(res.code === 200){
  441. that.data = res.rows;
  442. this.$refs.popup.open();
  443. }
  444. });
  445. },
  446. // 移入职员
  447. getZyInList(){
  448. let that = this;
  449. if(that.formData.deptCode === ""){
  450. uni.showToast({
  451. title: "请先选择部门",
  452. icon: "none",
  453. })
  454. return;
  455. }
  456. let params = {
  457. status: '0', //(固定)
  458. deptCode: that.formData.deptCodeIn,
  459. params: {
  460. "keyWord":that.keyWord,
  461. "limit":50
  462. },
  463. }
  464. listEmployee(params).then(res => {
  465. if(res.code === 200){
  466. that.data = res.rows;
  467. this.$refs.popup.open();
  468. }
  469. });
  470. },
  471. // 获取收发类别数据
  472. getSflbOutList(){
  473. let that = this;
  474. let params = {
  475. extendClassCode: "01.02",
  476. params: {
  477. "keyWord":that.keyWord,
  478. "limit":50
  479. },
  480. }
  481. listExtend(params).then(res => {
  482. if(res.code === 200){
  483. that.data = res.rows;
  484. this.$refs.popup.open();
  485. }
  486. });
  487. },
  488. getSflbInList(){
  489. let that = this;
  490. let params = {
  491. extendClassCode: "01.01",
  492. params: {
  493. "keyWord":that.keyWord,
  494. "limit":50
  495. },
  496. }
  497. listExtend(params).then(res => {
  498. if(res.code === 200){
  499. that.data = res.rows;
  500. this.$refs.popup.open();
  501. }
  502. });
  503. },
  504. // 获取客户数据
  505. getKhList(){
  506. let that = this;
  507. let params = {
  508. status: '0', //(固定)
  509. params: {
  510. "keyWord":that.keyWord,
  511. "limit":50
  512. },
  513. }
  514. listCustomer(params).then(res => {
  515. if(res.code === 200){
  516. that.data = res.rows;
  517. this.$refs.popup.open();
  518. }
  519. });
  520. },
  521. getTpList(){
  522. let that = this;
  523. let params = {
  524. status: '0',
  525. params: {
  526. "keyWord":that.keyWord,
  527. "limit":50
  528. },
  529. }
  530. listPallet(params).then(res => {
  531. if(res.code === 200){
  532. that.data = res.rows;
  533. this.$refs.popup.open();
  534. }
  535. });
  536. },
  537. getBzList(){
  538. let that = this;
  539. let params = {
  540. status: '0',
  541. params: {
  542. "keyWord":that.keyWord,
  543. "limit":50
  544. },
  545. }
  546. listPackage(params).then(res => {
  547. if(res.code === 200){
  548. that.data = res.rows;
  549. this.$refs.popup.open();
  550. }
  551. });
  552. },
  553. getStockList(){
  554. let that = this;
  555. let params = {
  556. params: {
  557. "keyWord":that.keyWord,
  558. "limit":50
  559. },
  560. }
  561. ListStockMoveHead(params).then(res => {
  562. if(res.code === 200){
  563. that.data = res.rows;
  564. this.$refs.popup.open();
  565. }
  566. });
  567. },
  568. },
  569. }
  570. </script>
  571. <style>
  572. @import "@/static/scss/commonpopup.css"
  573. </style>