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.

1235 lines
41 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 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;" 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. id: 0, // 业务字段,0=新增,1=编辑 - rqrq
  260. site: '', // 业务字段,工厂编码 - rqrq
  261. locationId: '',
  262. locationName: '',
  263. warehouseId: '',
  264. active: '',
  265. hide: '', // 是否隐藏 - rqrq
  266. locationGroupId: '',
  267. locationGroupDesc: '', // 业务字段,库位组描述 - rqrq
  268. locationType:'',
  269. hold:'',
  270. row:'',
  271. storey:'',
  272. box:'',
  273. },
  274. locationGruopModalData: {
  275. locationGroupId: '',
  276. locationGroupDesc: ''
  277. },
  278. locationGruopDataList: [],
  279. localtionGruopFlag: false,
  280. queryHeaderData: {
  281. site: this.$store.state.user.site,
  282. locationId: '',
  283. locationName: '',
  284. warehouseId: '',
  285. active: '',
  286. page:1,
  287. size:5,
  288. totalCount:0
  289. },
  290. setUp: {
  291. reviewFlag: false,
  292. saveButton: false,
  293. reviewFlag1: false,
  294. readonlyFlag: false,
  295. },
  296. inputLabel: {
  297. headerInput: {
  298. label1: '库位编码',
  299. label2: '库位名称',
  300. label3: '仓库名称',
  301. label4: '状态',
  302. label5: '库位信息',
  303. label6: '位置组编码',
  304. label7: '位置组描述',
  305. label8: '货舱',
  306. label9: '行',
  307. label10: '层',
  308. label11: '箱',
  309. label12: '库位类型'
  310. },
  311. },
  312. selectList: {
  313. select1: [{
  314. value: 'Y',
  315. label: '启用'
  316. }, {
  317. value: 'N',
  318. label: '禁用'
  319. }],
  320. select2: [],
  321. },
  322. site: this.$store.state.user.site,
  323. userName: this.$store.state.user.name,
  324. // table高度
  325. height: 450,
  326. // 是否收藏
  327. favorite: false,
  328. addLanguage: false,
  329. functionId: this.$route.meta.menuId,
  330. tableId: this.$route.meta.menuId + 'LOTI01',
  331. value1: true,
  332. visible: false,
  333. showDefault: false,
  334. // 默认table 查询参数
  335. queryTable: {
  336. functionId: this.$route.meta.menuId,
  337. tableId: this.$route.meta.menuId + 'LOTI01',
  338. languageCode: this.$i18n.locale
  339. },
  340. // 用户table 查询参数
  341. queryTableUser: {
  342. userId: this.$store.state.user.name,
  343. functionId: this.$route.meta.menuId,
  344. tableId: this.$route.meta.menuId + 'LOTI01',
  345. status: true,
  346. languageCode: this.$i18n.locale
  347. },
  348. // 语言词典查询参数
  349. querySysLanguageParam: {
  350. languageCode: this.$i18n.locale
  351. },
  352. // 语言词典集合
  353. sysLanguageParams: [],
  354. // 用户table 配置集合
  355. userColumnList: [],
  356. // 展示列集
  357. locationGruop_colum:[
  358. {
  359. userId: this.$store.state.user.name,
  360. serialNumber: 'location2601locationGroupId',
  361. tableId: this.$route.meta.menuId + 'LOTI01',
  362. tableName: "locationGruopTable",
  363. columnProp: "locationGroupId",
  364. headerAlign: "center",
  365. align: "center",
  366. columnLabel: "位置组编码",
  367. columnHidden: false,
  368. columnImage: false,
  369. columnSortable: false,
  370. sortLv: 0,
  371. status: true,
  372. fixed: '',
  373. },
  374. {
  375. userId: this.$store.state.user.name,
  376. serialNumber: 'location2601locationGroupDesc',
  377. tableId: this.$route.meta.menuId + 'LOTI01',
  378. tableName: "locationGruopTable",
  379. columnProp: "locationGroupDesc",
  380. headerAlign: "center",
  381. align: "center",
  382. columnLabel: "位置组描述",
  383. columnHidden: false,
  384. columnImage: false,
  385. columnSortable: false,
  386. sortLv: 0,
  387. status: true,
  388. fixed: '',
  389. },
  390. {
  391. userId: this.$store.state.user.name,
  392. serialNumber: 'location2601locationType',
  393. tableId: this.$route.meta.menuId + 'LOTI01',
  394. tableName: "locationGruopTable",
  395. columnProp: "locationType",
  396. headerAlign: "center",
  397. align: "center",
  398. columnLabel: "位置组描述",
  399. columnHidden: false,
  400. columnImage: false,
  401. columnSortable: false,
  402. sortLv: 0,
  403. status: true,
  404. fixed: '',
  405. }
  406. ],
  407. columnList: [
  408. {
  409. userId: this.$store.state.user.name,
  410. serialNumber: 'location2601LocationId',
  411. tableId: this.$route.meta.menuId + 'LOTI01',
  412. tableName: "locationTable",
  413. columnProp: "locationId",
  414. headerAlign: "center",
  415. align: "center",
  416. columnLabel: "库位编码",
  417. columnHidden: false,
  418. columnImage: false,
  419. columnSortable: false,
  420. sortLv: 0,
  421. status: true,
  422. fixed: '',
  423. },
  424. {
  425. userId: this.$store.state.user.name,
  426. serialNumber: 'location2601LocationName',
  427. tableId: this.$route.meta.menuId + 'LOTI01',
  428. tableName: "locationTable",
  429. columnProp: "locationName",
  430. headerAlign: "center",
  431. align: "center",
  432. columnLabel: "库位名称",
  433. columnHidden: false,
  434. columnImage: false,
  435. columnSortable: false,
  436. sortLv: 0,
  437. status: true,
  438. fixed: '',
  439. },
  440. {
  441. userId: this.$store.state.user.name,
  442. serialNumber: 'location2601WarehouseId',
  443. tableId: this.$route.meta.menuId + 'LOTI01',
  444. tableName: "locationTable",
  445. columnProp: "warehouseId",
  446. headerAlign: "center",
  447. align: "center",
  448. columnLabel: "仓库编码",
  449. columnHidden: false,
  450. columnImage: false,
  451. columnSortable: false,
  452. sortLv: 0,
  453. status: true,
  454. fixed: '',
  455. },
  456. {
  457. userId: this.$store.state.user.name,
  458. serialNumber: 'location2601WarehouseName',
  459. tableId: this.$route.meta.menuId + 'LOTI01',
  460. tableName: "locationTable",
  461. columnProp: "warehouseName",
  462. headerAlign: "center",
  463. align: "center",
  464. columnLabel: "仓库名称",
  465. columnHidden: false,
  466. columnImage: false,
  467. columnSortable: false,
  468. sortLv: 0,
  469. status: true,
  470. fixed: '',
  471. },
  472. {
  473. userId: this.$store.state.user.name,
  474. serialNumber: 'location2601StrlocationGroupDesc',
  475. tableId: this.$route.meta.menuId + 'LOTI01',
  476. tableName: "locationTable",
  477. columnProp: "locationGroupDesc",
  478. headerAlign: "center",
  479. align: "center",
  480. columnLabel: "位置组描述",
  481. columnHidden: false,
  482. columnImage: false,
  483. columnSortable: false,
  484. sortLv: 0,
  485. status: true,
  486. fixed: '',
  487. },
  488. {
  489. userId: this.$store.state.user.name,
  490. serialNumber: 'location2601StrlocationGroupDesc',
  491. tableId: this.$route.meta.menuId + 'LOTI01',
  492. tableName: "locationTable",
  493. columnProp: "locationType",
  494. headerAlign: "center",
  495. align: "center",
  496. columnLabel: "库房类型",
  497. columnHidden: false,
  498. columnImage: false,
  499. columnSortable: false,
  500. sortLv: 0,
  501. status: true,
  502. fixed: '',
  503. },
  504. {
  505. userId: this.$store.state.user.name,
  506. serialNumber: 'location2601StrActive',
  507. tableId: this.$route.meta.menuId + 'LOTI01',
  508. tableName: "locationTable",
  509. columnProp: "hold",
  510. headerAlign: "center",
  511. align: "center",
  512. columnLabel: "货舱",
  513. columnHidden: false,
  514. columnImage: false,
  515. columnSortable: false,
  516. sortLv: 0,
  517. status: true,
  518. fixed: '',
  519. },
  520. {
  521. userId: this.$store.state.user.name,
  522. serialNumber: 'location2601StrActive',
  523. tableId: this.$route.meta.menuId + 'LOTI01',
  524. tableName: "locationTable",
  525. columnProp: "row",
  526. headerAlign: "center",
  527. align: "center",
  528. columnLabel: "行",
  529. columnHidden: false,
  530. columnImage: false,
  531. columnSortable: false,
  532. sortLv: 0,
  533. status: true,
  534. fixed: '',
  535. },
  536. {
  537. userId: this.$store.state.user.name,
  538. serialNumber: 'location2601StrActive',
  539. tableId: this.$route.meta.menuId + 'LOTI01',
  540. tableName: "locationTable",
  541. columnProp: "storey",
  542. headerAlign: "center",
  543. align: "center",
  544. columnLabel: "层",
  545. columnHidden: false,
  546. columnImage: false,
  547. columnSortable: false,
  548. sortLv: 0,
  549. status: true,
  550. fixed: '',
  551. },
  552. {
  553. userId: this.$store.state.user.name,
  554. serialNumber: 'location2601StrActive',
  555. tableId: this.$route.meta.menuId + 'LOTI01',
  556. tableName: "locationTable",
  557. columnProp: "box",
  558. headerAlign: "center",
  559. align: "center",
  560. columnLabel: "箱",
  561. columnHidden: false,
  562. columnImage: false,
  563. columnSortable: false,
  564. sortLv: 0,
  565. status: true,
  566. fixed: '',
  567. },
  568. {
  569. userId: this.$store.state.user.name,
  570. serialNumber: 'location2601StrActive',
  571. tableId: this.$route.meta.menuId + 'LOTI01',
  572. tableName: "locationTable",
  573. columnProp: "active",
  574. headerAlign: "center",
  575. align: "center",
  576. columnLabel: "状态",
  577. columnHidden: false,
  578. columnImage: false,
  579. columnSortable: false,
  580. sortLv: 0,
  581. status: true,
  582. fixed: '',
  583. },
  584. ],
  585. // 展示列集
  586. columnList1: [
  587. // {
  588. // userId: this.$store.state.user.name,
  589. // functionId: this.$route.meta.menuId,
  590. // tableId: "common1002",
  591. // tableName: "commonLanguage",
  592. // columnProp: "functionId",
  593. // headerAlign: "center",
  594. // align: "center",
  595. // columnLabel: "功能编码",
  596. // columnHidden: false,
  597. // columnImage: false,
  598. // columnSortable: false,
  599. // sortLv: 0,
  600. // status: true,
  601. // fixed: false
  602. // },
  603. // {
  604. // userId: this.$store.state.user.name,
  605. // functionId: this.$route.meta.menuId,
  606. // tableId: "common1002",
  607. // tableName: "commonLanguage",
  608. // columnProp: "objectId",
  609. // headerAlign: "center",
  610. // align: "center",
  611. // columnLabel: "序列化编码",
  612. // columnHidden: false,
  613. // columnImage: false,
  614. // columnSortable: false,
  615. // sortLv: 0,
  616. // status: true,
  617. // fixed: '',
  618. // },
  619. // {
  620. // userId: this.$store.state.user.name,
  621. // functionId: this.$route.meta.menuId,
  622. // tableId: "common1002",
  623. // tableName: "commonLanguage",
  624. // columnProp: "objectType",
  625. // headerAlign: "center",
  626. // align: "center",
  627. // columnLabel: "类型",
  628. // columnHidden: false,
  629. // columnImage: false,
  630. // columnSortable: false,
  631. // sortLv: 0,
  632. // status: true,
  633. // fixed: '',
  634. // },
  635. // {
  636. // userId: this.$store.state.user.name,
  637. // functionId: this.$route.meta.menuId,
  638. // tableId: "common1002",
  639. // tableName: "commonLanguage",
  640. // columnProp: "languageValue",
  641. // headerAlign: "center",
  642. // align: "center",
  643. // columnLabel: "语言值",
  644. // columnHidden: false,
  645. // columnImage: false,
  646. // columnSortable: false,
  647. // sortLv: 0,
  648. // status: true,
  649. // fixed: '',
  650. // },
  651. // {
  652. // userId: this.$store.state.user.name,
  653. // functionId: this.$route.meta.menuId,
  654. // tableId: "common1002",
  655. // tableName: "commonLanguage",
  656. // columnProp: "languageCode",
  657. // headerAlign: "center",
  658. // align: "center",
  659. // columnLabel: "语言编码",
  660. // columnHidden: false,
  661. // columnImage: false,
  662. // columnSortable: false,
  663. // sortLv: 0,
  664. // status: true,
  665. // fixed: '',
  666. // }
  667. ],
  668. // 数据集
  669. dataList: [],
  670. queryButton: {
  671. functionId: this.$route.meta.menuId,
  672. tableId: this.$route.meta.menuId + 'LOTI01',
  673. languageCode: this.$i18n.locale,
  674. objectType: 'button'
  675. },
  676. buttons: {
  677. add: '新增',
  678. edit: '编辑',
  679. delete: '删除',
  680. deleteList: '批量删除',
  681. cz: '操作',
  682. search: '查询',
  683. download: '导出',
  684. settingTable: '设置列表',
  685. defaultTable: '设置默认配置'
  686. },
  687. // 导出 start
  688. exportData: [],
  689. exportName: "页面功能语言",
  690. exportHeader: ["页面功能语言"],
  691. exportFooter: [],
  692. exportDefaultValue: "",
  693. // 导出 end
  694. buttonList: [
  695. {
  696. languageValue: '新增',
  697. objectId: 'add',
  698. objectType: "button",
  699. tableId: this.$route.meta.menuId + 'LOTI01',
  700. },
  701. {
  702. languageValue: '编辑',
  703. objectId: 'edit',
  704. objectType: "button",
  705. tableId: this.$route.meta.menuId + 'LOTI01',
  706. },
  707. {
  708. languageValue: '删除',
  709. objectId: 'delete',
  710. objectType: "button",
  711. tableId: this.$route.meta.menuId + 'LOTI01',
  712. },
  713. {
  714. languageValue: '批量删除',
  715. objectId: 'deleteList',
  716. objectType: "button",
  717. tableId: this.$route.meta.menuId + 'LOTI01',
  718. },
  719. {
  720. languageValue: '操作',
  721. objectId: 'cz',
  722. objectType: "button",
  723. tableId: this.$route.meta.menuId + 'LOTI01',
  724. },
  725. {
  726. languageValue: '查询',
  727. objectId: 'search',
  728. objectType: "button",
  729. tableId: this.$route.meta.menuId + 'LOTI01',
  730. },
  731. {
  732. languageValue: '导出',
  733. objectId: 'download',
  734. objectType: "button",
  735. tableId: this.$route.meta.menuId + 'LOTI01',
  736. },
  737. {
  738. languageValue: '设置列表',
  739. objectId: 'settingTable',
  740. objectType: "button",
  741. tableId: this.$route.meta.menuId + 'LOTI01',
  742. },
  743. {
  744. languageValue: '设置默认配置',
  745. objectId: 'defaultTable',
  746. objectType: "button",
  747. tableId: this.$route.meta.menuId + 'LOTI01',
  748. }
  749. ],
  750. languageList: [],
  751. languageColumnList: [],
  752. languageDataList: [],
  753. queryLanguage: {},
  754. // 数据集条件
  755. querySysLanguagePack: {
  756. functionId: '',
  757. page: 1,
  758. limit: 1,
  759. languageValue: '',
  760. objectType: '',
  761. objectId: ''
  762. },
  763. // 分页
  764. pageIndex: 1,
  765. pageSize: 100,
  766. totalPage: 0,
  767. dataListLoading: false,
  768. dataListSelections: [],
  769. addOrUpdateVisible: false
  770. }
  771. },
  772. mounted() {
  773. this.$nextTick(() => {
  774. this.height = window.innerHeight - 220;
  775. })
  776. },
  777. activated() {
  778. this.getDataList()
  779. this.getSelectList()
  780. this.getLanguageList()
  781. },
  782. methods: {
  783. getSelectList() {
  784. let jsonData = {
  785. site: this.site,
  786. active: 'Y'
  787. }
  788. this.selectList.select2 = []
  789. getWarehouseList(jsonData).then(({data}) => {
  790. let list = data.rows
  791. if (list.length > 0) {
  792. for (let i = 0; i < list.length; i++) {
  793. let selectData = {
  794. value: list[i].wareHouseId,
  795. label: list[i].wareHouseName,
  796. }
  797. this.selectList.select2.push(selectData);
  798. }
  799. }
  800. })
  801. },
  802. delHeaderData(row) {
  803. this.$confirm(`确定删除该记录?`, '操作提示', {
  804. confirmButtonText: '确定',
  805. cancelButtonText: '取消',
  806. type: 'warning'
  807. }).then(() => {
  808. let jsonData = {
  809. site: row.site,
  810. locationId: row.locationId,
  811. warehouseId: row.warehouseId
  812. }
  813. delLocation(jsonData).then(({data}) => {
  814. if (data.code == 0) {
  815. this.$message.success(data.msg)
  816. this.getDataList()
  817. } else {
  818. this.$alert(data.msg, '操作提示', {
  819. confirmButtonText: '确定',
  820. callback: action => {
  821. }
  822. });
  823. }
  824. })
  825. })
  826. },
  827. saveHeaderFunction() {
  828. this.setUp.saveButton = true
  829. if (!this.saveHeaderData.locationId) {
  830. this.$message.warning('请输入库位编码!')
  831. this.setUp.saveButton = false
  832. return
  833. }
  834. if (!this.saveHeaderData.warehouseId) {
  835. this.$message.warning('请选择仓库名称!')
  836. this.setUp.saveButton = false
  837. return
  838. }
  839. if (!this.saveHeaderData.hold) {
  840. this.$message.warning('请输入货舱!!')
  841. this.setUp.saveButton = false
  842. return
  843. }
  844. if (!this.saveHeaderData.row) {
  845. this.$message.warning('请输入行!')
  846. this.setUp.saveButton = false
  847. return
  848. }
  849. if (!this.saveHeaderData.storey) {
  850. this.$message.warning('请输入层!')
  851. this.setUp.saveButton = false
  852. return
  853. }
  854. if (!this.saveHeaderData.box) {
  855. this.$message.warning('请输入箱!')
  856. this.setUp.saveButton = false
  857. return
  858. }
  859. if (!this.saveHeaderData.locationGroupId) {
  860. this.$message.warning('请选择位置组编码!')
  861. this.setUp.saveButton = false
  862. return
  863. }
  864. saveLocation(this.saveHeaderData).then(({data}) => {
  865. this.setUp.saveButton = false
  866. if (data.code == 0) {
  867. this.$message.success(data.msg)
  868. this.getDataList()
  869. this.setUp.reviewFlag = false
  870. } else {
  871. this.$alert(data.msg, '操作提示', {
  872. confirmButtonText: '确定',
  873. callback: action => {
  874. }
  875. });
  876. }
  877. })
  878. },
  879. initModel(row) {
  880. console.log("1 =" + row)
  881. this.setUp.reviewFlag = true
  882. this.setUp.saveButton = false
  883. this.setUp.readonlyFlag = false
  884. this.saveHeaderData.id = 0
  885. this.saveHeaderData.site = localStorage.getItem('site')
  886. this.saveHeaderData.locationId = ''
  887. this.saveHeaderData.locationName = ''
  888. this.saveHeaderData.warehouseId = ''
  889. this.saveHeaderData.active = 'Y'
  890. this.saveHeaderData.hide = 'N'
  891. this.saveHeaderData.locationGroupId = ''
  892. this.saveHeaderData.locationGroupDesc = ''
  893. this.saveHeaderData.hold = ''
  894. this.saveHeaderData.row = ''
  895. this.saveHeaderData.storey = ''
  896. this.saveHeaderData.box = ''
  897. this.saveHeaderData.locationType = ''
  898. if (row) {
  899. console.log("2 =" + row)
  900. this.setUp.readonlyFlag = true
  901. this.saveHeaderData.id = 1
  902. this.saveHeaderData.locationId = row.locationId
  903. this.saveHeaderData.locationName = row.locationName
  904. this.saveHeaderData.warehouseId = row.warehouseId
  905. this.saveHeaderData.active = row.active
  906. this.saveHeaderData.hold = row.hold
  907. this.saveHeaderData.row = row.row
  908. this.saveHeaderData.storey = row.storey
  909. this.saveHeaderData.box = row.box
  910. this.saveHeaderData.locationGroupId = row.locationGroupId
  911. for (let i = 0; i<this.dataList.length;i++){
  912. if (this.saveHeaderData.locationGroupId == this.dataList[i].locationGroupId){
  913. this.saveHeaderData.locationGroupDesc = this.dataList[i].locationGroupDesc
  914. break;
  915. }
  916. }
  917. this.saveHeaderData.locationType = row.locationType
  918. }
  919. },
  920. // 打印方式
  921. printReport() {
  922. alert(this.$store.state.user.site)
  923. //
  924. // const LODOP = getLodop()
  925. // if (LODOP) {
  926. // var strBodyStyle = '<style>'
  927. // strBodyStyle += 'table { border-top: 1 solid #000000; border-left: 1 solid #000000; border-collapse:collapse; border-spacing:0;}'
  928. // strBodyStyle += 'caption { line-height:2em; }'
  929. // strBodyStyle += 'td { border-right: 1 solid #000000; border-bottom: 1 solid #000000; text-align:center; padding:2px 3px; font-size:11px;}'
  930. // strBodyStyle += '</style>' //设置打印样式
  931. // var strFormHtml = strBodyStyle + '<body>' + document.getElementById('commmon').innerHTML + '</body>' //获取打印内容
  932. //
  933. // LODOP.PRINT_INIT('') //初始化
  934. // LODOP.PRINT_DESIGN();
  935. // //LODOP.PREVIEW();
  936. // //LODOP.PRINT();
  937. //
  938. // LODOP.SET_PRINT_PAGESIZE(2, 0, 0, 'A4') //设置横向
  939. // LODOP.ADD_PRINT_HTM('1%', '1%', '98%', '98%', strFormHtml) //设置打印内容
  940. // LODOP.SET_PREVIEW_WINDOW(2, 0, 0, 800, 600, '') //设置预览窗口模式和大小
  941. // LODOP.PREVIEW()
  942. // }
  943. },
  944. queryLocationGruop(){
  945. queryAllLocationGruopList(this.locationGruopModalData).then(({data})=>{
  946. if (data.code==0){
  947. this.$message.success(data.rows)
  948. this.locationGruopDataList = data.rows
  949. this.localtionGruopFlag = true
  950. }
  951. })
  952. },
  953. getRowData(row){
  954. this.saveHeaderData.locationGroupId = row.locationGroupId
  955. this.saveHeaderData.locationGroupDesc = row.locationGroupDesc
  956. //this.saveHeaderData.locationType = row.locationType
  957. this.localtionGruopFlag = false
  958. },
  959. // 校验用户是否收藏
  960. favoriteIsOk() {
  961. let userFavorite = {
  962. userId: this.$store.state.user.id,
  963. languageCode: this.$i18n.locale
  964. }
  965. userFavoriteList(userFavorite).then(({data}) => {
  966. let size = data.list.filter(item => item.userId == userFavorite.menuId).length;
  967. if (size > 0) {
  968. this.favorite = true
  969. } else {
  970. this.favorite = false
  971. }
  972. })
  973. },
  974. // 收藏 OR 取消收藏
  975. favoriteFunction() {
  976. let userFavorite = {
  977. userId: this.$store.state.user.id,
  978. functionId: this.$route.meta.menuId,
  979. }
  980. if (this.favorite) {
  981. // 取消收藏
  982. this.$confirm(`确定取消收藏`, '提示', {
  983. confirmButtonText: '确定',
  984. cancelButtonText: '取消',
  985. type: 'warning'
  986. }).then(() => {
  987. removeUserFavorite(userFavorite).then(({data}) => {
  988. this.$message.success(data.msg)
  989. this.favorite = false
  990. })
  991. })
  992. } else {
  993. // 收藏
  994. saveUserFavorite(userFavorite).then(({data}) => {
  995. this.$message.success(data.msg)
  996. this.favorite = true
  997. })
  998. }
  999. },
  1000. // 获取多语言列表
  1001. getLanguageList() {
  1002. searchSysLanguage(this.queryLanguage).then(({data}) => {
  1003. this.languageList = data.rows
  1004. })
  1005. },
  1006. // 获取button的词典
  1007. getFunctionButtonList() {
  1008. searchFunctionButtonList(this.queryButton).then(({data}) => {
  1009. if (data.code == 0) {
  1010. this.buttons = data.data
  1011. } else {
  1012. // saveButtonList(this.buttonList).then(({data}) => {
  1013. // })
  1014. }
  1015. })
  1016. },
  1017. // 获取语言词典
  1018. getSysLanguageParamList() {
  1019. searchSysLanguageParam(this.querySysLanguageParam).then(({data}) => {
  1020. this.sysLanguageParams = data.rows
  1021. })
  1022. },
  1023. // 打开页面设置
  1024. userSetting() {
  1025. this.visible = true;
  1026. let queryTable = {
  1027. userId: this.$store.state.user.name,
  1028. functionId: this.$route.meta.menuId,
  1029. tableId: this.$route.meta.menuId + 'LOTI01',
  1030. languageCode: this.$i18n.locale
  1031. }
  1032. this.$nextTick(() => {
  1033. this.$refs.column.init(queryTable);
  1034. });
  1035. },
  1036. // 获取 用户保存的 格式列
  1037. getTableUserColumn() {
  1038. getTableUserListLanguage(this.queryTableUser).then(({data}) => {
  1039. if (data.rows.length > 0) {
  1040. //this.columnList = []
  1041. this.columnList = data.rows
  1042. } else {
  1043. this.getColumnList()
  1044. }
  1045. })
  1046. },
  1047. // 保存 默认配置 列
  1048. async saveColumnList() {
  1049. // 删除所有的该页面下保存的数据
  1050. if (this.userColumnList) {
  1051. //删除 user自定义的数据
  1052. await removerUser(this.queryTable)
  1053. }
  1054. // 删除默认配置
  1055. await removerDefault(this.queryTable)
  1056. // 保存页面 table属性
  1057. let sumColumnList = this.columnList.concat(this.columnList1);
  1058. sumColumnList = sumColumnList.map(item => {
  1059. return item = {
  1060. tableId: item.tableId,
  1061. tableName: item.tableName,
  1062. columnProp: item.columnProp,
  1063. columnLabel: item.columnLabel,
  1064. columnHidden: false,
  1065. columnImage: false,
  1066. columnSortable: item.columnSortable,
  1067. columnWidth: null,
  1068. format: null,
  1069. functionId: this.$route.meta.menuId,
  1070. sortLv: 0,
  1071. status: true,
  1072. fixed: '',
  1073. serialNumber: null,
  1074. columnType: null,
  1075. align: null
  1076. }
  1077. })
  1078. await saveTableDefaultList(sumColumnList)
  1079. // 保存页面 button label title 属性
  1080. let buttons = this.buttonList.map(item => {
  1081. return item = {
  1082. functionId: this.$route.meta.menuId,
  1083. languageValue: item.languageValue,
  1084. objectId: item.objectId,
  1085. objectType: item.objectType,
  1086. tableId: item.tableId
  1087. }
  1088. })
  1089. await saveButtonList(buttons)
  1090. this.getFunctionButtonList()
  1091. this.getColumnList()
  1092. },
  1093. // 获取 tableDefault 列
  1094. getColumnList() {
  1095. getTableDefaultListLanguage(this.queryTable).then(({data}) => {
  1096. if (!data.rows.length == 0) {
  1097. // this.showDefault = false
  1098. this.columnList = data.rows
  1099. } else {
  1100. // this.showDefault = true
  1101. }
  1102. })
  1103. },
  1104. // 获取数据列表
  1105. getDataList() {
  1106. this.dataListLoading = true
  1107. this.dataList = []
  1108. // this.totalPage = 0
  1109. getLocationList(this.queryHeaderData).then(({data}) => {
  1110. if (data && data.code === 0) {
  1111. this.dataList = data.page.list
  1112. this.queryHeaderData.page = data.page.currPage
  1113. this.queryHeaderData.size = data.page.pageSize
  1114. this.queryHeaderData.totalCount = data.page.totalCount
  1115. }
  1116. this.dataListLoading = false
  1117. })
  1118. },
  1119. // 每页数
  1120. sizeChangeHandle(val) {
  1121. this.queryHeaderData.size = val
  1122. this.queryHeaderData.page = 1
  1123. this.getDataList()
  1124. },
  1125. // 当前页
  1126. currentChangeHandle (val) {
  1127. this.queryHeaderData.page = val
  1128. this.getDataList()
  1129. },
  1130. // 多选
  1131. selectionChangeHandle(val) {
  1132. this.dataListSelections = val
  1133. },
  1134. // 删除
  1135. deleteHandle(id) {
  1136. var ids = id ? [id] : this.dataListSelections.map(item => {
  1137. return item.id
  1138. })
  1139. this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
  1140. confirmButtonText: '确定',
  1141. cancelButtonText: '取消',
  1142. type: 'warning'
  1143. }).then(() => {
  1144. this.$http({
  1145. url: this.$http.adornUrl('//prd/delete'),
  1146. method: 'post',
  1147. data: this.$http.adornData(ids, false)
  1148. }).then(({data}) => {
  1149. if (data && data.code === 0) {
  1150. this.$message.success('操作成功')
  1151. this.getDataList()
  1152. } else {
  1153. this.$message.error(data.msg)
  1154. }
  1155. })
  1156. })
  1157. },
  1158. // 导出
  1159. fields() {
  1160. let json = "{"
  1161. this.columnList.forEach((item, index) => {
  1162. if (index == this.columnList.length - 1) {
  1163. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1164. } else {
  1165. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1166. }
  1167. })
  1168. json += "}"
  1169. let s = eval("(" + json + ")")
  1170. return s
  1171. },
  1172. createExportData() {
  1173. // 点击导出按钮之后,开始导出数据之前的执行函数,返回值为需要下载的数据
  1174. // TODO:构造需要下载的数据返回
  1175. if (this.dataListSelections.length > 0) {
  1176. return this.dataListSelections;
  1177. }
  1178. return this.dataList;
  1179. },
  1180. startDownload() {
  1181. // this.exportData = this.dataList
  1182. },
  1183. finishDownload() {
  1184. }
  1185. },
  1186. created() {
  1187. this.getTableUserColumn()
  1188. this.getSysLanguageParamList()
  1189. this.getFunctionButtonList()
  1190. this.favoriteIsOk()
  1191. }
  1192. }
  1193. </script>
  1194. <style scoped>
  1195. .wrapper {
  1196. height: calc(100% - 40px);
  1197. }
  1198. .sl-input {
  1199. background-color: transparent;
  1200. border: 0 !important;
  1201. font-size: 12px !important;
  1202. height: 12px !important;
  1203. line-height: 14px !important;
  1204. background-color: transparent !important;
  1205. width: 140px;
  1206. }
  1207. .sl-input:focus, textarea:focus {
  1208. outline: none;
  1209. }
  1210. .sl-svg {
  1211. overflow: hidden;
  1212. float: right;
  1213. }
  1214. </style>