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.

1714 lines
53 KiB

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