You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1232 lines
41 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <div class="mod-config">
  3. <el-row>
  4. <el-col :span="24">
  5. <div>
  6. <span @click="favoriteFunction()">
  7. <icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
  8. </span>
  9. </div>
  10. <el-button @click="getDataList()" type="primary">查询</el-button>
  11. <el-button @click="initModel()" type="primary">新增</el-button>
  12. <!-- <el-button @click="saveColumnList()" type="primary" v-show="showDefault">设置默认配置</el-button>-->
  13. <!-- <el-button @click="userSetting" type="primary">设置列表</el-button>-->
  14. <download-excel
  15. :fields="fields()"
  16. :data="exportData"
  17. type="xls"
  18. :name="exportName"
  19. :header="exportHeader"
  20. :footer="exportFooter"
  21. :defaultValue="exportDefaultValue"
  22. :fetch="createExportData"
  23. :before-generate="startDownload"
  24. :before-finish="finishDownload"
  25. worksheet="导出信息"
  26. class="el-button el-button--primary el-button--medium">
  27. 导出
  28. </download-excel>
  29. <el-button v-if="isAuth(':prd:delete')" type="danger" @click="deleteHandle()"
  30. :disabled="dataListSelections.length <= 0">{{ buttons.deleteList}}
  31. </el-button>
  32. </el-col>
  33. </el-row>
  34. <el-row>
  35. <el-col :span="24">
  36. <el-form :inline="true" label-position="top">
  37. <el-form-item :label="inputLabel.headerInput.label1">
  38. <el-input style="width: 100px;" v-model="queryHeaderData.locationId"></el-input>
  39. </el-form-item>
  40. <el-form-item :label="inputLabel.headerInput.label2">
  41. <el-input style="width: 100px;" v-model="queryHeaderData.locationName"></el-input>
  42. </el-form-item>
  43. <el-form-item :label="inputLabel.headerInput.label3">
  44. <el-select v-model="queryHeaderData.warehouseId" placeholder="请选择" style="width: 115px;">
  45. <el-option label="全部" value=""></el-option>
  46. <el-option
  47. v-for="item in selectList.select2"
  48. :key="item.value"
  49. :label="item.label"
  50. :value="item.value">
  51. </el-option>
  52. </el-select>
  53. </el-form-item>
  54. <el-form-item :label="inputLabel.headerInput.label4">
  55. <el-select v-model="queryHeaderData.active" placeholder="请选择" style="width: 115px;">
  56. <el-option label="全部" value=""></el-option>
  57. <el-option
  58. v-for="item in selectList.select1"
  59. :key="item.value"
  60. :label="item.label"
  61. :value="item.value">
  62. </el-option>
  63. </el-select>
  64. </el-form-item>
  65. </el-form>
  66. </el-col>
  67. </el-row>
  68. <el-row>
  69. <el-col :span="24">
  70. <el-table
  71. id="commmon"
  72. :height="height"
  73. :data="dataList"
  74. border
  75. v-loading="dataListLoading"
  76. @selection-change="selectionChangeHandle"
  77. style="width: 100%;">
  78. <el-table-column
  79. v-for="(item,index) in columnList" :key="index"
  80. :sortable="item.columnSortable"
  81. :prop="item.columnProp"
  82. :header-align="item.headerAlign"
  83. :show-overflow-tooltip="item.showOverflowTooltip"
  84. :align="item.align"
  85. :fixed="item.fixed==''?false:item.fixed"
  86. :width="item.columnWidth"
  87. :label="item.columnLabel">
  88. <template slot-scope="scope">
  89. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  90. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  91. style="width: 100px; height: 80px"/></span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column
  95. fixed="right"
  96. header-align="center"
  97. align="center"
  98. width="90"
  99. :label="操作">
  100. <template slot-scope="scope">
  101. <a @click="initModel(scope.row)">编辑</a>
  102. <a @click="delHeaderData(scope.row)">删除</a>
  103. </template>
  104. </el-table-column>
  105. </el-table>
  106. <el-pagination
  107. @size-change="sizeChangeHandle"
  108. @current-change="currentChangeHandle"
  109. :current-page="queryHeaderData.page"
  110. :page-sizes="[5, 10, 20]"
  111. :page-size="queryHeaderData.size"
  112. :total="queryHeaderData.totalCount"
  113. layout="total, sizes, prev, pager, next, jumper">
  114. </el-pagination>
  115. </el-col>
  116. </el-row>
  117. <column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column>
  118. <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag
  119. :title="inputLabel.headerInput.label5" :visible.sync="setUp.reviewFlag" width="325px">
  120. <el-form :inline="true" label-position="top">
  121. <el-form-item :label="inputLabel.headerInput.label1">
  122. <el-input style="width: 130px;" :readonly="setUp.readonlyFlag?'readonly':false" v-model="saveHeaderData.locationId"></el-input>
  123. </el-form-item>
  124. <el-form-item :label="inputLabel.headerInput.label2">
  125. <el-input style="width: 130px;" v-model="saveHeaderData.locationName"></el-input>
  126. </el-form-item>
  127. </el-form>
  128. <el-form :inline="true" label-position="top">
  129. <el-form-item :label="inputLabel.headerInput.label3">
  130. <el-select v-model="saveHeaderData.warehouseId" :disabled="setUp.readonlyFlag?'disabled':false" placeholder="请选择" style="width: 130px;">
  131. <el-option
  132. v-for="item in selectList.select2"
  133. :key="item.value"
  134. :label="item.label"
  135. :value="item.value">
  136. </el-option>
  137. </el-select>
  138. </el-form-item>
  139. <el-form-item :label="inputLabel.headerInput.label4">
  140. <el-select v-model="saveHeaderData.active" :disabled="setUp.readonlyFlag?'disabled':false" placeholder="请选择" style="width: 130px;">
  141. <el-option
  142. v-for="item in selectList.select1"
  143. :key="item.value"
  144. :label="item.label"
  145. :value="item.value">
  146. </el-option>
  147. </el-select>
  148. </el-form-item>
  149. <el-form-item :label="inputLabel.headerInput.label8">
  150. <el-input style="width: 130px;" :readonly="setUp.readonlyFlag?'readonly':false" v-model="saveHeaderData.hold"></el-input>
  151. </el-form-item>
  152. <el-form-item :label="inputLabel.headerInput.label9">
  153. <el-input style="width: 130px;" :readonly="setUp.readonlyFlag?'readonly':false" v-model="saveHeaderData.row"></el-input>
  154. </el-form-item>
  155. <el-form-item :label="inputLabel.headerInput.label10">
  156. <el-input style="width: 130px;" :readonly="setUp.readonlyFlag?'readonly':false" v-model="saveHeaderData.storey"></el-input>
  157. </el-form-item>
  158. <el-form-item :label="inputLabel.headerInput.label11">
  159. <el-input style="width: 130px;" :readonly="setUp.readonlyFlag?'readonly':false" v-model="saveHeaderData.box"></el-input>
  160. </el-form-item>
  161. <el-form-item :label="inputLabel.headerInput.label6">
  162. <span style="cursor: pointer" slot="label" @click="queryLocationGruop"><a>位置组编码</a></span>
  163. <el-input style="width: 130px;" readonly v-model="saveHeaderData.locationGroupId"></el-input>
  164. </el-form-item>
  165. <el-form-item :label="inputLabel.headerInput.label7">
  166. <el-input style="width: 130px;" readonly v-model="saveHeaderData.locationGroupDesc"></el-input>
  167. </el-form-item>
  168. <el-form-item :label="inputLabel.headerInput.label12">
  169. <el-input style="width: 130px;" readonly v-model="saveHeaderData.locationType"></el-input>
  170. </el-form-item>
  171. </el-form>
  172. <span slot="footer" class="dialog-footer">
  173. <el-button type="primary" :disabled="setUp.saveButton" @click="saveHeaderFunction()">确定</el-button>
  174. <el-button type="primary" @click="setUp.reviewFlag = false">取消</el-button>
  175. </span>
  176. </el-dialog>
  177. <!-- 新增时位置组编码选择dialog-->
  178. <el-dialog title="物料选择" :close-on-click-modal="false" v-drag :visible.sync="localtionGruopFlag" width="520px">
  179. <div class="rq">
  180. <el-form :inline="true" label-position="top" :model="locationGruopModalData">
  181. <el-form-item :label="'物料编码'">
  182. <el-input v-model="locationGruopModalData.locationGroupId" clearable style="width: 120px"></el-input>
  183. </el-form-item>
  184. <el-form-item :label="'物料名称'">
  185. <el-input v-model="locationGruopModalData.locationGroupDesc" clearable style="width: 120px"></el-input>
  186. </el-form-item>
  187. <el-form-item :label="' '">
  188. <el-button type="primary" @click="queryLocationGruop">查询</el-button>
  189. </el-form-item>
  190. </el-form>
  191. <el-table
  192. :height="300"
  193. :data="locationGruopDataList"
  194. @row-dblclick="getRowData"
  195. border
  196. style="width: 100%;">
  197. <el-table-column
  198. v-for="(item,index) in locationGruop_colum" :key="index"
  199. :sortable="item.columnSortable"
  200. :prop="item.columnProp"
  201. :header-align="item.headerAlign"
  202. :show-overflow-tooltip="item.showOverflowTooltip"
  203. :align="item.align"
  204. :fixed="item.fixed==''?false:item.fixed"
  205. :min-width="item.columnWidth"
  206. :label="item.columnLabel">
  207. <template slot-scope="scope">
  208. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  209. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  210. </template>
  211. </el-table-column>
  212. </el-table>
  213. </div>
  214. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  215. <el-button type="primary" @click="localtionGruopFlag=false">关闭</el-button>
  216. </el-footer>
  217. </el-dialog>
  218. </div>
  219. </template>
  220. <script>
  221. import column from "../common/column";
  222. import {
  223. searchSysLanguagePackList,
  224. searchSysLanguageParam,
  225. searchFunctionButtonList,
  226. saveButtonList,
  227. searchSysLanguage,
  228. searchLanguageListByLanguageCode,
  229. saveSysLanguageOne
  230. } from "@/api/sysLanguage.js"
  231. import getLodop from '@/utils/LodopFuncs.js'
  232. import {
  233. saveTableDefaultList,
  234. saveTableUser,
  235. getTableDefaultListLanguage,
  236. getTableUserListLanguage,
  237. removerDefault,
  238. removerUser
  239. } from "@/api/table.js"
  240. import {
  241. userFavoriteList,
  242. saveUserFavorite,
  243. removeUserFavorite,
  244. } from '@/api/userFavorite.js'
  245. import {
  246. getWarehouseList,
  247. getLocationList,
  248. saveLocation,
  249. delLocation,
  250. queryAllLocationGruopList
  251. } from '@/api/warehouse/location.js'
  252. export default {
  253. components: {
  254. column
  255. },
  256. data() {
  257. return {
  258. saveHeaderData: {
  259. locationId: '',
  260. locationName: '',
  261. warehouseId: '',
  262. active: '',
  263. locationGroupId: '',
  264. locationGroupDesc: '',
  265. locationType:'',
  266. hold:'',
  267. row:'',
  268. storey:'',
  269. box:'',
  270. },
  271. locationGruopModalData: {
  272. locationGroupId: '',
  273. locationGroupDesc: ''
  274. },
  275. locationGruopDataList: [],
  276. localtionGruopFlag: false,
  277. queryHeaderData: {
  278. site: this.$store.state.user.site,
  279. locationId: '',
  280. locationName: '',
  281. warehouseId: '',
  282. active: '',
  283. page:1,
  284. size:5,
  285. totalCount:0
  286. },
  287. setUp: {
  288. reviewFlag: false,
  289. saveButton: false,
  290. reviewFlag1: false,
  291. readonlyFlag: false,
  292. },
  293. inputLabel: {
  294. headerInput: {
  295. label1: '库位编码',
  296. label2: '库位名称',
  297. label3: '仓库名称',
  298. label4: '状态',
  299. label5: '库位信息',
  300. label6: '位置组编码',
  301. label7: '位置组描述',
  302. label8: '货舱',
  303. label9: '行',
  304. label10: '层',
  305. label11: '箱',
  306. label12: '库位类型'
  307. },
  308. },
  309. selectList: {
  310. select1: [{
  311. value: 'Y',
  312. label: '启用'
  313. }, {
  314. value: 'N',
  315. label: '禁用'
  316. }],
  317. select2: [],
  318. },
  319. site: this.$store.state.user.site,
  320. userName: this.$store.state.user.name,
  321. // table高度
  322. height: 450,
  323. // 是否收藏
  324. favorite: false,
  325. addLanguage: false,
  326. functionId: this.$route.meta.menuId,
  327. tableId: this.$route.meta.menuId + 'LOTI01',
  328. value1: true,
  329. visible: false,
  330. showDefault: false,
  331. // 默认table 查询参数
  332. queryTable: {
  333. functionId: this.$route.meta.menuId,
  334. tableId: this.$route.meta.menuId + 'LOTI01',
  335. languageCode: this.$i18n.locale
  336. },
  337. // 用户table 查询参数
  338. queryTableUser: {
  339. userId: this.$store.state.user.name,
  340. functionId: this.$route.meta.menuId,
  341. tableId: this.$route.meta.menuId + 'LOTI01',
  342. status: true,
  343. languageCode: this.$i18n.locale
  344. },
  345. // 语言词典查询参数
  346. querySysLanguageParam: {
  347. languageCode: this.$i18n.locale
  348. },
  349. // 语言词典集合
  350. sysLanguageParams: [],
  351. // 用户table 配置集合
  352. userColumnList: [],
  353. // 展示列集
  354. locationGruop_colum:[
  355. {
  356. userId: this.$store.state.user.name,
  357. serialNumber: 'location2601locationGroupId',
  358. tableId: this.$route.meta.menuId + 'LOTI01',
  359. tableName: "locationGruopTable",
  360. columnProp: "locationGroupId",
  361. headerAlign: "center",
  362. align: "center",
  363. columnLabel: "位置组编码",
  364. columnHidden: false,
  365. columnImage: false,
  366. columnSortable: false,
  367. sortLv: 0,
  368. status: true,
  369. fixed: '',
  370. },
  371. {
  372. userId: this.$store.state.user.name,
  373. serialNumber: 'location2601locationGroupDesc',
  374. tableId: this.$route.meta.menuId + 'LOTI01',
  375. tableName: "locationGruopTable",
  376. columnProp: "locationGroupDesc",
  377. headerAlign: "center",
  378. align: "center",
  379. columnLabel: "位置组描述",
  380. columnHidden: false,
  381. columnImage: false,
  382. columnSortable: false,
  383. sortLv: 0,
  384. status: true,
  385. fixed: '',
  386. },
  387. {
  388. userId: this.$store.state.user.name,
  389. serialNumber: 'location2601locationType',
  390. tableId: this.$route.meta.menuId + 'LOTI01',
  391. tableName: "locationGruopTable",
  392. columnProp: "locationType",
  393. headerAlign: "center",
  394. align: "center",
  395. columnLabel: "位置组描述",
  396. columnHidden: false,
  397. columnImage: false,
  398. columnSortable: false,
  399. sortLv: 0,
  400. status: true,
  401. fixed: '',
  402. }
  403. ],
  404. columnList: [
  405. {
  406. userId: this.$store.state.user.name,
  407. serialNumber: 'location2601LocationId',
  408. tableId: this.$route.meta.menuId + 'LOTI01',
  409. tableName: "locationTable",
  410. columnProp: "locationId",
  411. headerAlign: "center",
  412. align: "center",
  413. columnLabel: "库位编码",
  414. columnHidden: false,
  415. columnImage: false,
  416. columnSortable: false,
  417. sortLv: 0,
  418. status: true,
  419. fixed: '',
  420. },
  421. {
  422. userId: this.$store.state.user.name,
  423. serialNumber: 'location2601LocationName',
  424. tableId: this.$route.meta.menuId + 'LOTI01',
  425. tableName: "locationTable",
  426. columnProp: "locationName",
  427. headerAlign: "center",
  428. align: "center",
  429. columnLabel: "库位名称",
  430. columnHidden: false,
  431. columnImage: false,
  432. columnSortable: false,
  433. sortLv: 0,
  434. status: true,
  435. fixed: '',
  436. },
  437. {
  438. userId: this.$store.state.user.name,
  439. serialNumber: 'location2601WarehouseId',
  440. tableId: this.$route.meta.menuId + 'LOTI01',
  441. tableName: "locationTable",
  442. columnProp: "warehouseId",
  443. headerAlign: "center",
  444. align: "center",
  445. columnLabel: "仓库编码",
  446. columnHidden: false,
  447. columnImage: false,
  448. columnSortable: false,
  449. sortLv: 0,
  450. status: true,
  451. fixed: '',
  452. },
  453. {
  454. userId: this.$store.state.user.name,
  455. serialNumber: 'location2601WarehouseName',
  456. tableId: this.$route.meta.menuId + 'LOTI01',
  457. tableName: "locationTable",
  458. columnProp: "warehouseName",
  459. headerAlign: "center",
  460. align: "center",
  461. columnLabel: "仓库名称",
  462. columnHidden: false,
  463. columnImage: false,
  464. columnSortable: false,
  465. sortLv: 0,
  466. status: true,
  467. fixed: '',
  468. },
  469. {
  470. userId: this.$store.state.user.name,
  471. serialNumber: 'location2601StrlocationGroupDesc',
  472. tableId: this.$route.meta.menuId + 'LOTI01',
  473. tableName: "locationTable",
  474. columnProp: "locationGroupDesc",
  475. headerAlign: "center",
  476. align: "center",
  477. columnLabel: "位置组描述",
  478. columnHidden: false,
  479. columnImage: false,
  480. columnSortable: false,
  481. sortLv: 0,
  482. status: true,
  483. fixed: '',
  484. },
  485. {
  486. userId: this.$store.state.user.name,
  487. serialNumber: 'location2601StrlocationGroupDesc',
  488. tableId: this.$route.meta.menuId + 'LOTI01',
  489. tableName: "locationTable",
  490. columnProp: "locationType",
  491. headerAlign: "center",
  492. align: "center",
  493. columnLabel: "库房类型",
  494. columnHidden: false,
  495. columnImage: false,
  496. columnSortable: false,
  497. sortLv: 0,
  498. status: true,
  499. fixed: '',
  500. },
  501. {
  502. userId: this.$store.state.user.name,
  503. serialNumber: 'location2601StrActive',
  504. tableId: this.$route.meta.menuId + 'LOTI01',
  505. tableName: "locationTable",
  506. columnProp: "hold",
  507. headerAlign: "center",
  508. align: "center",
  509. columnLabel: "货舱",
  510. columnHidden: false,
  511. columnImage: false,
  512. columnSortable: false,
  513. sortLv: 0,
  514. status: true,
  515. fixed: '',
  516. },
  517. {
  518. userId: this.$store.state.user.name,
  519. serialNumber: 'location2601StrActive',
  520. tableId: this.$route.meta.menuId + 'LOTI01',
  521. tableName: "locationTable",
  522. columnProp: "row",
  523. headerAlign: "center",
  524. align: "center",
  525. columnLabel: "行",
  526. columnHidden: false,
  527. columnImage: false,
  528. columnSortable: false,
  529. sortLv: 0,
  530. status: true,
  531. fixed: '',
  532. },
  533. {
  534. userId: this.$store.state.user.name,
  535. serialNumber: 'location2601StrActive',
  536. tableId: this.$route.meta.menuId + 'LOTI01',
  537. tableName: "locationTable",
  538. columnProp: "storey",
  539. headerAlign: "center",
  540. align: "center",
  541. columnLabel: "层",
  542. columnHidden: false,
  543. columnImage: false,
  544. columnSortable: false,
  545. sortLv: 0,
  546. status: true,
  547. fixed: '',
  548. },
  549. {
  550. userId: this.$store.state.user.name,
  551. serialNumber: 'location2601StrActive',
  552. tableId: this.$route.meta.menuId + 'LOTI01',
  553. tableName: "locationTable",
  554. columnProp: "box",
  555. headerAlign: "center",
  556. align: "center",
  557. columnLabel: "箱",
  558. columnHidden: false,
  559. columnImage: false,
  560. columnSortable: false,
  561. sortLv: 0,
  562. status: true,
  563. fixed: '',
  564. },
  565. {
  566. userId: this.$store.state.user.name,
  567. serialNumber: 'location2601StrActive',
  568. tableId: this.$route.meta.menuId + 'LOTI01',
  569. tableName: "locationTable",
  570. columnProp: "active",
  571. headerAlign: "center",
  572. align: "center",
  573. columnLabel: "状态",
  574. columnHidden: false,
  575. columnImage: false,
  576. columnSortable: false,
  577. sortLv: 0,
  578. status: true,
  579. fixed: '',
  580. },
  581. ],
  582. // 展示列集
  583. columnList1: [
  584. // {
  585. // userId: this.$store.state.user.name,
  586. // functionId: this.$route.meta.menuId,
  587. // tableId: "common1002",
  588. // tableName: "commonLanguage",
  589. // columnProp: "functionId",
  590. // headerAlign: "center",
  591. // align: "center",
  592. // columnLabel: "功能编码",
  593. // columnHidden: false,
  594. // columnImage: false,
  595. // columnSortable: false,
  596. // sortLv: 0,
  597. // status: true,
  598. // fixed: false
  599. // },
  600. // {
  601. // userId: this.$store.state.user.name,
  602. // functionId: this.$route.meta.menuId,
  603. // tableId: "common1002",
  604. // tableName: "commonLanguage",
  605. // columnProp: "objectId",
  606. // headerAlign: "center",
  607. // align: "center",
  608. // columnLabel: "序列化编码",
  609. // columnHidden: false,
  610. // columnImage: false,
  611. // columnSortable: false,
  612. // sortLv: 0,
  613. // status: true,
  614. // fixed: '',
  615. // },
  616. // {
  617. // userId: this.$store.state.user.name,
  618. // functionId: this.$route.meta.menuId,
  619. // tableId: "common1002",
  620. // tableName: "commonLanguage",
  621. // columnProp: "objectType",
  622. // headerAlign: "center",
  623. // align: "center",
  624. // columnLabel: "类型",
  625. // columnHidden: false,
  626. // columnImage: false,
  627. // columnSortable: false,
  628. // sortLv: 0,
  629. // status: true,
  630. // fixed: '',
  631. // },
  632. // {
  633. // userId: this.$store.state.user.name,
  634. // functionId: this.$route.meta.menuId,
  635. // tableId: "common1002",
  636. // tableName: "commonLanguage",
  637. // columnProp: "languageValue",
  638. // headerAlign: "center",
  639. // align: "center",
  640. // columnLabel: "语言值",
  641. // columnHidden: false,
  642. // columnImage: false,
  643. // columnSortable: false,
  644. // sortLv: 0,
  645. // status: true,
  646. // fixed: '',
  647. // },
  648. // {
  649. // userId: this.$store.state.user.name,
  650. // functionId: this.$route.meta.menuId,
  651. // tableId: "common1002",
  652. // tableName: "commonLanguage",
  653. // columnProp: "languageCode",
  654. // headerAlign: "center",
  655. // align: "center",
  656. // columnLabel: "语言编码",
  657. // columnHidden: false,
  658. // columnImage: false,
  659. // columnSortable: false,
  660. // sortLv: 0,
  661. // status: true,
  662. // fixed: '',
  663. // }
  664. ],
  665. // 数据集
  666. dataList: [],
  667. queryButton: {
  668. functionId: this.$route.meta.menuId,
  669. tableId: this.$route.meta.menuId + 'LOTI01',
  670. languageCode: this.$i18n.locale,
  671. objectType: 'button'
  672. },
  673. buttons: {
  674. add: '新增',
  675. edit: '编辑',
  676. delete: '删除',
  677. deleteList: '批量删除',
  678. cz: '操作',
  679. search: '查询',
  680. download: '导出',
  681. settingTable: '设置列表',
  682. defaultTable: '设置默认配置'
  683. },
  684. // 导出 start
  685. exportData: [],
  686. exportName: "页面功能语言",
  687. exportHeader: ["页面功能语言"],
  688. exportFooter: [],
  689. exportDefaultValue: "",
  690. // 导出 end
  691. buttonList: [
  692. {
  693. languageValue: '新增',
  694. objectId: 'add',
  695. objectType: "button",
  696. tableId: this.$route.meta.menuId + 'LOTI01',
  697. },
  698. {
  699. languageValue: '编辑',
  700. objectId: 'edit',
  701. objectType: "button",
  702. tableId: this.$route.meta.menuId + 'LOTI01',
  703. },
  704. {
  705. languageValue: '删除',
  706. objectId: 'delete',
  707. objectType: "button",
  708. tableId: this.$route.meta.menuId + 'LOTI01',
  709. },
  710. {
  711. languageValue: '批量删除',
  712. objectId: 'deleteList',
  713. objectType: "button",
  714. tableId: this.$route.meta.menuId + 'LOTI01',
  715. },
  716. {
  717. languageValue: '操作',
  718. objectId: 'cz',
  719. objectType: "button",
  720. tableId: this.$route.meta.menuId + 'LOTI01',
  721. },
  722. {
  723. languageValue: '查询',
  724. objectId: 'search',
  725. objectType: "button",
  726. tableId: this.$route.meta.menuId + 'LOTI01',
  727. },
  728. {
  729. languageValue: '导出',
  730. objectId: 'download',
  731. objectType: "button",
  732. tableId: this.$route.meta.menuId + 'LOTI01',
  733. },
  734. {
  735. languageValue: '设置列表',
  736. objectId: 'settingTable',
  737. objectType: "button",
  738. tableId: this.$route.meta.menuId + 'LOTI01',
  739. },
  740. {
  741. languageValue: '设置默认配置',
  742. objectId: 'defaultTable',
  743. objectType: "button",
  744. tableId: this.$route.meta.menuId + 'LOTI01',
  745. }
  746. ],
  747. languageList: [],
  748. languageColumnList: [],
  749. languageDataList: [],
  750. queryLanguage: {},
  751. // 数据集条件
  752. querySysLanguagePack: {
  753. functionId: '',
  754. page: 1,
  755. limit: 1,
  756. languageValue: '',
  757. objectType: '',
  758. objectId: ''
  759. },
  760. // 分页
  761. pageIndex: 1,
  762. pageSize: 100,
  763. totalPage: 0,
  764. dataListLoading: false,
  765. dataListSelections: [],
  766. addOrUpdateVisible: false
  767. }
  768. },
  769. mounted() {
  770. this.$nextTick(() => {
  771. this.height = window.innerHeight - 220;
  772. })
  773. },
  774. activated() {
  775. this.getDataList()
  776. this.getSelectList()
  777. this.getLanguageList()
  778. },
  779. methods: {
  780. getSelectList() {
  781. let jsonData = {
  782. site: this.site,
  783. active: 'Y'
  784. }
  785. this.selectList.select2 = []
  786. getWarehouseList(jsonData).then(({data}) => {
  787. let list = data.rows
  788. if (list.length > 0) {
  789. for (let i = 0; i < list.length; i++) {
  790. let selectData = {
  791. value: list[i].wareHouseId,
  792. label: list[i].wareHouseName,
  793. }
  794. this.selectList.select2.push(selectData);
  795. }
  796. }
  797. })
  798. },
  799. delHeaderData(row) {
  800. this.$confirm(`确定删除该记录?`, '操作提示', {
  801. confirmButtonText: '确定',
  802. cancelButtonText: '取消',
  803. type: 'warning'
  804. }).then(() => {
  805. let jsonData = {
  806. site: row.site,
  807. locationId: row.locationId,
  808. warehouseId: row.warehouseId
  809. }
  810. delLocation(jsonData).then(({data}) => {
  811. if (data.code == 0) {
  812. this.$message.success(data.msg)
  813. this.getDataList()
  814. } else {
  815. this.$alert(data.msg, '操作提示', {
  816. confirmButtonText: '确定',
  817. callback: action => {
  818. }
  819. });
  820. }
  821. })
  822. })
  823. },
  824. saveHeaderFunction() {
  825. this.setUp.saveButton = true
  826. if (!this.saveHeaderData.locationId) {
  827. this.$message.warning('请输入库位编码!')
  828. this.setUp.saveButton = false
  829. return
  830. }
  831. if (!this.saveHeaderData.warehouseId) {
  832. this.$message.warning('请选择仓库名称!')
  833. this.setUp.saveButton = false
  834. return
  835. }
  836. if (!this.saveHeaderData.hold) {
  837. this.$message.warning('请输入货舱!!')
  838. this.setUp.saveButton = false
  839. return
  840. }
  841. if (!this.saveHeaderData.row) {
  842. this.$message.warning('请输入行!')
  843. this.setUp.saveButton = false
  844. return
  845. }
  846. if (!this.saveHeaderData.storey) {
  847. this.$message.warning('请输入层!')
  848. this.setUp.saveButton = false
  849. return
  850. }
  851. if (!this.saveHeaderData.box) {
  852. this.$message.warning('请输入箱!')
  853. this.setUp.saveButton = false
  854. return
  855. }
  856. if (!this.saveHeaderData.locationGroupId) {
  857. this.$message.warning('请选择位置组编码!')
  858. this.setUp.saveButton = false
  859. return
  860. }
  861. saveLocation(this.saveHeaderData).then(({data}) => {
  862. this.setUp.saveButton = false
  863. if (data.code == 0) {
  864. this.$message.success(data.msg)
  865. this.getDataList()
  866. this.setUp.reviewFlag = false
  867. } else {
  868. this.$alert(data.msg, '操作提示', {
  869. confirmButtonText: '确定',
  870. callback: action => {
  871. }
  872. });
  873. }
  874. })
  875. },
  876. initModel(row) {
  877. console.log("1 =" + row)
  878. this.setUp.reviewFlag = true
  879. this.setUp.saveButton = false
  880. this.setUp.readonlyFlag = false
  881. this.saveHeaderData.id = 0
  882. this.saveHeaderData.site = this.site
  883. this.saveHeaderData.locationId = ''
  884. this.saveHeaderData.locationName = ''
  885. this.saveHeaderData.warehouseId = ''
  886. this.saveHeaderData.active = 'Y'
  887. this.saveHeaderData.hide = 'Y'
  888. this.saveHeaderData.locationGroupId = ''
  889. this.saveHeaderData.locationGroupDesc = ''
  890. this.saveHeaderData.hold = ''
  891. this.saveHeaderData.row = ''
  892. this.saveHeaderData.storey = ''
  893. this.saveHeaderData.box = ''
  894. this.saveHeaderData.locationType = ''
  895. if (row) {
  896. console.log("2 =" + row)
  897. this.setUp.readonlyFlag = true
  898. this.saveHeaderData.id = 1
  899. this.saveHeaderData.locationId = row.locationId
  900. this.saveHeaderData.locationName = row.locationName
  901. this.saveHeaderData.warehouseId = row.warehouseId
  902. this.saveHeaderData.active = row.active
  903. this.saveHeaderData.hold = row.hold
  904. this.saveHeaderData.row = row.row
  905. this.saveHeaderData.storey = row.storey
  906. this.saveHeaderData.box = row.box
  907. this.saveHeaderData.locationGroupId = row.locationGroupId
  908. for (let i = 0; i<this.dataList.length;i++){
  909. if (this.saveHeaderData.locationGroupId == this.dataList[i].locationGroupId){
  910. this.saveHeaderData.locationGroupDesc = this.dataList[i].locationGroupDesc
  911. break;
  912. }
  913. }
  914. this.saveHeaderData.locationType = row.locationType
  915. }
  916. },
  917. // 打印方式
  918. printReport() {
  919. alert(this.$store.state.user.site)
  920. //
  921. // const LODOP = getLodop()
  922. // if (LODOP) {
  923. // var strBodyStyle = '<style>'
  924. // strBodyStyle += 'table { border-top: 1 solid #000000; border-left: 1 solid #000000; border-collapse:collapse; border-spacing:0;}'
  925. // strBodyStyle += 'caption { line-height:2em; }'
  926. // strBodyStyle += 'td { border-right: 1 solid #000000; border-bottom: 1 solid #000000; text-align:center; padding:2px 3px; font-size:11px;}'
  927. // strBodyStyle += '</style>' //设置打印样式
  928. // var strFormHtml = strBodyStyle + '<body>' + document.getElementById('commmon').innerHTML + '</body>' //获取打印内容
  929. //
  930. // LODOP.PRINT_INIT('') //初始化
  931. // LODOP.PRINT_DESIGN();
  932. // //LODOP.PREVIEW();
  933. // //LODOP.PRINT();
  934. //
  935. // LODOP.SET_PRINT_PAGESIZE(2, 0, 0, 'A4') //设置横向
  936. // LODOP.ADD_PRINT_HTM('1%', '1%', '98%', '98%', strFormHtml) //设置打印内容
  937. // LODOP.SET_PREVIEW_WINDOW(2, 0, 0, 800, 600, '') //设置预览窗口模式和大小
  938. // LODOP.PREVIEW()
  939. // }
  940. },
  941. queryLocationGruop(){
  942. queryAllLocationGruopList(this.locationGruopModalData).then(({data})=>{
  943. if (data.code==0){
  944. this.$message.success(data.rows)
  945. this.locationGruopDataList = data.rows
  946. this.localtionGruopFlag = true
  947. }
  948. })
  949. },
  950. getRowData(row){
  951. this.saveHeaderData.locationGroupId = row.locationGroupId
  952. this.saveHeaderData.locationGroupDesc = row.locationGroupDesc
  953. this.saveHeaderData.locationType = row.locationType
  954. this.localtionGruopFlag = false
  955. },
  956. // 校验用户是否收藏
  957. favoriteIsOk() {
  958. let userFavorite = {
  959. userId: this.$store.state.user.id,
  960. languageCode: this.$i18n.locale
  961. }
  962. userFavoriteList(userFavorite).then(({data}) => {
  963. let size = data.list.filter(item => item.userId == userFavorite.menuId).length;
  964. if (size > 0) {
  965. this.favorite = true
  966. } else {
  967. this.favorite = false
  968. }
  969. })
  970. },
  971. // 收藏 OR 取消收藏
  972. favoriteFunction() {
  973. let userFavorite = {
  974. userId: this.$store.state.user.id,
  975. functionId: this.$route.meta.menuId,
  976. }
  977. if (this.favorite) {
  978. // 取消收藏
  979. this.$confirm(`确定取消收藏`, '提示', {
  980. confirmButtonText: '确定',
  981. cancelButtonText: '取消',
  982. type: 'warning'
  983. }).then(() => {
  984. removeUserFavorite(userFavorite).then(({data}) => {
  985. this.$message.success(data.msg)
  986. this.favorite = false
  987. })
  988. })
  989. } else {
  990. // 收藏
  991. saveUserFavorite(userFavorite).then(({data}) => {
  992. this.$message.success(data.msg)
  993. this.favorite = true
  994. })
  995. }
  996. },
  997. // 获取多语言列表
  998. getLanguageList() {
  999. searchSysLanguage(this.queryLanguage).then(({data}) => {
  1000. this.languageList = data.rows
  1001. })
  1002. },
  1003. // 获取button的词典
  1004. getFunctionButtonList() {
  1005. searchFunctionButtonList(this.queryButton).then(({data}) => {
  1006. if (data.code == 0) {
  1007. this.buttons = data.data
  1008. } else {
  1009. // saveButtonList(this.buttonList).then(({data}) => {
  1010. // })
  1011. }
  1012. })
  1013. },
  1014. // 获取语言词典
  1015. getSysLanguageParamList() {
  1016. searchSysLanguageParam(this.querySysLanguageParam).then(({data}) => {
  1017. this.sysLanguageParams = data.rows
  1018. })
  1019. },
  1020. // 打开页面设置
  1021. userSetting() {
  1022. this.visible = true;
  1023. let queryTable = {
  1024. userId: this.$store.state.user.name,
  1025. functionId: this.$route.meta.menuId,
  1026. tableId: this.$route.meta.menuId + 'LOTI01',
  1027. languageCode: this.$i18n.locale
  1028. }
  1029. this.$nextTick(() => {
  1030. this.$refs.column.init(queryTable);
  1031. });
  1032. },
  1033. // 获取 用户保存的 格式列
  1034. getTableUserColumn() {
  1035. getTableUserListLanguage(this.queryTableUser).then(({data}) => {
  1036. if (data.rows.length > 0) {
  1037. //this.columnList = []
  1038. this.columnList = data.rows
  1039. } else {
  1040. this.getColumnList()
  1041. }
  1042. })
  1043. },
  1044. // 保存 默认配置 列
  1045. async saveColumnList() {
  1046. // 删除所有的该页面下保存的数据
  1047. if (this.userColumnList) {
  1048. //删除 user自定义的数据
  1049. await removerUser(this.queryTable)
  1050. }
  1051. // 删除默认配置
  1052. await removerDefault(this.queryTable)
  1053. // 保存页面 table属性
  1054. let sumColumnList = this.columnList.concat(this.columnList1);
  1055. sumColumnList = sumColumnList.map(item => {
  1056. return item = {
  1057. tableId: item.tableId,
  1058. tableName: item.tableName,
  1059. columnProp: item.columnProp,
  1060. columnLabel: item.columnLabel,
  1061. columnHidden: false,
  1062. columnImage: false,
  1063. columnSortable: item.columnSortable,
  1064. columnWidth: null,
  1065. format: null,
  1066. functionId: this.$route.meta.menuId,
  1067. sortLv: 0,
  1068. status: true,
  1069. fixed: '',
  1070. serialNumber: null,
  1071. columnType: null,
  1072. align: null
  1073. }
  1074. })
  1075. await saveTableDefaultList(sumColumnList)
  1076. // 保存页面 button label title 属性
  1077. let buttons = this.buttonList.map(item => {
  1078. return item = {
  1079. functionId: this.$route.meta.menuId,
  1080. languageValue: item.languageValue,
  1081. objectId: item.objectId,
  1082. objectType: item.objectType,
  1083. tableId: item.tableId
  1084. }
  1085. })
  1086. await saveButtonList(buttons)
  1087. this.getFunctionButtonList()
  1088. this.getColumnList()
  1089. },
  1090. // 获取 tableDefault 列
  1091. getColumnList() {
  1092. getTableDefaultListLanguage(this.queryTable).then(({data}) => {
  1093. if (!data.rows.length == 0) {
  1094. // this.showDefault = false
  1095. this.columnList = data.rows
  1096. } else {
  1097. // this.showDefault = true
  1098. }
  1099. })
  1100. },
  1101. // 获取数据列表
  1102. getDataList() {
  1103. this.dataListLoading = true
  1104. this.dataList = []
  1105. // this.totalPage = 0
  1106. getLocationList(this.queryHeaderData).then(({data}) => {
  1107. if (data && data.code === 0) {
  1108. this.dataList = data.page.list
  1109. this.queryHeaderData.page = data.page.currPage
  1110. this.queryHeaderData.size = data.page.pageSize
  1111. this.queryHeaderData.totalCount = data.page.totalCount
  1112. }
  1113. this.dataListLoading = false
  1114. })
  1115. },
  1116. // 每页数
  1117. sizeChangeHandle(val) {
  1118. this.queryHeaderData.size = val
  1119. this.queryHeaderData.page = 1
  1120. this.getDataList()
  1121. },
  1122. // 当前页
  1123. currentChangeHandle (val) {
  1124. this.queryHeaderData.page = val
  1125. this.getDataList()
  1126. },
  1127. // 多选
  1128. selectionChangeHandle(val) {
  1129. this.dataListSelections = val
  1130. },
  1131. // 删除
  1132. deleteHandle(id) {
  1133. var ids = id ? [id] : this.dataListSelections.map(item => {
  1134. return item.id
  1135. })
  1136. this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
  1137. confirmButtonText: '确定',
  1138. cancelButtonText: '取消',
  1139. type: 'warning'
  1140. }).then(() => {
  1141. this.$http({
  1142. url: this.$http.adornUrl('//prd/delete'),
  1143. method: 'post',
  1144. data: this.$http.adornData(ids, false)
  1145. }).then(({data}) => {
  1146. if (data && data.code === 0) {
  1147. this.$message.success('操作成功')
  1148. this.getDataList()
  1149. } else {
  1150. this.$message.error(data.msg)
  1151. }
  1152. })
  1153. })
  1154. },
  1155. // 导出
  1156. fields() {
  1157. let json = "{"
  1158. this.columnList.forEach((item, index) => {
  1159. if (index == this.columnList.length - 1) {
  1160. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1161. } else {
  1162. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1163. }
  1164. })
  1165. json += "}"
  1166. let s = eval("(" + json + ")")
  1167. return s
  1168. },
  1169. createExportData() {
  1170. // 点击导出按钮之后,开始导出数据之前的执行函数,返回值为需要下载的数据
  1171. // TODO:构造需要下载的数据返回
  1172. if (this.dataListSelections.length > 0) {
  1173. return this.dataListSelections;
  1174. }
  1175. return this.dataList;
  1176. },
  1177. startDownload() {
  1178. // this.exportData = this.dataList
  1179. },
  1180. finishDownload() {
  1181. }
  1182. },
  1183. created() {
  1184. this.getTableUserColumn()
  1185. this.getSysLanguageParamList()
  1186. this.getFunctionButtonList()
  1187. this.favoriteIsOk()
  1188. }
  1189. }
  1190. </script>
  1191. <style scoped>
  1192. .wrapper {
  1193. height: calc(100% - 40px);
  1194. }
  1195. .sl-input {
  1196. background-color: transparent;
  1197. border: 0 !important;
  1198. font-size: 12px !important;
  1199. height: 12px !important;
  1200. line-height: 14px !important;
  1201. background-color: transparent !important;
  1202. width: 140px;
  1203. }
  1204. .sl-input:focus, textarea:focus {
  1205. outline: none;
  1206. }
  1207. .sl-svg {
  1208. overflow: hidden;
  1209. float: right;
  1210. }
  1211. </style>