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.

1811 lines
61 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
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 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
  1. <template>
  2. <div class="mod-config">
  3. <el-row>
  4. <el-col :span="24">
  5. <el-button @click="initViewIfsTable('Y')" type="primary">{{ buttons.search }}</el-button>
  6. <el-button @click="saveColumnList()" type="primary" v-show="showDefault">{{ buttons.defaultTable }}
  7. </el-button>
  8. <el-button @click="userSetting" type="primary">{{ buttons.settingTable }}</el-button>
  9. <download-excel
  10. :fields="fields()"
  11. :data="exportData"
  12. type="xls"
  13. :name="exportName"
  14. :header="exportHeader"
  15. :footer="exportFooter"
  16. :defaultValue="exportDefaultValue"
  17. :fetch="createExportData"
  18. :before-generate="startDownload"
  19. :before-finish="finishDownload"
  20. worksheet="导出信息"
  21. class="el-button el-button--primary el-button--medium">
  22. {{ buttons.download }}
  23. </download-excel>
  24. <el-button v-if="isAuth(':prd:delete')" type="danger" @click="deleteHandle()"
  25. :disabled="dataListSelections.length <= 0">{{ buttons.deleteList }}
  26. </el-button>
  27. </el-col>
  28. </el-row>
  29. <el-row>
  30. <el-col :span="24">
  31. <el-form :inline="true" label-position="top">
  32. <el-form-item :label="inputSearch10">
  33. <el-input style="width: 110px;" placeholder="" v-model="queryViewIfs.transactionId"></el-input>
  34. </el-form-item>
  35. <el-form-item :label="inputSearch1">
  36. <el-input style="width: 110px;" placeholder="" v-model="queryViewIfs.toolId"></el-input>
  37. </el-form-item>
  38. <el-form-item :label="inputSearch2">
  39. <el-input style="width: 110px;" placeholder="" v-model="queryViewIfs.description"></el-input>
  40. </el-form-item>
  41. <el-form-item :label="inputSearch12">
  42. <el-select v-model="queryViewIfs.receiveFlag" placeholder="请选择" style="width: 75px;">
  43. <el-option
  44. v-for="item in selectList.select1"
  45. :key="item.value"
  46. :label="item.label"
  47. :value="item.value">
  48. </el-option>
  49. </el-select>
  50. </el-form-item>
  51. </el-form>
  52. </el-col>
  53. </el-row>
  54. <el-row>
  55. <el-col :span="24">
  56. <el-table
  57. :height="height"
  58. :data="dataList"
  59. border
  60. v-loading="dataListLoading"
  61. @selection-change="selectionChangeHandle"
  62. highlight-current-row
  63. style="width: 100%;">
  64. <el-table-column
  65. v-for="(item,index) in columnList" :key="index"
  66. :sortable="item.columnSortable"
  67. :prop="item.columnProp"
  68. :header-align="item.headerAlign"
  69. :show-overflow-tooltip="item.showOverflowTooltip"
  70. :align="item.align"
  71. :fixed="item.fixed==''?false:item.fixed"
  72. :width="item.columnWidth"
  73. :label="item.columnLabel">
  74. <template slot-scope="scope">
  75. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  76. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  77. style="width: 100px; height: 80px"/></span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column
  81. fixed="right"
  82. header-align="center"
  83. align="center"
  84. width="100"
  85. :label="buttons.operating">
  86. <template slot-scope="scope">
  87. <a @click="closeReceive(scope.row)">{{'关闭'}}</a>
  88. <a @click="initBannersFlag(scope.row)">{{buttons.receive}}</a>
  89. <a @click="initFileModel(scope.row)">{{buttons.appendixInfo}}</a>
  90. </template>
  91. </el-table-column>
  92. </el-table>
  93. <el-pagination
  94. @size-change="sizeChangeHandle"
  95. @current-change="currentChangeHandle"
  96. :current-page="pageIndex"
  97. :page-sizes="[100, 200, 500]"
  98. :page-size="pageSize"
  99. :total="totalPage"
  100. layout="total, sizes, prev, pager, next, jumper">
  101. </el-pagination>
  102. </el-col>
  103. </el-row>
  104. <column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column>
  105. <el-dialog title="横幅宽幅设定" :visible.sync="bannersFlag" width="325px">
  106. <el-form :inline="true">
  107. <el-form-item :label="inputSearch8">
  108. <el-input style="width: 90px;text-align: left;padding: 0px 5px;"
  109. oninput="value=value.replace(/^\.+|[^\d.]/g,'')" v-model="torNumacc"></el-input>
  110. </el-form-item>
  111. <el-form-item :label="inputSearch9">
  112. <el-input style="width: 90px;text-align: left;padding: 0px 5px;"
  113. oninput="value=value.replace(/^\.+|[^\d.]/g,'')" v-model="torNumdown"></el-input>
  114. </el-form-item>
  115. </el-form>
  116. <span slot="footer" class="dialog-footer">
  117. <el-button @click="bannersFlag = false">取消</el-button>
  118. <el-button type="primary" :disabled="bannersBut" @click="saveBanners()">确定</el-button>
  119. </span>
  120. </el-dialog>
  121. <el-dialog v-drag :close-on-click-modal="false" :visible.sync="poToolFlag" width="770px">
  122. <span style="font-size: 13px" slot="title"> {{'接收单号:'+this.ifsToolData.transactionId + ' - 工具编码: ' + this.ifsToolData.toolId}}</span>
  123. <el-row>
  124. <el-col :span="24">
  125. <el-button type="primary" :disabled="generateFlag" @click="initMailFlag()">{{buttons.generate}}</el-button>
  126. <el-button type="primary" @click="printMethod('Y')">{{buttons.toolLabel}}</el-button>
  127. <el-button type="primary" @click="printMethod('N')">{{buttons.screenLabel}}</el-button>
  128. <el-button type="primary" :disabled="receiveQuantity>1" @click="setToolInstanceId()">
  129. {{buttons.manualGenerate}}
  130. </el-button>
  131. </el-col>
  132. </el-row>
  133. <el-row>
  134. <el-col :span="24">
  135. <el-form :inline="true" label-position="top">
  136. <el-form-item :label="inputSearch3">
  137. <el-input type="number" @change="initQtyAlert()" oninput="value=value.replace(/^\.+|[^\d.]/g,'')"
  138. v-model="receiveQuantity"></el-input>
  139. </el-form-item>
  140. <el-form-item :label="inputSearch4">
  141. <el-input type="number" oninput="value=value.replace(/^\.+|[^\d.]/g,'')" v-model="serviceLife"></el-input>
  142. </el-form-item>
  143. <el-form-item :label="inputSearch11">
  144. <el-input type="number" oninput="value=value.replace(/^\.+|[^\d.]/g,'')"
  145. v-model="invoicePrice"></el-input>
  146. </el-form-item>
  147. </el-form>
  148. </el-col>
  149. </el-row>
  150. <el-row>
  151. <el-col :span="24">
  152. <el-table
  153. :data="poToolList"
  154. height="290"
  155. border
  156. v-loading="dataListLoading"
  157. @selection-change="getCurrSelectList"
  158. style="width: 100%;">
  159. <el-table-column
  160. type="selection"
  161. header-align="center"
  162. width="40"
  163. align="center">
  164. </el-table-column>
  165. <el-table-column
  166. v-for="(item,index) in poToolColumnList" :key="index"
  167. :sortable="item.columnSortable"
  168. :prop="item.columnProp"
  169. :header-align="item.headerAlign"
  170. :show-overflow-tooltip="item.showOverflowTooltip"
  171. :align="item.align"
  172. :fixed="item.fixed==''?false:item.fixed"
  173. :width="item.columnWidth"
  174. :label="item.columnLabel">
  175. <template slot-scope="scope">
  176. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  177. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  178. style="width: 100px; height: 80px"/></span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column
  182. header-align="center"
  183. width="60"
  184. fixed="right"
  185. :label="buttons.cz"
  186. align="center">
  187. <template slot-scope="scope">
  188. <el-link v-if="scope.row.status == '已接收'" @click="editToolDetail(scope.row)">{{buttons.edit}}</el-link>
  189. </template>
  190. </el-table-column>
  191. </el-table>
  192. </el-col>
  193. </el-row>
  194. </el-dialog>
  195. <el-dialog v-drag :close-on-click-modal="false" :visible.sync="toolCodeFlag" width="335px">
  196. <span style="font-size: 13px" slot="title">手工设置工具实例编码</span>
  197. <el-row>
  198. <el-col :span="24">
  199. <el-form :inline="true" label-position="top">
  200. <el-form-item :label="'工具实例编码'">
  201. <el-input v-model="toolInstanceId"></el-input>
  202. </el-form-item>
  203. <el-form-item :label="inputSearch3">
  204. <el-input type="number" @change="initQtyAlert()" oninput="value=value.replace(/^\.+|[^\d.]/g,'')"
  205. v-model="receiveQuantity"></el-input>
  206. </el-form-item>
  207. <el-form-item :label="inputSearch4">
  208. <el-input type="number" oninput="value=value.replace(/^\.+|[^\d.]/g,'')" v-model="serviceLife"></el-input>
  209. </el-form-item>
  210. <el-form-item :label="inputSearch11">
  211. <el-input type="number" oninput="value=value.replace(/^\.+|[^\d.]/g,'')"
  212. v-model="invoicePrice"></el-input>
  213. </el-form-item>
  214. </el-form>
  215. </el-col>
  216. </el-row>
  217. <span slot="footer" class="dialog-footer">
  218. <el-button type="primary" @click="manualInitMailFlag()">{{'确定'}}</el-button>
  219. <el-button type="primary" @click="toolCodeFlag=false">{{'关闭'}}</el-button>
  220. </span>
  221. </el-dialog>
  222. <el-dialog title="附件信息" :visible.sync="setUp.fileFlag" width="672px" :close-on-click-modal="false"
  223. :close-on-press-escape="false" v-drag>
  224. <el-form :inline="true" label-position="top">
  225. <el-form-item style="margin-top: 10px">
  226. <upload v-on:childByValue="childByValue"></upload>
  227. </el-form-item>
  228. <el-table
  229. height="170"
  230. :data="fileList"
  231. border
  232. v-loading="dataListLoading"
  233. @selection-change="selectionChangeHandle"
  234. style="width: 100%;">
  235. <el-table-column
  236. v-for="(item,index) in columnList2" :key="index"
  237. :sortable="item.columnSortable"
  238. :prop="item.columnProp"
  239. :header-align="item.headerAlign"
  240. :show-overflow-tooltip="item.showOverflowTooltip"
  241. :align="item.align"
  242. :fixed="item.fixed==''?false:item.fixed"
  243. :width="item.columnWidth"
  244. :label="item.columnLabel">
  245. <template slot-scope="scope">
  246. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  247. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  248. style="width: 100px; height: 80px"/></span>
  249. </template>
  250. </el-table-column>
  251. <el-table-column
  252. header-align="center"
  253. align="center"
  254. width="50"
  255. :label="buttons.operating">
  256. <template slot-scope="scope">
  257. <a @click="fileDownload(scope.row)">{{ buttons.fileDownload }}</a>
  258. <a @click="filePreview(scope.row)">{{ buttons.preview }}</a>
  259. </template>
  260. </el-table-column>
  261. </el-table>
  262. </el-form>
  263. </el-dialog>
  264. <el-dialog title="预览" :visible.sync="pdfVisible" center width="60%">
  265. <iframe :src="this.pdfUrl" frameborder="0" width="100%" height="400px"></iframe>
  266. </el-dialog>
  267. <!--新增或编辑实例-->
  268. <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag
  269. :title="'修改接收工具信息'" :visible.sync="toolEditFlag" width="197px">
  270. <el-form :inline="true" label-position="top">
  271. <el-form-item label="工具实例编码">
  272. <el-input v-model="editToolData.newToolInstanceId">
  273. </el-input>
  274. </el-form-item>
  275. <el-form-item label="使用寿命">
  276. <el-input v-model="editToolData.estUseQty">
  277. </el-input>
  278. </el-form-item>
  279. </el-form>
  280. <span slot="footer" class="dialog-footer">
  281. <el-button type="primary" @click="updateToolDetail()">修改</el-button>
  282. <el-button type="primary" @click="toolEditFlag = false">取消</el-button>
  283. </span>
  284. </el-dialog>
  285. </div>
  286. </template>
  287. <script>
  288. import column from "../common/column";
  289. import {
  290. searchSysLanguagePackList,
  291. searchSysLanguageParam,
  292. searchFunctionButtonList,
  293. saveButtonList,
  294. searchSysLanguage,
  295. searchLanguageListByLanguageCode,
  296. saveSysLanguageOne
  297. } from "@/api/sysLanguage.js"
  298. import {
  299. saveTableDefaultList,
  300. saveTableUser,
  301. getTableDefaultListLanguage,
  302. getTableUserListLanguage,
  303. removerDefault,
  304. removerUser
  305. } from "@/api/table.js"
  306. import {
  307. getViewIfsList,
  308. getPoToolList,
  309. getLocationList,
  310. saveToolDetail,
  311. updateIfsTool,
  312. exportList,
  313. getFileList,
  314. printTool,
  315. saveFileAssociate,
  316. printToolData,
  317. closeReceiveStatus
  318. } from "@/api/knifemold/receive.js"
  319. import {
  320. getToolDetailList,
  321. updateReceiveToolDetail,
  322. } from '@/api/knifemold/tool-info.js'
  323. import getLodop from '@/utils/LodopFuncs.js'
  324. import axios from "axios";
  325. import Vue from "vue";
  326. import upload from "../common/upload";
  327. export default {
  328. components: {
  329. column
  330. , upload
  331. },
  332. data() {
  333. return {
  334. toolEditFlag: false,
  335. editToolData: {
  336. toolInstanceId: '',
  337. estUseQty: '',
  338. site: '',
  339. newToolInstanceId: ''
  340. },
  341. toolCodeFlag: false,
  342. pdfUrl: '',
  343. fileList: [],
  344. //设置
  345. setUp: {
  346. fileFlag: false,
  347. },
  348. selectList: {
  349. select1: [{
  350. value: 'Y',
  351. label: '显示'
  352. }, {
  353. value: 'N',
  354. label: '不显示'
  355. }],
  356. select2: [],
  357. },
  358. height: 0,
  359. //搜索名称
  360. inputSearch1: "工具编码",
  361. inputSearch2: "工具名称",
  362. inputSearch3: "接收数量",
  363. inputSearch4: "使用寿命",
  364. inputSearch5: "IQC检验",
  365. inputSearch6: "上机检验",
  366. inputSearch7: "录入库位",
  367. inputSearch8: "横幅",
  368. inputSearch9: "宽幅",
  369. inputSearch10: "接收单号",
  370. inputSearch11: "入库价格",
  371. inputSearch12: "接收完成",
  372. //横幅宽幅设定
  373. bannersFlag: false,
  374. bannersBut: false,
  375. pdfVisible: false,
  376. torNumacc: '',
  377. torNumdown: '',
  378. // 生成按钮是否可用
  379. generateFlag: false,
  380. // 接收数量
  381. receiveQuantity: '',
  382. // 使用寿命
  383. serviceLife: '',
  384. // 检验方式
  385. radio: '',
  386. // 录入库位
  387. locationNo: '',
  388. // 入库价格
  389. invoicePrice: 0,
  390. // 手工实例
  391. toolInstanceId: '',
  392. manual: 'N',
  393. site: this.$store.state.user.site,
  394. addLanguage: false,
  395. functionId: this.$route.meta.menuId,
  396. tableId: this.$route.meta.menuId + 'VIFS01',
  397. value1: true,
  398. visible: false,
  399. showDefault: false,
  400. poToolFlag: false,
  401. poToolData: {},
  402. ifsToolData: {},
  403. queryViewIfs: {
  404. //接收号
  405. transactionId: '',
  406. //工具编码搜索
  407. toolId: "",
  408. //工具名称搜索
  409. description: "",
  410. //工厂搜索
  411. site: "",
  412. //行数
  413. limit: "",
  414. //页数
  415. page: "",
  416. receiveFlag: 'N',
  417. },
  418. // 默认table 查询参数
  419. queryTable: {
  420. functionId: this.$route.meta.menuId,
  421. tableId: this.$route.meta.menuId + 'VIFS01',
  422. languageCode: this.$i18n.locale
  423. },
  424. // 用户table 查询参数
  425. queryTableUser: {
  426. userId: this.$store.state.user.name,
  427. functionId: this.$route.meta.menuId,
  428. tableId: this.$route.meta.menuId + 'VIFS01',
  429. status: true,
  430. languageCode: this.$i18n.locale
  431. },
  432. // 语言词典查询参数
  433. querySysLanguageParam: {
  434. languageCode: this.$i18n.locale
  435. },
  436. // 语言词典集合
  437. sysLanguageParams: [],
  438. // 用户table 配置集合
  439. userColumnList: [],
  440. // 展示列集
  441. poToolColumnList: [
  442. {
  443. userId: this.$store.state.user.name,
  444. serialNumber: '1001viewIfsTableTransactionId',
  445. tableId: this.$route.meta.menuId + 'VIFS01',
  446. tableName: "poToolTable",
  447. columnProp: "toolInstanceId",
  448. headerAlign: "center",
  449. align: "center",
  450. columnLabel: "实例编码",
  451. columnHidden: false,
  452. columnImage: false,
  453. columnSortable: false,
  454. sortLv: 0,
  455. status: true,
  456. fixed: false
  457. },
  458. {
  459. userId: this.$store.state.user.name,
  460. serialNumber: '1001viewIfsTableToolDescription',
  461. tableId: this.$route.meta.menuId + 'VIFS01',
  462. tableName: "poToolTable",
  463. columnProp: "toolDescription",
  464. headerAlign: "center",
  465. align: "center",
  466. columnLabel: "实例名称",
  467. columnHidden: false,
  468. columnImage: false,
  469. columnSortable: false,
  470. sortLv: 0,
  471. status: true,
  472. fixed: false
  473. },
  474. {
  475. userId: this.$store.state.user.name,
  476. serialNumber: '1001viewIfsTableToolDescription',
  477. tableId: this.$route.meta.menuId + 'VIFS01',
  478. tableName: "poToolTable",
  479. columnProp: "status",
  480. headerAlign: "center",
  481. align: "center",
  482. columnLabel: "状态",
  483. columnHidden: false,
  484. columnImage: false,
  485. columnSortable: false,
  486. sortLv: 0,
  487. status: true,
  488. fixed: false
  489. },
  490. ],
  491. // 展示列集
  492. columnList: [
  493. {
  494. userId: this.$store.state.user.name,
  495. serialNumber: '1001viewIfsTableTransactionId',
  496. tableId: this.$route.meta.menuId + 'VIFS01',
  497. tableName: "viewIfsTable",
  498. columnProp: "transactionId",
  499. headerAlign: "center",
  500. align: "center",
  501. columnLabel: "接收单号",
  502. columnHidden: false,
  503. columnImage: false,
  504. columnSortable: false,
  505. sortLv: 0,
  506. status: true,
  507. fixed: false
  508. },
  509. {
  510. userId: this.$store.state.user.name,
  511. serialNumber: '1001viewIfsTableToolId',
  512. tableId: this.$route.meta.menuId + 'VIFS01',
  513. tableName: "viewIfsTable",
  514. columnProp: "toolId",
  515. headerAlign: "center",
  516. align: "center",
  517. columnLabel: "工具编码",
  518. columnHidden: false,
  519. columnImage: false,
  520. columnSortable: false,
  521. sortLv: 0,
  522. status: true,
  523. fixed: '',
  524. },
  525. {
  526. userId: this.$store.state.user.name,
  527. serialNumber: '1001viewIfsTableDescription',
  528. tableId: this.$route.meta.menuId + 'VIFS01',
  529. tableName: "viewIfsTable",
  530. columnProp: "description",
  531. headerAlign: "center",
  532. align: "center",
  533. columnLabel: "工具名称",
  534. columnHidden: false,
  535. columnImage: false,
  536. columnSortable: false,
  537. sortLv: 0,
  538. status: true,
  539. fixed: '',
  540. },
  541. {
  542. userId: this.$store.state.user.name,
  543. serialNumber: '1001viewIfsTableVendorNo',
  544. tableId: this.$route.meta.menuId + 'VIFS01',
  545. tableName: "viewIfsTable",
  546. columnProp: "vendorNo",
  547. headerAlign: "center",
  548. align: "center",
  549. columnLabel: "供应商编码",
  550. columnHidden: false,
  551. columnImage: false,
  552. columnSortable: false,
  553. sortLv: 0,
  554. status: true,
  555. fixed: '',
  556. },
  557. {
  558. userId: this.$store.state.user.name,
  559. serialNumber: '1001viewIfsTableVendorName',
  560. tableId: this.$route.meta.menuId + 'VIFS01',
  561. tableName: "viewIfsTable",
  562. columnProp: "vendorName",
  563. headerAlign: "center",
  564. align: "center",
  565. columnLabel: "供应商名称",
  566. columnHidden: false,
  567. columnImage: false,
  568. columnSortable: false,
  569. sortLv: 0,
  570. status: true,
  571. fixed: '',
  572. },
  573. {
  574. userId: this.$store.state.user.name,
  575. serialNumber: '1001viewIfsTableQuantity',
  576. tableId: this.$route.meta.menuId + 'VIFS01',
  577. tableName: "viewIfsTable",
  578. columnProp: "quantity",
  579. headerAlign: "center",
  580. align: "center",
  581. columnLabel: "数量",
  582. columnHidden: false,
  583. columnImage: false,
  584. columnSortable: false,
  585. sortLv: 0,
  586. status: true,
  587. fixed: '',
  588. },
  589. {
  590. userId: this.$store.state.user.name,
  591. serialNumber: '1001viewIfsTableGenerateQuantity',
  592. tableId: this.$route.meta.menuId + 'VIFS01',
  593. tableName: "viewIfsTable",
  594. columnProp: "generateQuantity",
  595. headerAlign: "center",
  596. align: "center",
  597. columnLabel: "已接收数量",
  598. columnHidden: false,
  599. columnImage: false,
  600. columnSortable: false,
  601. sortLv: 0,
  602. status: true,
  603. fixed: '',
  604. }, {
  605. userId: this.$store.state.user.name,
  606. serialNumber: '1001viewIfsTableGenerateQuantity',
  607. tableId: this.$route.meta.menuId + 'VIFS01',
  608. tableName: "viewIfsTable",
  609. columnProp: "qtyReceived",
  610. headerAlign: "center",
  611. align: "center",
  612. columnLabel: "入库数量",
  613. columnHidden: false,
  614. columnImage: false,
  615. columnSortable: false,
  616. sortLv: 0,
  617. status: true,
  618. fixed: '',
  619. },
  620. ],
  621. // 展示列集
  622. columnList1: [
  623. // {
  624. // userId: this.$store.state.user.name,
  625. // functionId: 1001,
  626. // tableId: "common1002",
  627. // tableName: "commonLanguage",
  628. // columnProp: "functionId",
  629. // headerAlign: "center",
  630. // align: "center",
  631. // columnLabel: "功能编码",
  632. // columnHidden: false,
  633. // columnImage: false,
  634. // columnSortable: false,
  635. // sortLv: 0,
  636. // status: true,
  637. // fixed: false
  638. // },
  639. // {
  640. // userId: this.$store.state.user.name,
  641. // functionId: 1001,
  642. // tableId: "common1002",
  643. // tableName: "commonLanguage",
  644. // columnProp: "objectId",
  645. // headerAlign: "center",
  646. // align: "center",
  647. // columnLabel: "序列化编码",
  648. // columnHidden: false,
  649. // columnImage: false,
  650. // columnSortable: false,
  651. // sortLv: 0,
  652. // status: true,
  653. // fixed: '',
  654. // },
  655. // {
  656. // userId: this.$store.state.user.name,
  657. // functionId: 1001,
  658. // tableId: "common1002",
  659. // tableName: "commonLanguage",
  660. // columnProp: "objectType",
  661. // headerAlign: "center",
  662. // align: "center",
  663. // columnLabel: "类型",
  664. // columnHidden: false,
  665. // columnImage: false,
  666. // columnSortable: false,
  667. // sortLv: 0,
  668. // status: true,
  669. // fixed: '',
  670. // },
  671. // {
  672. // userId: this.$store.state.user.name,
  673. // functionId: 1001,
  674. // tableId: "common1002",
  675. // tableName: "commonLanguage",
  676. // columnProp: "languageValue",
  677. // headerAlign: "center",
  678. // align: "center",
  679. // columnLabel: "语言值",
  680. // columnHidden: false,
  681. // columnImage: false,
  682. // columnSortable: false,
  683. // sortLv: 0,
  684. // status: true,
  685. // fixed: '',
  686. // },
  687. // {
  688. // userId: this.$store.state.user.name,
  689. // functionId: 1001,
  690. // tableId: "common1002",
  691. // tableName: "commonLanguage",
  692. // columnProp: "languageCode",
  693. // headerAlign: "center",
  694. // align: "center",
  695. // columnLabel: "语言编码",
  696. // columnHidden: false,
  697. // columnImage: false,
  698. // columnSortable: false,
  699. // sortLv: 0,
  700. // status: true,
  701. // fixed: '',
  702. // }
  703. ],
  704. // 展示列集
  705. columnList2: [
  706. {
  707. userId: this.$store.state.user.name,
  708. tableId: this.$route.meta.menuId + 'VIFS02',
  709. tableName: "fileDetailTable",
  710. columnProp: "fileName",
  711. headerAlign: "center",
  712. align: "center",
  713. columnLabel: "文件名称",
  714. columnHidden: false,
  715. columnImage: false,
  716. columnSortable: false,
  717. sortLv: 0,
  718. status: true,
  719. fixed: false
  720. },
  721. {
  722. userId: this.$store.state.user.name,
  723. tableId: this.$route.meta.menuId + 'VIFS02',
  724. tableName: "fileDetailTable",
  725. columnProp: "createDate",
  726. headerAlign: "center",
  727. align: "center",
  728. columnLabel: "创建时间",
  729. columnHidden: false,
  730. columnImage: false,
  731. columnSortable: false,
  732. sortLv: 0,
  733. status: true,
  734. fixed: '',
  735. columnWidth: 135,
  736. },
  737. {
  738. userId: this.$store.state.user.name,
  739. tableId: this.$route.meta.menuId + 'VIFS02',
  740. tableName: "fileDetailTable",
  741. columnProp: "createdBy",
  742. headerAlign: "center",
  743. align: "center",
  744. columnLabel: "创建人",
  745. columnHidden: false,
  746. columnImage: false,
  747. columnSortable: false,
  748. sortLv: 0,
  749. status: true,
  750. fixed: '',
  751. columnWidth: 70,
  752. },
  753. ],
  754. // 数据集
  755. dataList: [],
  756. currSelectList: [],
  757. poToolList: [],
  758. queryButton: {
  759. functionId: this.$route.meta.menuId,
  760. tableId: this.$route.meta.menuId + 'VIFS01',
  761. languageCode: this.$i18n.locale,
  762. objectType: 'button'
  763. },
  764. buttons: {
  765. cz: '操作',
  766. receive: '接收',
  767. add: '添加',
  768. edit: '编辑',
  769. delete: '删除',
  770. deleteList: '批量删除',
  771. operating: '操作',
  772. search: '查询',
  773. download: '导出',
  774. settingTable: '设置列表',
  775. defaultTable: '设置默认配置',
  776. generate: "生成",
  777. manualGenerate: "手动生成",
  778. print: '打印',
  779. appendixInfo: '附件信息',
  780. fileDownload: '下载',
  781. toolLabel: '工具标签',
  782. screenLabel: '网版标签',
  783. },
  784. // 导出 start
  785. exportData: [],
  786. exportDataStandard: {
  787. "功能编码": "functionId",
  788. "序列化编码": "objectId",
  789. "类型": "objectType",
  790. "语言值": "languageValue"
  791. },
  792. exportName: "工具接收",
  793. exportHeader: ["工具接收"],
  794. exportFooter: [],
  795. exportDefaultValue: "",
  796. // 导出 end
  797. buttonList: [
  798. {
  799. functionId: this.$route.meta.menuId,
  800. languageValue: '接收',
  801. objectId: 'receive',
  802. objectType: "button",
  803. tableId: this.$route.meta.menuId + 'VIFS01',
  804. },
  805. {
  806. functionId: this.$route.meta.menuId,
  807. languageValue: '生成',
  808. objectId: 'generate',
  809. objectType: "button",
  810. tableId: this.$route.meta.menuId + 'VIFS01',
  811. },
  812. {
  813. functionId: this.$route.meta.menuId,
  814. languageValue: '打印',
  815. objectId: 'print',
  816. objectType: "button",
  817. tableId: this.$route.meta.menuId + 'VIFS01',
  818. },
  819. {
  820. functionId: this.$route.meta.menuId,
  821. languageValue: '关闭',
  822. objectId: 'shutSown',
  823. objectType: "button",
  824. tableId: this.$route.meta.menuId + 'VIFS01',
  825. },
  826. {
  827. functionId: this.$route.meta.menuId,
  828. languageValue: '操作',
  829. objectId: 'operating',
  830. objectType: "button",
  831. tableId: this.$route.meta.menuId + 'VIFS01',
  832. },
  833. {
  834. functionId: this.$route.meta.menuId,
  835. languageValue: '查询',
  836. objectId: 'search',
  837. objectType: "button",
  838. tableId: this.$route.meta.menuId + 'VIFS01',
  839. },
  840. {
  841. functionId: this.$route.meta.menuId,
  842. languageValue: '导出',
  843. objectId: 'download',
  844. objectType: "button",
  845. tableId: this.$route.meta.menuId + 'VIFS01',
  846. },
  847. {
  848. functionId: this.$route.meta.menuId,
  849. languageValue: '设置列表',
  850. objectId: 'settingTable',
  851. objectType: "button",
  852. tableId: this.$route.meta.menuId + 'VIFS01',
  853. },
  854. {
  855. functionId: this.$route.meta.menuId,
  856. languageValue: '设置默认配置',
  857. objectId: 'defaultTable',
  858. objectType: "button",
  859. tableId: this.$route.meta.menuId + 'VIFS01',
  860. },
  861. ],
  862. languageList: [],
  863. languageColumnList: [],
  864. languageDataList: [],
  865. queryLanguage: {},
  866. // 数据集条件
  867. querySysLanguagePack: {
  868. page: 1,
  869. limit: 1,
  870. languageValue: '',
  871. objectType: '',
  872. objectId: ''
  873. },
  874. // 分页
  875. pageIndex: 1,
  876. pageSize: 100,
  877. totalPage: 0,
  878. dataListLoading: false,
  879. dataListSelections: [],
  880. addOrUpdateVisible: false,
  881. insertFileList: [],
  882. currentData: {},
  883. }
  884. },
  885. activated() {
  886. // this.getDataList()
  887. this.initViewIfsTable();
  888. this.getLanguageList()
  889. },
  890. mounted() {
  891. this.$nextTick(() => {
  892. this.height = window.innerHeight - 220;
  893. })
  894. },
  895. watch: {
  896. radio() {
  897. this.locationNo = ''
  898. },
  899. editToolData: {
  900. deep: true,
  901. handler: function (newV, oldV) {
  902. if (this.editToolData.newToolInstanceId) {
  903. this.editToolData.newToolInstanceId = this.editToolData.newToolInstanceId.toUpperCase()
  904. }
  905. }
  906. },
  907. locationNo() {
  908. this.locationNo = this.locationNo.toUpperCase()
  909. },
  910. toolInstanceId() {
  911. this.toolInstanceId = this.toolInstanceId.toUpperCase()
  912. },
  913. poToolFlag() {
  914. if (this.poToolFlag == false) {
  915. this.initViewIfsTable()
  916. }
  917. }
  918. },
  919. methods: {
  920. // 编辑工具接收信息
  921. editToolDetail(row) {
  922. this.getToolDetailList(row)
  923. this.toolEditFlag = true
  924. },
  925. // 获取工具信息
  926. getToolDetailList(row) {
  927. let queryData = {
  928. site: this.site,
  929. toolInstanceId: row.toolInstanceId,
  930. }
  931. getToolDetailList(queryData).then(({data}) => {
  932. if (data && data.code == 0 && data.rows) {
  933. this.editToolData = {
  934. newToolInstanceId: data.rows[0].toolInstanceId,
  935. site: data.rows[0].site,
  936. toolInstanceId: data.rows[0].toolInstanceId,
  937. estUseQty: data.rows[0].estUseQty,
  938. }
  939. }
  940. })
  941. },
  942. // 修改接收信息
  943. updateToolDetail() {
  944. updateReceiveToolDetail(this.editToolData).then(({data}) => {
  945. if (data.code == 0) {
  946. this.$message.success(data.msg)
  947. this.toolEditFlag = false
  948. this.initPoToolTable()
  949. } else {
  950. this.$message.error(data.msg)
  951. }
  952. })
  953. },
  954. childByValue(childValue) {
  955. // childValue就是子组件传过来的值
  956. this.fileList.push(childValue)
  957. this.saveAssociate(childValue)
  958. },
  959. saveAssociate(row) {
  960. let jsonList = [];
  961. let jsonData = {
  962. site: this.site,
  963. sysOssId: row.id,
  964. type: 'ReveiveFile',
  965. associatedField1: this.currentData.transactionId,
  966. }
  967. jsonList.push(jsonData)
  968. saveFileAssociate(jsonList).then(({data}) => {
  969. })
  970. },
  971. async printMethod(val) {
  972. if (this.currSelectList.length <= 0) {
  973. this.$alert('请选择工具信息!', '操作提示', {
  974. confirmButtonText: '确定',
  975. callback: action => {
  976. this.bannersBut = false
  977. }
  978. });
  979. return
  980. }
  981. let dto = {
  982. site: this.currSelectList[0].site,
  983. toolInstanceId: this.currSelectList[0].toolInstanceId
  984. }
  985. await printToolData(dto).then(({data}) => {
  986. if (data.code == 0) {
  987. let printDataList = []
  988. for (const item of this.currSelectList) {
  989. let printData = {
  990. SupplierName: data.data.SupplierName,
  991. createDate: data.data.createDate,
  992. createdBy: data.data.createdBy,
  993. estUseQty: data.data.estUseQty,
  994. locationId: data.data.locationId,
  995. phaseInDate: data.data.phaseInDate,
  996. site: data.data.site,
  997. spec: data.data.spec,
  998. status: data.data.status,
  999. supplierId: data.data.supplierId,
  1000. toolDescription: data.data.toolDescription,
  1001. toolId: data.data.toolId,
  1002. toolInstanceId: item.toolInstanceId
  1003. }
  1004. printDataList.push(printData)
  1005. }
  1006. if (val == 'Y') {
  1007. this.labelPrintGJ(printDataList)
  1008. } else {
  1009. this.labelPrintWB(printDataList)
  1010. }
  1011. }
  1012. })
  1013. },
  1014. labelPrintWB(printDataList) {
  1015. const LODOP = getLodop()
  1016. if (LODOP) {
  1017. //LODOP.SET_LICENSES("","7B5624CC84EF99D6B17F27DF4AF4310C","","");
  1018. //LODOP.SET_LICENSES("", "7B5624CC84EF99D6B17F27DF4AF4310C", "", "");
  1019. //循环调用打印机
  1020. for (let i = 0; i < printDataList.length; i++) {
  1021. let printData = printDataList[i]
  1022. LODOP.NewPage();
  1023. LODOP.SET_PRINT_PAGESIZE(0, 700, 180, "");
  1024. LODOP.SET_PRINT_MODE("PRINT_NOCOLLATE", 1);
  1025. LODOP.ADD_PRINT_RECT(2, 5, 250, 67, 0, 1);
  1026. LODOP.ADD_PRINT_LINE(19, 5, 18, 255, 0, 1);
  1027. LODOP.ADD_PRINT_LINE(36, 5, 35, 205, 0, 1);
  1028. LODOP.ADD_PRINT_LINE(54, 5, 53, 205, 0, 1);
  1029. LODOP.ADD_PRINT_LINE(2, 65, 69, 66, 0, 1);
  1030. LODOP.ADD_PRINT_LINE(68, 205, 18, 206, 0, 1);
  1031. LODOP.ADD_PRINT_BARCODE(21, 208, 90, 60, "QRCode", printData.toolInstanceId);
  1032. LODOP.ADD_PRINT_TEXT(5, 9, 60, 14, "工具名称");
  1033. LODOP.ADD_PRINT_TEXT(21, 9, 60, 15, "工具编号");
  1034. LODOP.ADD_PRINT_TEXT(38, 9, 60, 15, "实例编号");
  1035. LODOP.ADD_PRINT_TEXT(55, 9, 60, 15, "经办人");
  1036. LODOP.ADD_PRINT_TEXT(4, 70, 180, 14, printData.toolDescription);
  1037. LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
  1038. LODOP.ADD_PRINT_TEXT(21, 71, 133, 14, printData.toolId);
  1039. LODOP.ADD_PRINT_TEXT(39, 71, 133, 14, printData.toolInstanceId);
  1040. LODOP.ADD_PRINT_TEXT(55, 71, 133, 14, printData.createdBy);
  1041. }
  1042. //LODOP.PRINT_DESIGN();
  1043. //LODOP.PREVIEW();
  1044. LODOP.PRINT();
  1045. }
  1046. },
  1047. labelPrintGJ(printDataList) {
  1048. const LODOP = getLodop()
  1049. if (LODOP) {
  1050. //LODOP.SET_LICENSES("","7B5624CC84EF99D6B17F27DF4AF4310C","","");
  1051. //LODOP.SET_LICENSES("", "7B5624CC84E599D6B17F27DF40F4310C", "", "");
  1052. //循环调用打印机
  1053. for (let i = 0; i < printDataList.length; i++) {
  1054. let printData = printDataList[i]
  1055. LODOP.NewPage();
  1056. LODOP.SET_PRINT_PAGESIZE(0, 700, 540, "");
  1057. LODOP.ADD_PRINT_RECT(6, 5, 250, 190, 0, 1);
  1058. LODOP.ADD_PRINT_LINE(24, 5, 23, 255, 0, 1);
  1059. LODOP.ADD_PRINT_LINE(41, 5, 40, 255, 0, 1);
  1060. LODOP.ADD_PRINT_LINE(58, 5, 57, 255, 0, 1);
  1061. LODOP.ADD_PRINT_LINE(75, 5, 74, 255, 0, 1);
  1062. LODOP.ADD_PRINT_LINE(92, 5, 91, 255, 0, 1);
  1063. LODOP.ADD_PRINT_LINE(109, 5, 108, 255, 0, 1);
  1064. LODOP.ADD_PRINT_LINE(126, 5, 125, 178, 0, 1);
  1065. LODOP.ADD_PRINT_LINE(144, 5, 143, 178, 0, 1);
  1066. LODOP.ADD_PRINT_LINE(162, 5, 161, 178, 0, 1);
  1067. LODOP.ADD_PRINT_LINE(179, 5, 178, 255, 0, 1);
  1068. LODOP.ADD_PRINT_LINE(23, 65, 195, 66, 0, 1);
  1069. LODOP.ADD_PRINT_LINE(178, 177, 108, 178, 0, 1);
  1070. LODOP.ADD_PRINT_BARCODE(110, 183, 110, 85, "QRCode", printData.toolInstanceId);
  1071. LODOP.ADD_PRINT_TEXT(9, 94, 100, 14, "工具标签");
  1072. LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
  1073. LODOP.ADD_PRINT_TEXT(26, 9, 60, 14, "工具名称");
  1074. LODOP.ADD_PRINT_TEXT(43, 9, 60, 15, "规格型号");
  1075. LODOP.ADD_PRINT_TEXT(60, 9, 60, 15, "工具编号");
  1076. LODOP.ADD_PRINT_TEXT(77, 9, 60, 15, "实例编号");
  1077. LODOP.ADD_PRINT_TEXT(94, 9, 60, 15, "厂商");
  1078. LODOP.ADD_PRINT_TEXT(111, 9, 60, 15, "入库日期");
  1079. LODOP.ADD_PRINT_TEXT(129, 9, 60, 15, "库位");
  1080. LODOP.ADD_PRINT_TEXT(147, 9, 60, 15, "经办人");
  1081. LODOP.ADD_PRINT_TEXT(181, 9, 60, 15, "检验签章");
  1082. LODOP.ADD_PRINT_TEXT(25, 72, 180, 14, printData.toolDescription);
  1083. LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
  1084. LODOP.ADD_PRINT_TEXT(42, 72, 180, 14, printData.spec); // 规格
  1085. LODOP.ADD_PRINT_TEXT(60, 72, 180, 14, printData.toolId);
  1086. LODOP.ADD_PRINT_TEXT(78, 71, 180, 14, printData.toolInstanceId);
  1087. LODOP.ADD_PRINT_TEXT(94, 71, 180, 14, printData.SupplierName);
  1088. LODOP.ADD_PRINT_TEXT(111, 71, 95, 14, this.dayjs(printData.createDate).format("YYYY-MM-DD"));
  1089. LODOP.ADD_PRINT_TEXT(130, 71, 95, 14, printData.locationId);
  1090. LODOP.ADD_PRINT_TEXT(148, 71, 95, 14, printData.createdBy);
  1091. }
  1092. //LODOP.PRINT_DESIGN();
  1093. //LODOP.PREVIEW();
  1094. LODOP.PRINT();
  1095. }
  1096. },
  1097. printMethod1(val) {
  1098. if (this.currSelectList.length <= 0) {
  1099. this.$alert('请选择工具信息!', '操作提示', {
  1100. confirmButtonText: '确定',
  1101. callback: action => {
  1102. this.bannersBut = false
  1103. }
  1104. });
  1105. return
  1106. }
  1107. let reportFamily = ''
  1108. if (val == 'Y') {
  1109. reportFamily = '工具标签'
  1110. } else {
  1111. reportFamily = '网版标签'
  1112. }
  1113. let toolInstanceId = ''
  1114. for (let i = 0; i < this.currSelectList.length; i++) {
  1115. toolInstanceId += this.currSelectList[i].toolInstanceId + ";"
  1116. }
  1117. toolInstanceId = toolInstanceId.substring(0, toolInstanceId.length - 1)
  1118. let jsonData = {
  1119. reportFamily: reportFamily,
  1120. toolInstanceId: toolInstanceId,
  1121. }
  1122. printTool(jsonData).then(({data}) => {
  1123. if (data.code != 0) {
  1124. this.$alert(data.msg, '操作提示', {
  1125. confirmButtonText: '确定',
  1126. callback: action => {
  1127. this.bannersBut = false
  1128. }
  1129. });
  1130. }
  1131. })
  1132. },
  1133. // 文件下载
  1134. fileDownload(row) {
  1135. axios.get('/api/ftp/file/downFtpFile/' + row.id, {
  1136. responseType: 'blob',
  1137. headers: {
  1138. 'Content-Type': 'application/json',
  1139. 'token': Vue.cookie.get('token')
  1140. }
  1141. }).then(({data}) => {
  1142. // 不限制文件下载类型
  1143. const blob = new Blob([data], {type: "application/octet-stream"})
  1144. // 下载文件名称
  1145. const fileName = row.fileName
  1146. // a标签下载
  1147. const linkNode = document.createElement('a')
  1148. linkNode.download = fileName // a标签的download属性规定下载文件的名称
  1149. linkNode.style.display = 'none'
  1150. linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
  1151. // if(val == 'Y'){
  1152. // this.pdfVisible = true
  1153. // this.pdfUrl = linkNode.href
  1154. // }else {
  1155. document.body.appendChild(linkNode)
  1156. linkNode.click() // 模拟在按钮上的一次鼠标单击
  1157. URL.revokeObjectURL(linkNode.href) // 释放URL 对象
  1158. document.body.removeChild(linkNode)
  1159. // }
  1160. })
  1161. },
  1162. filePreview(row) {
  1163. this.pdfVisible = true
  1164. this.pdfUrl = 'http://192.168.1.2:9002/file/' + row.newFileName
  1165. },
  1166. //初始化文件信息模态框
  1167. initFileModel(row) {
  1168. this.currentData = row
  1169. this.getFileList(row)
  1170. this.setUp.fileFlag = true
  1171. },
  1172. //获取申请单号文件信息
  1173. getFileList(row) {
  1174. let jsonData = {
  1175. site: row.site,
  1176. // type : 'PRFile',
  1177. associatedField1: row.transactionId
  1178. }
  1179. this.fileList = []
  1180. getFileList(jsonData).then(({data}) => {
  1181. if (data.code == 0) {
  1182. this.fileList = data.row
  1183. }
  1184. })
  1185. },
  1186. getCurrSelectList(row) {
  1187. this.currSelectList = row
  1188. },
  1189. //检验横幅宽幅是否存在
  1190. saveBanners() {
  1191. this.bannersBut = true
  1192. if (this.torNumacc == "" || this.torNumacc <= 0) {
  1193. this.$alert('请输入正确的横幅!', '横幅', {
  1194. confirmButtonText: '确定',
  1195. callback: action => {
  1196. this.bannersBut = false
  1197. }
  1198. });
  1199. return
  1200. } else if (this.torNumdown == "" || this.torNumacc <= 0) {
  1201. this.$alert('请输入正确的宽幅!', '宽幅', {
  1202. confirmButtonText: '确定',
  1203. callback: action => {
  1204. this.bannersBut = false
  1205. }
  1206. });
  1207. return
  1208. }
  1209. let updateData = {
  1210. site: this.site,
  1211. transactionId: this.ifsToolData.transactionId,
  1212. torNumacc: this.torNumacc,
  1213. torNumdown: this.torNumdown,
  1214. }
  1215. updateIfsTool(updateData).then(({data}) => {
  1216. this.bannersBut = false
  1217. if (data.code == 0) {
  1218. this.ifsToolData.torNumacc = this.torNumacc
  1219. this.ifsToolData.torNumacc = this.torNumacc
  1220. this.bannersFlag = false
  1221. this.$message.success(data.msg)
  1222. this.initPoToolTable()
  1223. } else {
  1224. this.$message.error(data.msg)
  1225. }
  1226. })
  1227. },
  1228. // 手工生成
  1229. setToolInstanceId() {
  1230. this.toolCodeFlag = true
  1231. this.toolInstanceId = ''
  1232. },
  1233. manualInitMailFlag() {
  1234. this.generateFlag = true
  1235. if (this.toolInstanceId == null || this.toolInstanceId == '') {
  1236. this.$alert('请输入工具实例编码!', '接收数量', {
  1237. confirmButtonText: '确定',
  1238. callback: action => {
  1239. this.receiveQuantity = this.ifsToolData.quantity - this.ifsToolData.generateQuantity
  1240. this.generateFlag = false
  1241. }
  1242. });
  1243. return
  1244. } else if (this.receiveQuantity == null || this.receiveQuantity == '') {
  1245. this.$alert('请输入接收数量!', '接收数量', {
  1246. confirmButtonText: '确定',
  1247. callback: action => {
  1248. this.receiveQuantity = this.ifsToolData.quantity - this.ifsToolData.generateQuantity
  1249. this.generateFlag = false
  1250. }
  1251. });
  1252. return
  1253. } else if (this.receiveQuantity <= 0) {
  1254. this.$alert('请输入正确的接收数量!', '接收数量', {
  1255. confirmButtonText: '确定',
  1256. callback: action => {
  1257. this.receiveQuantity = this.ifsToolData.quantity - this.ifsToolData.generateQuantity
  1258. this.generateFlag = false
  1259. }
  1260. });
  1261. return
  1262. } else if (this.serviceLife == null || this.serviceLife == '') {
  1263. this.$alert('请输入使用寿命!', '使用寿命', {
  1264. confirmButtonText: '确定',
  1265. callback: action => {
  1266. this.serviceLife = 0
  1267. this.generateFlag = false
  1268. }
  1269. });
  1270. return
  1271. } else if (this.serviceLife <= 0) {
  1272. this.$alert('请输入正确的使用寿命!', '使用寿命', {
  1273. confirmButtonText: '确定',
  1274. callback: action => {
  1275. this.serviceLife = 0
  1276. this.generateFlag = false
  1277. }
  1278. });
  1279. return
  1280. } else if (this.invoicePrice <= 0) {
  1281. this.$alert('请输入入库价格!', '使用寿命', {
  1282. confirmButtonText: '确定',
  1283. callback: action => {
  1284. this.serviceLife = 0
  1285. this.generateFlag = false
  1286. }
  1287. });
  1288. return
  1289. }
  1290. if (this.radio == 'N') {
  1291. this.manualSaveToolInstanceId()
  1292. } else {
  1293. this.manualSaveToolInstanceId()
  1294. }
  1295. },
  1296. manualSaveToolInstanceId() {
  1297. let status;
  1298. if (this.radio == "Y") {
  1299. status = "出库"
  1300. } else {
  1301. status = "未投用"
  1302. }
  1303. let saveData = {
  1304. site: this.site,
  1305. toolId: this.ifsToolData.toolId,
  1306. description: this.ifsToolData.description,
  1307. userName: this.$store.state.user.name,
  1308. locationId: this.locationNo,
  1309. vendorNo: this.ifsToolData.vendorNo,
  1310. status: status,
  1311. estUseQty: this.serviceLife,
  1312. torNumacc: this.ifsToolData.torNumacc,
  1313. torNumdown: this.ifsToolData.torNumdown,
  1314. transactionId: this.ifsToolData.transactionId,
  1315. receiveQuantity: this.receiveQuantity,
  1316. type: this.radio,
  1317. orderNo: this.ifsToolData.orderNo,
  1318. releaseNo: this.ifsToolData.releaseNo,
  1319. sequenceNo: this.ifsToolData.sequenceNo,
  1320. lineItemNo: this.ifsToolData.lineItemNo,
  1321. vendorName: this.ifsToolData.vendorName,
  1322. invoicePrice: this.invoicePrice,
  1323. manual: 'Y',
  1324. toolInstanceId: this.toolInstanceId
  1325. }
  1326. let currQty = this.receiveQuantity
  1327. saveToolDetail(saveData).then(({data}) => {
  1328. this.generateFlag = false
  1329. if (data.code == 0) {
  1330. this.ifsToolData.generateQuantity += parseInt(currQty)
  1331. this.initPoToolTable()
  1332. this.toolCodeFlag = false
  1333. this.$message.success(data.msg)
  1334. } else {
  1335. this.$message.error(data.msg)
  1336. }
  1337. })
  1338. },
  1339. //检验生成事件
  1340. initMailFlag() {
  1341. this.generateFlag = true
  1342. if (this.receiveQuantity == null || this.receiveQuantity == '') {
  1343. this.$alert('请输入接收数量!', '接收数量', {
  1344. confirmButtonText: '确定',
  1345. callback: action => {
  1346. this.receiveQuantity = this.ifsToolData.quantity - this.ifsToolData.generateQuantity
  1347. this.generateFlag = false
  1348. }
  1349. });
  1350. return
  1351. } else if (this.receiveQuantity <= 0) {
  1352. this.$alert('请输入正确的接收数量!', '接收数量', {
  1353. confirmButtonText: '确定',
  1354. callback: action => {
  1355. this.receiveQuantity = this.ifsToolData.quantity - this.ifsToolData.generateQuantity
  1356. this.generateFlag = false
  1357. }
  1358. });
  1359. return
  1360. } else if (this.serviceLife == null || this.serviceLife == '') {
  1361. this.$alert('请输入使用寿命!', '使用寿命', {
  1362. confirmButtonText: '确定',
  1363. callback: action => {
  1364. this.serviceLife = 0
  1365. this.generateFlag = false
  1366. }
  1367. });
  1368. return
  1369. } else if (this.serviceLife <= 0) {
  1370. this.$alert('请输入正确的使用寿命!', '使用寿命', {
  1371. confirmButtonText: '确定',
  1372. callback: action => {
  1373. this.serviceLife = 0
  1374. this.generateFlag = false
  1375. }
  1376. });
  1377. return
  1378. } else if (this.invoicePrice <= 0) {
  1379. this.$alert('请输入入库价格!', '使用寿命', {
  1380. confirmButtonText: '确定',
  1381. callback: action => {
  1382. this.serviceLife = 0
  1383. this.generateFlag = false
  1384. }
  1385. });
  1386. return
  1387. }
  1388. if (this.radio == 'N') {
  1389. this.saveToolInstanceId()
  1390. } else {
  1391. let queryLocation = {
  1392. site: this.site,
  1393. locationid: this.locationNo,
  1394. limit: 1,
  1395. page: 1,
  1396. }
  1397. this.saveToolInstanceId()
  1398. // this.initLocationFlag(queryLocation)
  1399. }
  1400. },
  1401. // 关闭接收
  1402. closeReceive(row){
  1403. this.$confirm(`确定进行关闭接收操作?`, '提示', {
  1404. confirmButtonText: '确定',
  1405. cancelButtonText: '取消',
  1406. type: 'warning'
  1407. }).then(() => {
  1408. row.closeFlag = 'Y'
  1409. closeReceiveStatus(row).then(({data}) =>{
  1410. if (data.code == 0){
  1411. this.$message.success(data.msg)
  1412. this.initViewIfsTable('Y')
  1413. }
  1414. })
  1415. })
  1416. },
  1417. //保存接收信息
  1418. saveToolInstanceId() {
  1419. let status;
  1420. if (this.radio == "Y") {
  1421. status = "出库"
  1422. } else {
  1423. status = "未投用"
  1424. }
  1425. let saveData = {
  1426. site: this.site,
  1427. toolId: this.ifsToolData.toolId,
  1428. description: this.ifsToolData.description,
  1429. userName: this.$store.state.user.name,
  1430. locationId: this.locationNo,
  1431. vendorNo: this.ifsToolData.vendorNo,
  1432. status: status,
  1433. estUseQty: this.serviceLife,
  1434. torNumacc: this.ifsToolData.torNumacc,
  1435. torNumdown: this.ifsToolData.torNumdown,
  1436. transactionId: this.ifsToolData.transactionId,
  1437. receiveQuantity: this.receiveQuantity,
  1438. type: this.radio,
  1439. orderNo: this.ifsToolData.orderNo,
  1440. releaseNo: this.ifsToolData.releaseNo,
  1441. sequenceNo: this.ifsToolData.sequenceNo,
  1442. lineItemNo: this.ifsToolData.lineItemNo,
  1443. vendorName: this.ifsToolData.vendorName,
  1444. invoicePrice: this.invoicePrice,
  1445. manual: 'N',
  1446. toolInstanceId: this.toolInstanceId
  1447. }
  1448. let currQty = this.receiveQuantity
  1449. saveToolDetail(saveData).then(({data}) => {
  1450. this.generateFlag = false
  1451. if (data.code == 0) {
  1452. this.ifsToolData.generateQuantity += parseInt(currQty)
  1453. this.initPoToolTable()
  1454. } else {
  1455. }
  1456. this.$alert(data.msg, '操作提示', {
  1457. confirmButtonText: '确定',
  1458. callback: action => {
  1459. this.addPRDetailFlag = false
  1460. this.bannersBut = false
  1461. }
  1462. });
  1463. })
  1464. },
  1465. //校验是否存在库位
  1466. async initLocationFlag(queryLocation) {
  1467. let locationFlag
  1468. await getLocationList(queryLocation).then(({data}) => {
  1469. if (data && data.code === 0) {
  1470. let list = data.rows.list
  1471. if (list.length > 0) {
  1472. this.saveToolInstanceId()
  1473. } else {
  1474. this.$alert('请输入正确的库位!', '录入库位', {
  1475. confirmButtonText: '确定',
  1476. callback: action => {
  1477. this.serviceLife = 0
  1478. this.generateFlag = false
  1479. }
  1480. });
  1481. }
  1482. }
  1483. })
  1484. return locationFlag
  1485. },
  1486. //判断是否超过接收总数量
  1487. initQtyAlert() {
  1488. if (this.receiveQuantity > this.ifsToolData.quantity - this.ifsToolData.generateQuantity) {
  1489. this.$alert('超过当前接收数量!', '接收数量', {
  1490. confirmButtonText: '确定',
  1491. callback: action => {
  1492. this.receiveQuantity = this.ifsToolData.quantity - this.ifsToolData.generateQuantity
  1493. }
  1494. });
  1495. }
  1496. },
  1497. //校验横幅宽幅是否存在
  1498. initBannersFlag(row) {
  1499. this.ifsToolData = row
  1500. if (this.ifsToolData.torNumacc == null || this.ifsToolData.torNumacc == "" || this.ifsToolData.torNumdown == null || this.ifsToolData.torNumdown == "") {
  1501. this.torNumacc = ''
  1502. this.torNumdown = ''
  1503. this.bannersFlag = true;
  1504. } else {
  1505. this.torNumacc = this.ifsToolData.torNumacc
  1506. this.torNumdown = this.ifsToolData.torNumdown
  1507. this.initPoToolTable()
  1508. }
  1509. },
  1510. initPoToolTable() {
  1511. //是否显示加载效果
  1512. this.poToolFlag = true
  1513. this.dataListLoading = true
  1514. let queryPoTool = {
  1515. // 工具编码
  1516. toolId: this.ifsToolData.toolId,
  1517. // 工厂
  1518. site: this.site,
  1519. // 接收号
  1520. toolInstanceId: this.ifsToolData.transactionId,
  1521. }
  1522. this.receiveQuantity = this.ifsToolData.quantity - this.ifsToolData.generateQuantity
  1523. this.serviceLife = 0
  1524. this.radio = '0'
  1525. this.invoicePrice = 0
  1526. this.locationNo = ''
  1527. this.generateFlag = false
  1528. getPoToolList(queryPoTool).then(({data}) => {
  1529. if (data && data.code === 0) {
  1530. this.poToolList = data.rows
  1531. } else {
  1532. this.poToolList = []
  1533. }
  1534. this.dataListLoading = false
  1535. })
  1536. },
  1537. // 获取数据列表
  1538. initViewIfsTable(val) {
  1539. if (val == "Y") {
  1540. this.pageIndex = 1
  1541. }
  1542. //是否显示加载效果
  1543. this.dataListLoading = true
  1544. //显示数据条数
  1545. this.queryViewIfs.limit = this.pageSize
  1546. //分页页面
  1547. this.queryViewIfs.page = this.pageIndex
  1548. //设置工厂
  1549. this.queryViewIfs.site = this.site
  1550. //
  1551. getViewIfsList(this.queryViewIfs).then(({data}) => {
  1552. if (data && data.code === 0) {
  1553. this.dataList = data.rows.list
  1554. this.totalPage = data.rows.totalCount
  1555. } else {
  1556. this.dataList = []
  1557. this.totalPage = 0
  1558. }
  1559. this.dataListLoading = false
  1560. })
  1561. },
  1562. // 收藏
  1563. favorites() {
  1564. },
  1565. // 获取多语言列表
  1566. getLanguageList() {
  1567. searchSysLanguage(this.queryLanguage).then(({data}) => {
  1568. this.languageList = data.rows
  1569. })
  1570. },
  1571. // 获取button的词典
  1572. getFunctionButtonList() {
  1573. searchFunctionButtonList(this.queryButton).then(({data}) => {
  1574. if (data.data.length > 0) {
  1575. this.buttons = data.data
  1576. } else {
  1577. saveButtonList(this.buttonList).then(({data}) => {
  1578. })
  1579. }
  1580. })
  1581. },
  1582. // 获取语言词典
  1583. getSysLanguageParamList() {
  1584. searchSysLanguageParam(this.querySysLanguageParam).then(({data}) => {
  1585. this.sysLanguageParams = data.rows
  1586. })
  1587. },
  1588. // 打开页面设置
  1589. userSetting() {
  1590. this.visible = true;
  1591. this.getTableUserAll()
  1592. },
  1593. // 获取 用户的配置
  1594. getTableUserAll() {
  1595. let queryTable = {
  1596. userId: this.$store.state.user.name,
  1597. functionId: this.$route.meta.menuId,
  1598. tableId: this.tableId,
  1599. languageCode: this.$i18n.locale
  1600. }
  1601. this.visible = true;
  1602. this.$nextTick(() => {
  1603. this.$refs.column.init(queryTable);
  1604. });
  1605. },
  1606. // 获取 用户保存的 格式列
  1607. getTableUserColumn() {
  1608. getTableUserListLanguage(this.queryTableUser).then(({data}) => {
  1609. if (data.rows.length > 0) {
  1610. //this.columnList = []
  1611. this.columnList = data.rows
  1612. } else {
  1613. this.getColumnList()
  1614. }
  1615. })
  1616. },
  1617. // 保存 默认配置 列
  1618. async saveColumnList() {
  1619. // 删除所有的该页面下保存的数据
  1620. if (this.userColumnList) {
  1621. //删除 user自定义的数据
  1622. await removerUser(this.queryTable)
  1623. }
  1624. // 删除默认配置
  1625. await removerDefault(this.queryTable)
  1626. // 保存页面 table属性
  1627. let sumColumnList = this.columnList.concat(this.columnList1);
  1628. sumColumnList = sumColumnList.map(item => {
  1629. return item = {
  1630. tableId: item.tableId,
  1631. tableName: item.tableName,
  1632. columnProp: item.columnProp,
  1633. columnLabel: item.columnLabel,
  1634. columnHidden: false,
  1635. columnImage: false,
  1636. columnSortable: item.columnSortable,
  1637. columnWidth: null,
  1638. format: null,
  1639. functionId: this.$route.meta.menuId,
  1640. sortLv: 0,
  1641. status: true,
  1642. fixed: '',
  1643. serialNumber: null,
  1644. columnType: null,
  1645. align: null
  1646. }
  1647. })
  1648. await saveTableDefaultList(sumColumnList)
  1649. // 保存页面 button label title 属性
  1650. let buttons = this.buttonList.map(item => {
  1651. return item = {
  1652. functionId: this.$route.meta.menuId,
  1653. languageValue: item.languageValue,
  1654. objectId: item.objectId,
  1655. objectType: item.objectType,
  1656. tableId: item.tableId
  1657. }
  1658. })
  1659. await saveButtonList(buttons)
  1660. this.getFunctionButtonList()
  1661. this.getColumnList()
  1662. },
  1663. // 获取 tableDefault 列
  1664. getColumnList() {
  1665. getTableDefaultListLanguage(this.queryTable).then(({data}) => {
  1666. if (!data.rows.length == 0) {
  1667. // this.showDefault = false
  1668. this.columnList = data.rows
  1669. } else {
  1670. // this.showDefault = true
  1671. }
  1672. })
  1673. },
  1674. // 获取数据列表
  1675. getDataList() {
  1676. this.dataListLoading = true
  1677. this.querySysLanguagePack.limit = this.pageSize
  1678. this.querySysLanguagePack.page = this.pageIndex
  1679. searchSysLanguagePackList(this.querySysLanguagePack).then(({data}) => {
  1680. if (data && data.code === 0) {
  1681. this.dataList = data.page.list
  1682. this.totalPage = data.page.totalCount
  1683. } else {
  1684. this.dataList = []
  1685. this.totalPage = 0
  1686. }
  1687. this.dataListLoading = false
  1688. })
  1689. },
  1690. // 每页数
  1691. sizeChangeHandle(val) {
  1692. this.pageSize = val
  1693. this.pageIndex = 1
  1694. this.initViewIfsTable()
  1695. },
  1696. // 当前页
  1697. currentChangeHandle(val) {
  1698. this.pageIndex = val
  1699. this.initViewIfsTable()
  1700. },
  1701. // 多选
  1702. selectionChangeHandle(val) {
  1703. this.dataListSelections = val
  1704. },
  1705. // 删除
  1706. deleteHandle(id) {
  1707. var ids = id ? [id] : this.dataListSelections.map(item => {
  1708. return item.id
  1709. })
  1710. this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
  1711. confirmButtonText: '确定',
  1712. cancelButtonText: '取消',
  1713. type: 'warning'
  1714. }).then(() => {
  1715. this.$http({
  1716. url: this.$http.adornUrl('//prd/delete'),
  1717. method: 'post',
  1718. data: this.$http.adornData(ids, false)
  1719. }).then(({data}) => {
  1720. if (data && data.code === 0) {
  1721. this.$message.success('操作成功')
  1722. this.initViewIfsTable()
  1723. } else {
  1724. this.$message.error(data.msg)
  1725. }
  1726. })
  1727. })
  1728. },
  1729. fields() {
  1730. let json = "{"
  1731. this.columnList.forEach((item, index) => {
  1732. if (index == this.columnList.length - 1) {
  1733. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1734. } else {
  1735. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1736. }
  1737. })
  1738. json += "}"
  1739. let s = eval("(" + json + ")")
  1740. return s
  1741. },
  1742. createExportData() {
  1743. // 点击导出按钮之后,开始导出数据之前的执行函数,返回值为需要下载的数据
  1744. // TODO:构造需要下载的数据返回
  1745. exportList(this.queryViewIfs).then(({data}) => {
  1746. if (data && data.code === 0) {
  1747. return data.rows.list;
  1748. }
  1749. })
  1750. return this.dataList;
  1751. },
  1752. startDownload() {
  1753. // this.exportData = this.dataList
  1754. console.log("数据开始")
  1755. },
  1756. finishDownload() {
  1757. console.log("数据下载完成")
  1758. }
  1759. },
  1760. created() {
  1761. this.getTableUserColumn()
  1762. this.getSysLanguageParamList()
  1763. this.getFunctionButtonList()
  1764. }
  1765. }
  1766. </script>
  1767. <style>
  1768. .sl-input {
  1769. background-color: transparent;
  1770. border: 0 !important;
  1771. font-size: 12px !important;
  1772. height: 12px !important;
  1773. line-height: 14px !important;
  1774. background-color: transparent !important;
  1775. width: 140px;
  1776. }
  1777. .sl-input:focus, textarea:focus {
  1778. outline: none;
  1779. }
  1780. </style>