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.

1221 lines
39 KiB

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