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.

1674 lines
59 KiB

  1. <template>
  2. <div>
  3. <fieldset class="customer-field" style="width: 100%; padding: 0.35em 0.75em 0.425em;">
  4. <el-row>
  5. <el-col :span="24">
  6. <el-button @click="initToolHeaderModel('Y')" type="primary">{{ buttons.add }}</el-button>
  7. <el-button @click="initToolHeaderModel('N')" type="primary">{{ buttons.edit }}</el-button>
  8. </el-col>
  9. </el-row>
  10. <el-row>
  11. <el-col :span="24">
  12. <el-form :inline="true" label-position="top" label-width="100px">
  13. <el-form-item>
  14. <el-link slot="label" @click="getBaseList(70)"> {{inputLabel.headerInput.label1}}</el-link>
  15. <el-input style="width: 100px;"
  16. @keyup.enter.native="getHeaderData"
  17. v-model="headerData.toolId"></el-input> <!---->
  18. </el-form-item>
  19. <el-form-item :label="inputLabel.headerInput.label2">
  20. <el-input style="width: 100px;" readonly v-model="headerData.toolDescription"></el-input>
  21. </el-form-item>
  22. <el-form-item :label="inputLabel.headerInput.label3">
  23. <el-input style="width: 100px;" readonly v-model="headerData.spec"></el-input>
  24. </el-form-item>
  25. <el-form-item :label="inputLabel.headerInput.label4">
  26. <el-input style="width: 100px;" readonly v-model="headerData.site"></el-input>
  27. </el-form-item>
  28. <el-form-item :label="inputLabel.headerInput.label5">
  29. <el-input style="width: 100px;" readonly v-model="headerData.familyId"></el-input>
  30. </el-form-item>
  31. <el-form-item :label="inputLabel.headerInput.label6">
  32. <el-input style="width: 100px;" readonly v-model="headerData.familyName"></el-input>
  33. </el-form-item>
  34. <el-form-item :label="inputLabel.headerInput.label7">
  35. <el-input style="width: 100px;" readonly v-model="headerData.umid"></el-input>
  36. </el-form-item>
  37. <el-form-item :label="inputLabel.headerInput.label8">
  38. <el-input style="width: 100px;" readonly v-model="headerData.strActive"></el-input>
  39. </el-form-item>
  40. </el-form>
  41. </el-col>
  42. </el-row>
  43. <el-row>
  44. <el-col :span="24">
  45. <el-form :inline="true" label-position="top" label-width="100px">
  46. <el-form-item :label="inputLabel.headerInput.label9">
  47. <el-input style="width: 100px;" readonly v-model="headerData.codeNo"></el-input>
  48. </el-form-item>
  49. <el-form-item :label="inputLabel.headerInput.label10">
  50. <el-input style="width: 100px;" readonly v-model="headerData.defaultLocationId"></el-input>
  51. </el-form-item>
  52. <el-form-item :label="inputLabel.headerInput.label11">
  53. <el-input style="width: 100px;" readonly v-model="headerData.strPartCreated"></el-input>
  54. </el-form-item>
  55. <el-form-item :label="inputLabel.headerInput.label12">
  56. <el-input style="width: 100px;" readonly v-model="headerData.partNo"></el-input>
  57. </el-form-item>
  58. <el-form-item :label="inputLabel.headerInput.label14">
  59. <el-input style="width: 100px;" readonly v-model="headerData.strCreateDate"></el-input>
  60. </el-form-item>
  61. <el-form-item :label="inputLabel.headerInput.label15">
  62. <el-input style="width: 100px;" readonly v-model="headerData.createdBy"></el-input>
  63. </el-form-item>
  64. <el-form-item :label="inputLabel.headerInput.label13">
  65. <el-input style="width: 215px;" readonly v-model="headerData.remark"></el-input>
  66. </el-form-item>
  67. </el-form>
  68. </el-col>
  69. </el-row>
  70. </fieldset>
  71. <el-tabs style="font-size: 12px" class="customer-tab" v-model="activeName" type="border-card">
  72. <el-tab-pane :label="'工具实例'" name="toolInfo">
  73. <el-row>
  74. <el-col :span="7">
  75. <fieldset class="customer-field" style="width: 98%;">
  76. <legend>数据明细/编辑</legend>
  77. <el-form :inline="true" label-position="top" label-width="95px" style="padding: 5px;">
  78. <el-form-item>
  79. <el-button @click="initToolModel('Y')" type="primary">{{ buttons.add }}</el-button>
  80. <el-button @click="initToolModel('N')" type="primary">{{ buttons.edit }}</el-button>
  81. <el-button @click="printMethod('Y')" type="primary">{{ '工具标签' }}</el-button>
  82. <el-button @click="printMethod('N')" type="primary">{{ '网版' }}</el-button>
  83. </el-form-item>
  84. </el-form>
  85. <el-form :inline="true" label-position="top" label-width="95px">
  86. <el-row>
  87. <el-col :span="12">
  88. <el-form-item :label="inputLabel.leftInput.label1">
  89. <el-select @change="toolInstanceIdChange(currentDetailData.toolInstanceId)"
  90. v-model="currentDetailData.toolInstanceId" placeholder="请选择" style="width: 150px;">
  91. <el-option
  92. v-for="item in selectList.select4"
  93. :key="item.value"
  94. :label="item.label"
  95. :value="item.value">
  96. </el-option>
  97. </el-select>
  98. </el-form-item>
  99. </el-col>
  100. <el-col :span="12">
  101. <el-form-item :label="inputLabel.leftInput.label2">
  102. <el-input style="width: 150px;" readonly v-model="currentDetailData.status"></el-input>
  103. </el-form-item>
  104. </el-col>
  105. </el-row>
  106. <el-row>
  107. <el-col :span="12">
  108. <el-form-item :label="inputLabel.leftInput.label3">
  109. <el-input style="width: 150px;" readonly v-model="currentDetailData.supplierId"></el-input>
  110. </el-form-item>
  111. </el-col>
  112. <el-col :span="12">
  113. <el-form-item :label="inputLabel.leftInput.label4">
  114. <el-input style="width: 150px;" readonly v-model="currentDetailData.supplierName"></el-input>
  115. </el-form-item>
  116. </el-col>
  117. </el-row>
  118. <el-row>
  119. <el-col :span="12">
  120. <el-form-item :label="inputLabel.leftInput.label5">
  121. <el-input style="width: 150px;" readonly v-model="currentDetailData.strPurchaseDate"></el-input>
  122. </el-form-item>
  123. </el-col>
  124. <el-col :span="12">
  125. <el-form-item :label="inputLabel.leftInput.label6">
  126. <el-input style="width: 150px;" readonly v-model="currentDetailData.steelSeal"></el-input>
  127. </el-form-item>
  128. </el-col>
  129. </el-row>
  130. <el-row>
  131. <el-col :span="12">
  132. <el-form-item :label="inputLabel.leftInput.label7">
  133. <el-input style="width: 150px;" readonly v-model="currentDetailData.strPhaseInDate"></el-input>
  134. </el-form-item>
  135. </el-col>
  136. <el-col :span="12">
  137. <el-form-item :label="inputLabel.leftInput.label8">
  138. <el-input style="width: 150px;" readonly v-model="currentDetailData.strPhaseOutDate"></el-input>
  139. </el-form-item>
  140. </el-col>
  141. </el-row>
  142. <el-row>
  143. <el-col :span="12">
  144. <el-form-item :label="inputLabel.leftInput.label9">
  145. <el-input style="width: 150px;" readonly v-model="currentDetailData.estUseQty"></el-input>
  146. </el-form-item>
  147. </el-col>
  148. <el-col :span="12">
  149. <el-form-item :label="inputLabel.leftInput.label10">
  150. <el-input style="width: 150px;" readonly v-model="currentDetailData.actualUseQty"></el-input>
  151. </el-form-item>
  152. </el-col>
  153. </el-row>
  154. <el-row>
  155. <el-col :span="12">
  156. <el-form-item :label="inputLabel.leftInput.label11">
  157. <el-input style="width: 150px;" readonly v-model="currentDetailData.strCreateDate"></el-input>
  158. </el-form-item>
  159. </el-col>
  160. <el-col :span="12">
  161. <el-form-item :label="inputLabel.leftInput.label12">
  162. <el-input style="width: 150px;" readonly v-model="currentDetailData.createdBy"></el-input>
  163. </el-form-item>
  164. </el-col>
  165. </el-row>
  166. <el-row>
  167. <el-col :span="12">
  168. <el-form-item :label="inputLabel.leftInput.label13">
  169. <el-input style="width: 150px;" readonly v-model="currentDetailData.orderNo"></el-input>
  170. </el-form-item>
  171. </el-col>
  172. <el-col :span="12">
  173. <el-form-item :label="'库位编码'">
  174. <el-input style="width: 150px;" readonly v-model="currentDetailData.locationId"></el-input>
  175. </el-form-item>
  176. </el-col>
  177. </el-row>
  178. <el-row>
  179. <el-col :span="24">
  180. <el-form-item :label="inputLabel.leftInput.label14">
  181. <el-input style="width: 300px;" readonly v-model="currentDetailData.remark"></el-input>
  182. </el-form-item>
  183. </el-col>
  184. </el-row>
  185. </el-form>
  186. </fieldset>
  187. </el-col>
  188. <el-col :span="17">
  189. <fieldset class="customer-field" style="width: 100%; ">
  190. <legend>{{inputLabel.rightInput.label1}}</legend>
  191. <el-table
  192. width="100%"
  193. :height="height/2"
  194. :data="sfdcToolingHistList"
  195. border
  196. v-loading="dataListLoading"
  197. @selection-change="selectionChangeHandle"
  198. style="width: 100%;">
  199. <el-table-column
  200. v-for="(item,index) in columnList" :key="index"
  201. :sortable="item.columnSortable"
  202. :prop="item.columnProp"
  203. :header-align="item.headerAlign"
  204. :show-overflow-tooltip="item.showOverflowTooltip"
  205. :align="item.align"
  206. :fixed="item.fixed==''?false:item.fixed"
  207. :width="item.columnWidth"
  208. :label="item.columnLabel">
  209. <template slot-scope="scope">
  210. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  211. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  212. style="width: 100px; height: 80px"/></span>
  213. </template>
  214. </el-table-column>
  215. </el-table>
  216. </fieldset>
  217. <fieldset class="customer-field" style="width: 100%; ">
  218. <legend>{{inputLabel.rightInput.label2}}</legend>
  219. <el-table
  220. width="100%"
  221. :height="height/2"
  222. :data="toolInstanceIdUseHist"
  223. border
  224. v-loading="dataListLoading"
  225. @selection-change="selectionChangeHandle"
  226. style="width: 100%;">
  227. <el-table-column
  228. v-for="(item,index) in columnList1" :key="index"
  229. :sortable="item.columnSortable"
  230. :prop="item.columnProp"
  231. :header-align="item.headerAlign"
  232. :show-overflow-tooltip="item.showOverflowTooltip"
  233. :align="item.align"
  234. :fixed="item.fixed==''?false:item.fixed"
  235. :width="item.columnWidth"
  236. :label="item.columnLabel">
  237. <template slot-scope="scope">
  238. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  239. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  240. style="width: 100px; height: 80px"/></span>
  241. </template>
  242. </el-table-column>
  243. </el-table>
  244. </fieldset>
  245. </el-col>
  246. </el-row>
  247. </el-tab-pane>
  248. <el-tab-pane :label="'使用该工具的产品清单'" name="tool">
  249. </el-tab-pane>
  250. </el-tabs>
  251. <column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column>
  252. <!--新增或编辑 工具信息-->
  253. <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag
  254. :title="'工具信息'" :visible.sync="toolHeaderShow" width="473px">
  255. <el-form :inline="true" label-position="top" label-width="100px">
  256. <el-form-item :label="inputLabel.headerInput.label1">
  257. <el-input style="width: 100px;" :readonly="!this.toolDetailAddOrEdit"
  258. v-model="editHeaderData.toolId"></el-input>
  259. </el-form-item>
  260. <el-form-item :label="inputLabel.headerInput.label2">
  261. <el-input style="width: 100px;" v-model="editHeaderData.toolDescription"></el-input>
  262. </el-form-item>
  263. <el-form-item :label="inputLabel.headerInput.label3">
  264. <el-input style="width: 100px;" v-model="editHeaderData.spec"></el-input>
  265. </el-form-item>
  266. <el-form-item>
  267. <el-link slot="label" @click="getBaseList(23)"> {{inputLabel.headerInput.label5}}</el-link>
  268. <el-input style="width: 100px;" v-model="editHeaderData.familyId"></el-input>
  269. </el-form-item>
  270. <el-form-item :label="inputLabel.headerInput.label6">
  271. <el-input style="width: 100px;" class="customer-input-color-red" readonly
  272. v-model="editHeaderData.familyName"></el-input>
  273. </el-form-item>
  274. <el-form-item>
  275. <el-link slot="label" @click="getBaseList(7)"> {{inputLabel.headerInput.label7}}</el-link>
  276. <el-input style="width: 100px;" readonly v-model="editHeaderData.umid"></el-input>
  277. </el-form-item>
  278. <el-form-item :label="inputLabel.headerInput.label9">
  279. <el-input style="width: 100px;" v-model="editHeaderData.codeNo"></el-input>
  280. </el-form-item>
  281. <el-form-item :label="inputLabel.headerInput.label8">
  282. <el-checkbox style="width: 100px;" v-model="editHeaderData.active"></el-checkbox>
  283. </el-form-item>
  284. <el-form-item :label="inputLabel.headerInput.label10">
  285. <el-input style="width: 100px;" v-model="editHeaderData.defaultLocationId"></el-input>
  286. </el-form-item>
  287. <el-form-item :label="inputLabel.headerInput.label13">
  288. <el-input style="width: 215px;" v-model="editHeaderData.remark"></el-input>
  289. </el-form-item>
  290. <el-form-item :label="inputLabel.headerInput.label11">
  291. <el-checkbox style="width: 100px;" v-model="editHeaderData.strPartCreated"></el-checkbox>
  292. </el-form-item>
  293. </el-form>
  294. <span slot="footer" class="dialog-footer">
  295. <el-button type="primary" @click="saveAndUpdateToolHeader()">确定</el-button>
  296. <el-button type="primary" @click="toolHeaderShow = false">取消</el-button>
  297. </span>
  298. </el-dialog>
  299. <!--新增或编辑实例-->
  300. <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag
  301. :title="inputLabel.leftInput.label15" :visible.sync="setUp.toolEditFlag" width="736px">
  302. <el-form :inline="true" label-position="top">
  303. <el-form-item :label="inputLabel.leftInput.label1">
  304. <el-input style="width: 130px;" :readonly="toolDetailAddOrEdit" v-model="editData.toolInstanceId"></el-input>
  305. </el-form-item>
  306. <el-form-item :label="inputLabel.leftInput.label2">
  307. <el-select style="width: 130px;" v-model="editData.status">
  308. <el-option label="未投用" value="未投用"></el-option>
  309. <el-option label="已投用" value="已投用"></el-option>
  310. <el-option label="停用" value="停用"></el-option>
  311. </el-select>
  312. <!-- <el-input style="width: 130px;" :readonly="toolDetailAddOrEdit" v-model="editData.status"></el-input>-->
  313. </el-form-item>
  314. <el-form-item>
  315. <span slot="label" @click="getBaseList(3)"><el-link>{{'供应商编码'}}</el-link> </span>
  316. <el-input style="width: 130px;" v-model="editData.supplierId"></el-input>
  317. </el-form-item>
  318. <el-form-item :label="inputLabel.leftInput.label4">
  319. <el-input style="width: 274px;" class="customer-input-color-red" readonly
  320. v-model="editData.supplierName"></el-input>
  321. </el-form-item>
  322. <el-form-item :label="inputLabel.leftInput.label5" style="height: 28px;">
  323. <el-date-picker
  324. v-model="editData.strPurchaseDate"
  325. value-format='yyyy-MM-dd'
  326. format='yyyy-MM-dd'
  327. placeholder="选择日期"
  328. style="width: 130px;">
  329. </el-date-picker>
  330. </el-form-item>
  331. <el-form-item :label="inputLabel.leftInput.label6">
  332. <el-input style="width: 130px;" v-model="editData.steelSeal"></el-input>
  333. </el-form-item>
  334. <el-form-item :label="inputLabel.leftInput.label7">
  335. <el-date-picker
  336. v-model="editData.strPhaseInDate"
  337. value-format='yyyy-MM-dd '
  338. format='yyyy-MM-dd'
  339. placeholder="选择日期"
  340. style="width: 130px;">
  341. </el-date-picker>
  342. </el-form-item>
  343. <el-form-item :label="inputLabel.leftInput.label8">
  344. <el-date-picker
  345. v-model="editData.strPhaseOutDate"
  346. placeholder="选择日期"
  347. value-format='yyyy-MM-dd'
  348. format='yyyy-MM-dd'
  349. style="width: 130px;">
  350. </el-date-picker>
  351. </el-form-item>
  352. <el-form-item :label="inputLabel.leftInput.label9">
  353. <el-input oninput="value=value.replace(/[^0-9]/g,'')" style="width: 130px;"
  354. v-model="editData.estUseQty"></el-input>
  355. </el-form-item>
  356. <el-form-item :label="inputLabel.leftInput.label10">
  357. <el-input oninput="value=value.replace(/[^0-9]/g,'')" style="width: 130px;"
  358. v-model="editData.actualUseQty"></el-input>
  359. </el-form-item>
  360. <el-form-item :label="'库位编码'">
  361. <el-input style="width: 130px;" v-model="editData.locationId"></el-input>
  362. </el-form-item>
  363. <el-form-item :label="inputLabel.leftInput.label14">
  364. <el-input style="width: 418px;" v-model="editData.remark"></el-input>
  365. </el-form-item>
  366. </el-form>
  367. <span slot="footer" class="dialog-footer">
  368. <el-button type="primary" :disabled="setUp.saveToolFlag" @click="saveAndUpdateToolDetail()">确定</el-button>
  369. <el-button type="primary" @click="setUp.toolEditFlag = false">取消</el-button>
  370. </span>
  371. </el-dialog>
  372. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  373. </div>
  374. </template>
  375. <script>
  376. import Chooselist from '@/views/modules/common/Chooselist'
  377. import column from "../common/column";
  378. import {
  379. searchSysLanguagePackList,
  380. searchSysLanguageParam,
  381. searchFunctionButtonList,
  382. saveButtonList,
  383. searchSysLanguage,
  384. searchLanguageListByLanguageCode,
  385. saveSysLanguageOne
  386. } from "@/api/sysLanguage.js"
  387. import getLodop from '@/utils/LodopFuncs.js'
  388. import {
  389. saveTableDefaultList,
  390. saveTableUser,
  391. getTableDefaultListLanguage,
  392. getTableUserListLanguage
  393. } from "@/api/table.js"
  394. import {
  395. userFavoriteList,
  396. saveUserFavorite,
  397. removeUserFavorite,
  398. } from '@/api/userFavorite.js'
  399. import {
  400. getToolHeaderData,
  401. getToolDetailList,
  402. getToolInstanceIdUseHist,
  403. getSfdcToolingHistList,
  404. getToolHeaderList,
  405. updateToolDetail,
  406. saveToolInfoDetail,
  407. editToolHeader,
  408. saveToolHeader
  409. } from '@/api/knifemold/tool-info.js'
  410. import {
  411. printToolData
  412. } from "@/api/knifemold/receive.js"
  413. export default {
  414. components: {
  415. column,
  416. Chooselist
  417. },
  418. data() {
  419. return {
  420. activeName: 'toolInfo',
  421. toolHeaderShow: false,
  422. toolHeaderAddOrEdit: false,
  423. toolDetailAddOrEdit: false,
  424. toolHeaderList: [],
  425. queryHeaderData: {
  426. site: this.$store.state.user.site,
  427. toolId: '',
  428. toolDescription: ''
  429. },
  430. editData: {
  431. actualUseQty: 0,
  432. createDate: "",
  433. createdBy: this.$store.state.user.name,
  434. description: null,
  435. estUseQty: 0,
  436. inspectDuration: null,
  437. lastUpdateBy: null,
  438. latestInspectDate: null,
  439. latestUseDate: null,
  440. locationId: null,
  441. phaseInDate: "",
  442. phaseOutDate: "",
  443. purchaseDate: "",
  444. remark: "",
  445. site: this.$store.state.user.site,
  446. status: "",
  447. statusRef: null,
  448. steelSeal: null,
  449. strCreateDate: "",
  450. strLatestInspectDate: null,
  451. strLatestUseDate: null,
  452. strPhaseInDate: "",
  453. strPhaseOutDate: "",
  454. strPurchaseDate: "",
  455. supplierId: "",
  456. supplierName: "",
  457. toolDescription: null,
  458. toolId: "",
  459. toolIndex: null,
  460. toolInstanceId: "",
  461. torNumacc: null,
  462. torNumdown: null,
  463. workCenterNo: null,
  464. },
  465. setUp: {
  466. toolEditFlag: false,
  467. saveToolFlag: false,
  468. toolHeaderFlag: false,
  469. },
  470. toolInstanceIdUseHist: [],
  471. sfdcToolingHistList: [],
  472. selectList: {
  473. select1: [{
  474. value: 'Y',
  475. label: '启用'
  476. }, {
  477. value: 'N',
  478. label: '禁用'
  479. }],
  480. select2: [{
  481. value: 'Y',
  482. label: '是'
  483. }, {
  484. value: 'N',
  485. label: '否'
  486. }],
  487. select3: [{
  488. value: 'P',
  489. label: '个人'
  490. }, {
  491. value: 'G',
  492. label: '组'
  493. }],
  494. select4: [],
  495. select5: [],
  496. },
  497. inputLabel: {
  498. headerInput: {
  499. label1: '工具编码',
  500. label2: '工具名称',
  501. label3: '规格型号',
  502. label4: '工厂编号',
  503. label5: '工具分类',
  504. label6: '工具分类名称',
  505. label7: '计量单位',
  506. label8: '在用',
  507. label9: '属性模块',
  508. label10: '默认库位',
  509. label11: '创建物料编码',
  510. label12: '物料编码',
  511. label13: '说明',
  512. label14: '新增日期',
  513. label15: '录入人',
  514. },
  515. leftInput: {
  516. label1: '实例编码',
  517. label2: '状态',
  518. label3: '供应商编码',
  519. label4: '供应商名称',
  520. label5: '采购日期',
  521. label6: '钢印编码',
  522. label7: '入库日期',
  523. label8: '终止日期',
  524. label9: '预计刀模寿命',
  525. label10: '使用寿命',
  526. label11: '录入日期',
  527. label12: '录入人',
  528. label13: '采购订单号',
  529. label14: '备注',
  530. label15: '工具实例信息',
  531. },
  532. rightInput: {
  533. label1: '工具使用记录:',
  534. label2: '工具维修记录:',
  535. },
  536. },
  537. currentDetailData: {
  538. actualUseQty: '',
  539. createDate: '',
  540. createdBy: '',
  541. description: '',
  542. estUseQty: '',
  543. inspectDuration: '',
  544. lastUpdateBy: '',
  545. latestInspectDate: '',
  546. latestUseDate: '',
  547. locationId: '',
  548. phaseInDate: '',
  549. phaseOutDate: '',
  550. purchaseDate: '',
  551. remark: '',
  552. site: '',
  553. status: '',
  554. statusRef: '',
  555. supplierId: '',
  556. supplierName: '',
  557. toolDescription: '',
  558. toolId: '',
  559. toolIndex: '',
  560. toolInstanceId: '',
  561. torNumacc: '',
  562. torNumdown: '',
  563. workCenterNo: '',
  564. steelSeal: '',
  565. strCreateDate: '',
  566. strLatestInspectDate: '',
  567. strLatestUseDate: '',
  568. strPhaseInDate: '',
  569. strPhaseOutDate: '',
  570. strPurchaseDate: '',
  571. },
  572. detailList: [],
  573. headerData: {
  574. active: "",
  575. codeNo: null,
  576. createDate: "",
  577. createdBy: "",
  578. defaultLocationId: null,
  579. defaultWarehouseId: null,
  580. familyId: null,
  581. familyName: null,
  582. lastUpdateBy: null,
  583. partCreatedFlag: null,
  584. partNo: null,
  585. remark: null,
  586. site: this.$store.state.user.site,
  587. spec: null,
  588. standardCost: null,
  589. strActive: "",
  590. strCreateDate: "",
  591. strPartCreated: "",
  592. toolDescription: "",
  593. toolId: "",
  594. umid: null
  595. },
  596. editHeaderData: {
  597. active: "",
  598. codeNo: null,
  599. createDate: "",
  600. createdBy: "",
  601. defaultLocationId: null,
  602. defaultWarehouseId: null,
  603. familyId: null,
  604. familyName: null,
  605. lastUpdateBy: null,
  606. partCreatedFlag: null,
  607. partNo: null,
  608. remark: null,
  609. site: this.$store.state.user.site,
  610. spec: null,
  611. standardCost: null,
  612. strActive: "",
  613. strCreateDate: "",
  614. strPartCreated: "",
  615. toolDescription: "",
  616. toolId: "",
  617. umid: null
  618. },
  619. site: this.$store.state.user.site,
  620. // table高度
  621. height: 450,
  622. // 是否收藏
  623. favorite: false,
  624. addLanguage: false,
  625. functionId: 2501,
  626. tableId: "toolInfo2501",
  627. value1: true,
  628. visible: false,
  629. showDefault: false,
  630. // 默认table 查询参数
  631. queryTable: {
  632. functionId: 2501,
  633. tableId: "toolInfo2501",
  634. languageCode: this.$i18n.locale
  635. },
  636. // 用户table 查询参数
  637. queryTableUser: {
  638. userId: this.$store.state.user.name,
  639. functionId: 2501,
  640. tableId: "toolInfo2501",
  641. status: true,
  642. languageCode: this.$i18n.locale
  643. },
  644. // 语言词典查询参数
  645. querySysLanguageParam: {
  646. languageCode: this.$i18n.locale
  647. },
  648. // 语言词典集合
  649. sysLanguageParams: [],
  650. // 用户table 配置集合
  651. userColumnList: [],
  652. // 展示列集
  653. columnList: [
  654. {
  655. userId: this.$store.state.user.name,
  656. functionId: 2501,
  657. serialNumber: 'toolUseHist2501OrderNo',
  658. tableId: "toolUseHist2501",
  659. tableName: "toolUseHist",
  660. columnProp: "orderNo",
  661. headerAlign: "center",
  662. align: "center",
  663. columnLabel: "生产订单号",
  664. columnHidden: false,
  665. columnImage: false,
  666. columnSortable: true,
  667. sortLv: 0,
  668. status: true,
  669. fixed: false
  670. },
  671. {
  672. userId: this.$store.state.user.name,
  673. functionId: 2501,
  674. serialNumber: 'toolUseHist2501FinishQty',
  675. tableId: "toolUseHist2501",
  676. tableName: "toolUseHist",
  677. columnProp: "finishQty",
  678. headerAlign: "center",
  679. align: "center",
  680. columnLabel: "使用寿命",
  681. columnHidden: false,
  682. columnImage: false,
  683. columnSortable: true,
  684. sortLv: 0,
  685. status: true,
  686. fixed: false,
  687. },
  688. {
  689. userId: this.$store.state.user.name,
  690. functionId: 2501,
  691. serialNumber: 'toolUseHist2501OStrReportDate',
  692. tableId: "toolUseHist2501",
  693. tableName: "toolUseHist",
  694. columnProp: "strReportDate",
  695. headerAlign: "center",
  696. align: "center",
  697. columnLabel: "录入日期",
  698. columnHidden: false,
  699. columnImage: false,
  700. columnSortable: true,
  701. sortLv: 0,
  702. status: true,
  703. fixed: false,
  704. },
  705. {
  706. userId: this.$store.state.user.name,
  707. functionId: 2501,
  708. serialNumber: 'toolUseHist2501Reportedby',
  709. tableId: "toolUseHist2501",
  710. tableName: "toolUseHist",
  711. columnProp: "reportedby",
  712. headerAlign: "center",
  713. align: "center",
  714. columnLabel: "录入人",
  715. columnHidden: false,
  716. columnImage: false,
  717. columnSortable: true,
  718. sortLv: 0,
  719. status: true,
  720. fixed: false,
  721. }
  722. ],
  723. // 展示列集
  724. columnList1: [
  725. {
  726. userId: this.$store.state.user.name,
  727. functionId: 2501,
  728. tableId: "service2501",
  729. tableName: "service",
  730. columnProp: "strDeliveryDate",
  731. headerAlign: "center",
  732. align: "center",
  733. columnLabel: "送修日期",
  734. columnHidden: false,
  735. columnImage: false,
  736. columnSortable: true,
  737. sortLv: 0,
  738. status: true,
  739. fixed: false
  740. },
  741. {
  742. userId: this.$store.state.user.name,
  743. functionId: 2501,
  744. tableId: "service2501",
  745. tableName: "service",
  746. columnProp: "supplierName",
  747. headerAlign: "center",
  748. align: "center",
  749. columnLabel: "供应商",
  750. columnHidden: false,
  751. columnImage: false,
  752. columnSortable: true,
  753. sortLv: 0,
  754. status: true,
  755. fixed: false,
  756. },
  757. {
  758. userId: this.$store.state.user.name,
  759. functionId: 2501,
  760. tableId: "service2501",
  761. tableName: "service",
  762. columnProp: "strReturnDate",
  763. headerAlign: "center",
  764. align: "center",
  765. columnLabel: "返回日期",
  766. columnHidden: false,
  767. columnImage: false,
  768. columnSortable: true,
  769. sortLv: 0,
  770. status: true,
  771. fixed: false,
  772. },
  773. {
  774. userId: this.$store.state.user.name,
  775. functionId: 2501,
  776. tableId: "service2501",
  777. tableName: "service",
  778. columnProp: "createdBy",
  779. headerAlign: "center",
  780. align: "center",
  781. columnLabel: "接收人",
  782. columnHidden: false,
  783. columnImage: false,
  784. columnSortable: true,
  785. sortLv: 0,
  786. status: true,
  787. fixed: false,
  788. },
  789. // {
  790. // userId: this.$store.state.user.name,
  791. // functionId: 2501,
  792. // tableId: "common1002",
  793. // tableName: "commonLanguage",
  794. // columnProp: "languageCode",
  795. // headerAlign: "center",
  796. // align: "center",
  797. // columnLabel: "语言编码",
  798. // columnHidden: false,
  799. // columnImage: false,
  800. // columnSortable: true,
  801. // sortLv: 0,
  802. // status: true,
  803. // fixed: false,
  804. // }
  805. ],
  806. columnList2: [
  807. {
  808. userId: this.$store.state.user.name,
  809. functionId: 2501,
  810. tableId: "toolHeader2501",
  811. tableName: "toolHeader",
  812. columnProp: "toolId",
  813. headerAlign: "center",
  814. align: "center",
  815. columnLabel: "工具编码",
  816. columnHidden: false,
  817. columnImage: false,
  818. columnSortable: true,
  819. sortLv: 0,
  820. status: true,
  821. fixed: false
  822. },
  823. {
  824. userId: this.$store.state.user.name,
  825. functionId: 2501,
  826. tableId: "toolHeader2501",
  827. tableName: "toolHeader",
  828. columnProp: "toolDescription",
  829. headerAlign: "center",
  830. align: "center",
  831. columnLabel: "工具名称",
  832. columnHidden: false,
  833. columnImage: false,
  834. columnSortable: true,
  835. sortLv: 0,
  836. status: true,
  837. fixed: false
  838. },
  839. ],
  840. // 数据集
  841. dataList: [],
  842. queryButton: {
  843. functionId: 2501,
  844. table_id: 'toolInfo2501',
  845. languageCode: this.$i18n.locale,
  846. objectType: 'button'
  847. },
  848. buttons: {
  849. add: '添加',
  850. edit: '编辑',
  851. delete: '删除',
  852. deleteList: '批量删除',
  853. cz: '操作',
  854. search: '查询',
  855. download: '导出',
  856. settingTable: '设置列表',
  857. defaultTable: '设置默认配置'
  858. },
  859. // 导出 start
  860. exportData: [],
  861. exportName: "页面功能语言",
  862. exportHeader: ["页面功能语言"],
  863. exportFooter: [],
  864. exportDefaultValue: "这一行这一列没有数据",
  865. // 导出 end
  866. buttonList: [
  867. // {
  868. // functionId: "2501",
  869. // languageValue: '添加',
  870. // objectId: 'add',
  871. // objectType: "button",
  872. // tableId: "toolInfo2501"
  873. // },
  874. // {
  875. // functionId: "2501",
  876. // languageValue: '编辑',
  877. // objectId: 'edit',
  878. // objectType: "button",
  879. // tableId: "toolInfo2501"
  880. // },
  881. // {
  882. // functionId: "2501",
  883. // languageValue: '删除',
  884. // objectId: 'delete',
  885. // objectType: "button",
  886. // tableId: "toolInfo2501"
  887. // },
  888. // {
  889. // functionId: "2501",
  890. // languageValue: '批量删除',
  891. // objectId: 'deleteList',
  892. // objectType: "button",
  893. // tableId: "toolInfo2501"
  894. // },
  895. // {
  896. // functionId: "2501",
  897. // languageValue: '操作',
  898. // objectId: 'cz',
  899. // objectType: "button",
  900. // tableId: "toolInfo2501"
  901. // },
  902. // {
  903. // functionId: "2501",
  904. // languageValue: '查询',
  905. // objectId: 'search',
  906. // objectType: "button",
  907. // tableId: "toolInfo2501"
  908. // },
  909. // {
  910. // functionId: "2501",
  911. // languageValue: '导出',
  912. // objectId: 'download',
  913. // objectType: "button",
  914. // tableId: "toolInfo2501"
  915. // },
  916. // {
  917. // functionId: "2501",
  918. // languageValue: '设置列表',
  919. // objectId: 'settingTable',
  920. // objectType: "button",
  921. // tableId: "toolInfo2501"
  922. // },
  923. // {
  924. // functionId: "2501",
  925. // languageValue: '设置默认配置',
  926. // objectId: 'defaultTable',
  927. // objectType: "button",
  928. // tableId: "toolInfo2501"
  929. // }
  930. ],
  931. languageList: [],
  932. languageColumnList: [],
  933. languageDataList: [],
  934. queryLanguage: {},
  935. // 数据集条件
  936. querySysLanguagePack: {
  937. page: 1,
  938. limit: 1,
  939. languageValue: '',
  940. objectType: '',
  941. objectId: ''
  942. },
  943. // 分页
  944. pageIndex: 1,
  945. pageSize: 20,
  946. totalPage: 0,
  947. dataListLoading: false,
  948. dataListSelections: [],
  949. addOrUpdateVisible: false
  950. }
  951. },
  952. watch: {
  953. editData: {
  954. deep: true,
  955. handler: function (newV, oldV) {
  956. if (this.editData.locationId) {
  957. this.editData.locationId = this.editData.locationId.toUpperCase()
  958. }
  959. }
  960. },
  961. editHeaderData: {
  962. deep: true,
  963. handler: function (newV, oldV) {
  964. if (this.editHeaderData.toolId) {
  965. this.editHeaderData.toolId = this.editHeaderData.toolId.toUpperCase()
  966. }
  967. }
  968. },
  969. },
  970. mounted() {
  971. this.$nextTick(() => {
  972. this.height = window.innerHeight - 310;
  973. })
  974. },
  975. activated() {
  976. this.getHeaderData()
  977. // this.getDataList()
  978. this.getLanguageList()
  979. },
  980. methods: {
  981. printMethod(val) {
  982. if (!this.currentDetailData.toolInstanceId) {
  983. this.$alert('请选择工具信息!', '操作提示', {
  984. confirmButtonText: '确定',
  985. callback: action => {
  986. this.bannersBut = false
  987. }
  988. });
  989. return
  990. }
  991. let dto = {
  992. site: this.currentDetailData.site,
  993. toolInstanceId: this.currentDetailData.toolInstanceId
  994. }
  995. printToolData(dto).then(({data}) => {
  996. if (data.code == 0) {
  997. let printDataList = []
  998. let printData = {
  999. SupplierName: data.data.SupplierName,
  1000. createDate: data.data.createDate,
  1001. createdBy: data.data.createdBy,
  1002. estUseQty: data.data.estUseQty,
  1003. locationId: data.data.locationId,
  1004. phaseInDate: data.data.phaseInDate,
  1005. site: data.data.site,
  1006. spec: data.data.spec,
  1007. status: data.data.status,
  1008. supplierId: data.data.supplierId,
  1009. toolDescription: data.data.toolDescription,
  1010. toolId: data.data.toolId,
  1011. toolInstanceId: this.currentDetailData.toolInstanceId
  1012. }
  1013. printDataList.push(printData)
  1014. if (val == 'Y') {
  1015. this.labelPrintGJ(printDataList)
  1016. } else {
  1017. this.labelPrintWB(printDataList)
  1018. }
  1019. }
  1020. })
  1021. },
  1022. labelPrintWB(printDataList) {
  1023. const LODOP = getLodop()
  1024. if (LODOP) {
  1025. //LODOP.SET_LICENSES("", "13F0BE83846277CB60918577C6281375", "", "");
  1026. LODOP.SET_LICENSES("", "7B5624CC84E599D6B17F27DF40F4310C", "", "");
  1027. //循环调用打印机
  1028. for (let i = 0; i < printDataList.length; i++) {
  1029. let printData = printDataList[i]
  1030. LODOP.NewPage();
  1031. LODOP.SET_PRINT_PAGESIZE(0, 700, 180, "");
  1032. LODOP.SET_PRINT_MODE("PRINT_NOCOLLATE", 1);
  1033. LODOP.ADD_PRINT_RECT(2, 5, 250, 67, 0, 1);
  1034. LODOP.ADD_PRINT_LINE(19, 5, 18, 255, 0, 1);
  1035. LODOP.ADD_PRINT_LINE(36, 5, 35, 205, 0, 1);
  1036. LODOP.ADD_PRINT_LINE(54, 5, 53, 205, 0, 1);
  1037. LODOP.ADD_PRINT_LINE(2, 65, 69, 66, 0, 1);
  1038. LODOP.ADD_PRINT_LINE(68, 205, 18, 206, 0, 1);
  1039. LODOP.ADD_PRINT_BARCODE(21, 208, 90, 60, "QRCode", printData.toolInstanceId);
  1040. LODOP.ADD_PRINT_TEXT(5, 9, 60, 14, "工具名称");
  1041. LODOP.ADD_PRINT_TEXT(21, 9, 60, 15, "工具编号");
  1042. LODOP.ADD_PRINT_TEXT(38, 9, 60, 15, "实例编号");
  1043. LODOP.ADD_PRINT_TEXT(55, 9, 60, 15, "经办人");
  1044. LODOP.ADD_PRINT_TEXT(4, 70, 180, 14, printData.toolDescription);
  1045. LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
  1046. LODOP.ADD_PRINT_TEXT(21, 71, 133, 14, printData.toolId);
  1047. LODOP.ADD_PRINT_TEXT(39, 71, 133, 14, printData.toolInstanceId);
  1048. LODOP.ADD_PRINT_TEXT(55, 71, 133, 14, printData.createdBy);
  1049. }
  1050. //LODOP.PRINT_DESIGN();
  1051. //LODOP.PREVIEW();
  1052. LODOP.PRINT();
  1053. }
  1054. },
  1055. labelPrintGJ(printDataList) {
  1056. const LODOP = getLodop()
  1057. if (LODOP) {
  1058. //LODOP.SET_LICENSES("", "13F0BE83846277CB60918577C6281375", "", "");
  1059. LODOP.SET_LICENSES("", "7B5624CC84E599D6B17F27DF40F4310C", "", "");
  1060. //循环调用打印机
  1061. for (let i = 0; i < printDataList.length; i++) {
  1062. let printData = printDataList[i]
  1063. LODOP.NewPage();
  1064. LODOP.SET_PRINT_PAGESIZE(0, 700, 540, "");
  1065. LODOP.ADD_PRINT_RECT(6, 5, 250, 190, 0, 1);
  1066. LODOP.ADD_PRINT_LINE(24, 5, 23, 255, 0, 1);
  1067. LODOP.ADD_PRINT_LINE(41, 5, 40, 255, 0, 1);
  1068. LODOP.ADD_PRINT_LINE(58, 5, 57, 255, 0, 1);
  1069. LODOP.ADD_PRINT_LINE(75, 5, 74, 255, 0, 1);
  1070. LODOP.ADD_PRINT_LINE(92, 5, 91, 255, 0, 1);
  1071. LODOP.ADD_PRINT_LINE(109, 5, 108, 255, 0, 1);
  1072. LODOP.ADD_PRINT_LINE(126, 5, 125, 178, 0, 1);
  1073. LODOP.ADD_PRINT_LINE(144, 5, 143, 178, 0, 1);
  1074. LODOP.ADD_PRINT_LINE(162, 5, 161, 178, 0, 1);
  1075. LODOP.ADD_PRINT_LINE(179, 5, 178, 255, 0, 1);
  1076. LODOP.ADD_PRINT_LINE(23, 65, 195, 66, 0, 1);
  1077. LODOP.ADD_PRINT_LINE(178, 177, 108, 178, 0, 1);
  1078. LODOP.ADD_PRINT_BARCODE(110, 183, 110, 85, "QRCode", printData.toolInstanceId);
  1079. LODOP.ADD_PRINT_TEXT(9, 94, 100, 14, "工具标签");
  1080. LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
  1081. LODOP.ADD_PRINT_TEXT(26, 9, 60, 14, "工具名称");
  1082. LODOP.ADD_PRINT_TEXT(43, 9, 60, 15, "规格型号");
  1083. LODOP.ADD_PRINT_TEXT(60, 9, 60, 15, "工具编号");
  1084. LODOP.ADD_PRINT_TEXT(77, 9, 60, 15, "实例编号");
  1085. LODOP.ADD_PRINT_TEXT(94, 9, 60, 15, "厂商");
  1086. LODOP.ADD_PRINT_TEXT(111, 9, 60, 15, "入库日期");
  1087. LODOP.ADD_PRINT_TEXT(129, 9, 60, 15, "库位");
  1088. LODOP.ADD_PRINT_TEXT(147, 9, 60, 15, "经办人");
  1089. LODOP.ADD_PRINT_TEXT(181, 9, 60, 15, "检验签章");
  1090. LODOP.ADD_PRINT_TEXT(25, 72, 180, 14, printData.toolDescription);
  1091. LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
  1092. LODOP.ADD_PRINT_TEXT(42, 72, 180, 14, ""); // 规格
  1093. LODOP.ADD_PRINT_TEXT(60, 72, 180, 14, printData.toolId);
  1094. LODOP.ADD_PRINT_TEXT(78, 71, 180, 14, printData.toolInstanceId);
  1095. LODOP.ADD_PRINT_TEXT(94, 71, 180, 14, printData.SupplierName);
  1096. LODOP.ADD_PRINT_TEXT(111, 71, 95, 14, this.dayjs(printData.createDate).format("YYYY-MM-DD"));
  1097. LODOP.ADD_PRINT_TEXT(130, 71, 95, 14, printData.locationId);
  1098. LODOP.ADD_PRINT_TEXT(148, 71, 95, 14, printData.createdBy);
  1099. }
  1100. //LODOP.PRINT_DESIGN();
  1101. //LODOP.PREVIEW();
  1102. LODOP.PRINT();
  1103. }
  1104. },
  1105. getBaseData(val) {
  1106. if (this.tagNo === 70) {
  1107. this.headerData.toolId = val.ToolID
  1108. // this.headerData.toolDescription = val.ToolDescription
  1109. this.getHeaderData()
  1110. }
  1111. if (this.tagNo === 3) {
  1112. this.editData.supplierId = val.SupplierID
  1113. this.editData.supplierName = val.SupplierName
  1114. }
  1115. if (this.tagNo === 23) {
  1116. this.editHeaderData.familyId = val.FamilyID
  1117. this.editHeaderData.familyName = val.FamilyName
  1118. }
  1119. if (this.tagNo === 7) {
  1120. this.editHeaderData.umid = val.UMID
  1121. }
  1122. },
  1123. // 获取基础数据列表
  1124. getBaseList(val, number) {
  1125. this.number = number
  1126. this.tagNo = val
  1127. this.$nextTick(() => {
  1128. let strVal = "";
  1129. if (val === 3) {
  1130. strVal = this.editData.supplierId
  1131. }
  1132. if (val === 70) {
  1133. strVal = this.headerData.toolId
  1134. }
  1135. if (val === 23) {
  1136. strVal = this.editHeaderData.familyId
  1137. }
  1138. if (val === 7) {
  1139. strVal = this.editHeaderData.umid
  1140. }
  1141. this.$refs.baseList.init(val, strVal)
  1142. })
  1143. },
  1144. getTime(date) {
  1145. var json_date = new Date(date).toJSON();
  1146. return new Date(new Date(json_date) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
  1147. },
  1148. // toolDetail
  1149. initToolModel(val) {
  1150. this.setUp.toolEditFlag = true
  1151. this.setUp.saveToolFlag = false
  1152. if (val != 'Y') {
  1153. this.toolDetailAddOrEdit = true
  1154. this.editData = JSON.parse(JSON.stringify(this.currentDetailData))
  1155. } else {
  1156. Object.assign(this.$data.editData, this.$options.data.call(this).editData);
  1157. this.toolDetailAddOrEdit = false
  1158. this.editData.toolInstanceId = this.headerData.toolId
  1159. this.editData.locationId = this.headerData.defaultLocationId
  1160. this.editData.toolId = this.headerData.toolId
  1161. this.editData.status = '未投用'
  1162. }
  1163. },
  1164. async saveAndUpdateToolDetail() {
  1165. this.setUp.saveToolFlag = true
  1166. this.editData.purchaseDate = this.editData.strPurchaseDate
  1167. this.editData.phaseInDate = this.editData.strPhaseInDate
  1168. this.editData.phaseOutDate = this.editData.strPhaseOutDate
  1169. if (!this.editData.estUseQty || this.editData.estUseQty == 0) {
  1170. this.$message.warning('预计使用寿命必须大于0')
  1171. }
  1172. if (this.toolDetailAddOrEdit) {
  1173. await updateToolDetail(this.editData).then(({data}) => {
  1174. if (data.code == 0) {
  1175. this.$message.success(data.msg)
  1176. this.setUp.toolEditFlag = false
  1177. } else {
  1178. this.$message.error(data.msg)
  1179. }
  1180. this.setUp.saveToolFlag = false
  1181. })
  1182. } else {
  1183. await saveToolInfoDetail(this.editData).then(({data}) => {
  1184. if (data.code == 0) {
  1185. this.$message.success(data.msg)
  1186. this.setUp.toolEditFlag = false
  1187. } else {
  1188. this.$message.error(data.msg)
  1189. }
  1190. this.setUp.saveToolFlag = false
  1191. })
  1192. }
  1193. await this.getDetailList()
  1194. this.currentDetailData.toolInstanceId = this.editData.toolInstanceId
  1195. this.toolInstanceIdChange()
  1196. },
  1197. // toolHeader
  1198. initToolHeaderModel(val) {
  1199. this.toolHeaderShow = true
  1200. if (val == 'Y') {
  1201. this.toolDetailAddOrEdit = true
  1202. Object.assign(this.$data.editHeaderData, this.$options.data.call(this).editHeaderData);
  1203. } else {
  1204. this.toolDetailAddOrEdit = false
  1205. this.editHeaderData = JSON.parse(JSON.stringify(this.headerData))
  1206. this.editHeaderData.active = this.headerData.active == 'Y' ? true : false
  1207. }
  1208. },
  1209. saveAndUpdateToolHeader() {
  1210. if (!this.editHeaderData.toolId) {
  1211. this.$message.warning('工具编号不能为空,请选择')
  1212. }
  1213. if (!this.editHeaderData.familyId) {
  1214. this.$message.warning('工具分类不能为空,请选择')
  1215. }
  1216. if (!this.editHeaderData.umid) {
  1217. this.$message.warning('计量单位不能为空,请选择')
  1218. }
  1219. this.editHeaderData.active = this.editHeaderData.active ? 'Y' : 'N'
  1220. if (this.toolDetailAddOrEdit) {
  1221. this.editHeaderData.createdBy = this.$store.state.user.name
  1222. saveToolHeader(this.editHeaderData).then(({data}) => {
  1223. if (data.code == 0) {
  1224. this.toolHeaderShow = false
  1225. this.headerData.toolId = this.editHeaderData.toolId
  1226. this.getHeaderData()
  1227. this.$message.success(data.msg)
  1228. } else {
  1229. this.$message.warning(data.msg)
  1230. }
  1231. })
  1232. } else {
  1233. editToolHeader(this.editHeaderData).then(({data}) => {
  1234. if (data.code == 0) {
  1235. this.$message.success(data.msg)
  1236. this.toolHeaderShow = false
  1237. this.headerData.toolId = this.editHeaderData.toolId
  1238. this.getHeaderData()
  1239. } else {
  1240. this.$message.warning(data.msg)
  1241. }
  1242. })
  1243. }
  1244. },
  1245. getToolHeaderList() {
  1246. getToolHeaderList(this.queryHeaderData).then(({data}) => {
  1247. this.toolHeaderList = data.rows
  1248. })
  1249. },
  1250. //获取工具使用记录
  1251. getSfdcToolingHistList() {
  1252. let queryData = {
  1253. site: this.site,
  1254. toolInstanceId: this.currentDetailData.toolInstanceId
  1255. }
  1256. getSfdcToolingHistList(queryData).then(({data}) => {
  1257. this.sfdcToolingHistList = data.rows
  1258. })
  1259. },
  1260. //获取工具使用记录
  1261. getToolInstanceIdUseHist() {
  1262. let queryData = {
  1263. site: this.site,
  1264. toolInstanceId: this.currentDetailData.toolInstanceId
  1265. }
  1266. getToolInstanceIdUseHist(queryData).then(({data}) => {
  1267. this.toolInstanceIdUseHist = data.rows
  1268. })
  1269. },
  1270. toolInstanceIdChange() {
  1271. this.sfdcToolingHistList = []
  1272. this.toolInstanceIdUseHist = []
  1273. let queryData = {
  1274. site: this.site,
  1275. toolInstanceId: this.currentDetailData.toolInstanceId,
  1276. }
  1277. getToolDetailList(queryData).then(({data}) => {
  1278. let list = data.rows
  1279. if (list.length > 0) {
  1280. this.currentDetailData = list[0]
  1281. this.getToolInstanceIdUseHist()
  1282. this.getSfdcToolingHistList()
  1283. }
  1284. })
  1285. },
  1286. async getDetailList() {
  1287. this.currentDetailData = {}
  1288. this.selectList.select4 = []
  1289. this.sfdcToolingHistList = []
  1290. this.toolInstanceIdUseHist = []
  1291. let queryData = {
  1292. site: this.site,
  1293. toolId: this.headerData.toolId,
  1294. toolDescription: this.headerData.toolDescription,
  1295. }
  1296. await getToolDetailList(queryData).then(({data}) => {
  1297. let list = data.rows
  1298. for (let i = 0; i < list.length; i++) {
  1299. let selectData = {
  1300. value: list[i].toolInstanceId,
  1301. label: list[i].toolInstanceId,
  1302. }
  1303. this.selectList.select4.push(selectData);
  1304. }
  1305. if (list.length > 0) {
  1306. this.currentDetailData = list[0]
  1307. this.toolInstanceIdChange()
  1308. }
  1309. })
  1310. },
  1311. //获取主记录信息
  1312. getHeaderData() {
  1313. let queryData = {
  1314. site: this.site,
  1315. toolId: this.headerData.toolId,
  1316. // toolDescription: this.headerData.toolDescription,
  1317. }
  1318. getToolHeaderData(queryData).then(({data}) => {
  1319. if (data.code == 0) {
  1320. this.headerData = data.row ? data.row : this.headerData
  1321. this.getDetailList()
  1322. }
  1323. })
  1324. },
  1325. // 打印方式
  1326. printReport() {
  1327. alert(this.$store.state.user.site)
  1328. //
  1329. // const LODOP = getLodop()
  1330. // if (LODOP) {
  1331. // var strBodyStyle = '<style>'
  1332. // strBodyStyle += 'table { border-top: 1 solid #000000; border-left: 1 solid #000000; border-collapse:collapse; border-spacing:0;}'
  1333. // strBodyStyle += 'caption { line-height:2em; }'
  1334. // strBodyStyle += 'td { border-right: 1 solid #000000; border-bottom: 1 solid #000000; text-align:center; padding:2px 3px; font-size:11px;}'
  1335. // strBodyStyle += '</style>' //设置打印样式
  1336. // var strFormHtml = strBodyStyle + '<body>' + document.getElementById('commmon').innerHTML + '</body>' //获取打印内容
  1337. //
  1338. // LODOP.PRINT_INIT('') //初始化
  1339. // LODOP.PRINT_DESIGN();
  1340. // //LODOP.PREVIEW();
  1341. // //LODOP.PRINT();
  1342. //
  1343. // LODOP.SET_PRINT_PAGESIZE(2, 0, 0, 'A4') //设置横向
  1344. // LODOP.ADD_PRINT_HTM('1%', '1%', '98%', '98%', strFormHtml) //设置打印内容
  1345. // LODOP.SET_PREVIEW_WINDOW(2, 0, 0, 800, 600, '') //设置预览窗口模式和大小
  1346. // LODOP.PREVIEW()
  1347. // }
  1348. },
  1349. // 校验用户是否收藏
  1350. favoriteIsOk() {
  1351. let userFavorite = {
  1352. userId: this.$store.state.user.id,
  1353. languageCode: this.$i18n.locale
  1354. }
  1355. userFavoriteList(userFavorite).then(({data}) => {
  1356. let size = data.list.filter(item => item.menuId == this.$route.meta.menuId).length;
  1357. if (size > 0) {
  1358. this.favorite = true
  1359. } else {
  1360. this.favorite = false
  1361. }
  1362. })
  1363. },
  1364. // 收藏 OR 取消收藏
  1365. favoriteFunction() {
  1366. let userFavorite = {
  1367. userId: this.$store.state.user.id,
  1368. functionId: this.$route.meta.menuId,
  1369. }
  1370. if (this.favorite) {
  1371. // 取消收藏
  1372. this.$confirm(`确定取消收藏`, '提示', {
  1373. confirmButtonText: '确定',
  1374. cancelButtonText: '取消',
  1375. type: 'warning'
  1376. }).then(() => {
  1377. removeUserFavorite(userFavorite).then(({data}) => {
  1378. this.$message.success(data.msg)
  1379. this.favorite = false
  1380. })
  1381. })
  1382. } else {
  1383. // 收藏
  1384. saveUserFavorite(userFavorite).then(({data}) => {
  1385. this.$message.success(data.msg)
  1386. this.favorite = true
  1387. })
  1388. }
  1389. },
  1390. // 保存语言编辑
  1391. saveLanguageList(val) {
  1392. saveSysLanguageOne(val).then(({data}) => {
  1393. if (data.code == 0) {
  1394. this.$message.success(data.msg)
  1395. } else {
  1396. this.$message.error(data.msg)
  1397. }
  1398. })
  1399. },
  1400. // 编辑语言
  1401. addLanguageFun() {
  1402. if (this.querySysLanguagePack.languageCode) {
  1403. this.addLanguage = true
  1404. this.languageColumnList = []
  1405. let query = {
  1406. functionId: 2501,
  1407. tableId: "common1002",
  1408. languageCode: this.$i18n.locale
  1409. }
  1410. getTableDefaultListLanguage(query).then(({data}) => {
  1411. if (data.rows.length > 0) {
  1412. this.languageColumnList = data.rows
  1413. }
  1414. })
  1415. this.languageColumnList = this.columnList
  1416. searchLanguageListByLanguageCode(this.querySysLanguagePack).then(({data}) => {
  1417. this.languageDataList = data.rows
  1418. })
  1419. } else {
  1420. this.$message("请选中一种语言")
  1421. }
  1422. },
  1423. // 获取多语言列表
  1424. getLanguageList() {
  1425. searchSysLanguage(this.queryLanguage).then(({data}) => {
  1426. this.languageList = data.rows
  1427. })
  1428. },
  1429. // 获取button的词典
  1430. getFunctionButtonList() {
  1431. searchFunctionButtonList(this.queryButton).then(({data}) => {
  1432. if (JSON.stringify(data.data) !== '{}') {
  1433. this.buttons = data.data
  1434. } else {
  1435. saveButtonList(this.buttonList).then(({data}) => {
  1436. })
  1437. }
  1438. })
  1439. },
  1440. // 获取语言词典
  1441. getSysLanguageParamList() {
  1442. searchSysLanguageParam(this.querySysLanguageParam).then(({data}) => {
  1443. this.sysLanguageParams = data.rows
  1444. })
  1445. },
  1446. // 打开页面设置
  1447. userSetting() {
  1448. this.visible = true;
  1449. let queryTable = {
  1450. userId: this.$store.state.user.name,
  1451. functionId: 2501,
  1452. tableId: "toolInfo2501",
  1453. languageCode: this.$i18n.locale
  1454. }
  1455. this.$nextTick(() => {
  1456. this.$refs.column.init(queryTable);
  1457. });
  1458. },
  1459. // 获取 用户保存的 格式列
  1460. getTableUserColumn() {
  1461. getTableUserListLanguage(this.queryTableUser).then(({data}) => {
  1462. if (data.rows.length > 0) {
  1463. //this.columnList = []
  1464. this.columnList = data.rows
  1465. } else {
  1466. this.getColumnList()
  1467. }
  1468. })
  1469. },
  1470. // 保存 默认配置 列
  1471. saveColumnList() {
  1472. saveTableDefaultList(this.columnList).then(({data}) => {
  1473. if (data.code == 0) {
  1474. this.$message.success(data.msg)
  1475. // this.showDefault = false
  1476. } else {
  1477. this.$message.error(data.msg)
  1478. }
  1479. })
  1480. saveTableDefaultList(this.columnList1).then(({data}) => {
  1481. if (data.code == 0) {
  1482. this.$message.success(data.msg)
  1483. // this.showDefault = false
  1484. } else {
  1485. this.$message.error(data.msg)
  1486. }
  1487. })
  1488. this.getFunctionButtonList();
  1489. this.getColumnList()
  1490. },
  1491. // 获取 tableDefault 列
  1492. getColumnList() {
  1493. getTableDefaultListLanguage(this.queryTable).then(({data}) => {
  1494. if (!data.rows.length == 0) {
  1495. // this.showDefault = false
  1496. this.columnList = data.rows
  1497. } else {
  1498. // this.showDefault = true
  1499. }
  1500. })
  1501. },
  1502. // 获取数据列表
  1503. getDataList() {
  1504. this.dataListLoading = true
  1505. searchSysLanguagePackList(this.querySysLanguagePack).then(({data}) => {
  1506. if (data && data.code === 0) {
  1507. this.dataList = data.page.list
  1508. this.totalPage = data.page.totalCount
  1509. } else {
  1510. this.dataList = []
  1511. this.totalPage = 0
  1512. }
  1513. this.dataListLoading = false
  1514. })
  1515. },
  1516. // 每页数
  1517. sizeChangeHandle(val) {
  1518. this.pageSize = val
  1519. this.pageIndex = 1
  1520. this.getDataList()
  1521. },
  1522. // 当前页
  1523. currentChangeHandle(val) {
  1524. this.pageIndex = val
  1525. this.getDataList()
  1526. },
  1527. // 多选
  1528. selectionChangeHandle(val) {
  1529. this.dataListSelections = val
  1530. },
  1531. // 删除
  1532. deleteHandle(id) {
  1533. var ids = id ? [id] : this.dataListSelections.map(item => {
  1534. return item.id
  1535. })
  1536. this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
  1537. confirmButtonText: '确定',
  1538. cancelButtonText: '取消',
  1539. type: 'warning'
  1540. }).then(() => {
  1541. this.$http({
  1542. url: this.$http.adornUrl('//prd/delete'),
  1543. method: 'post',
  1544. data: this.$http.adornData(ids, false)
  1545. }).then(({data}) => {
  1546. if (data && data.code === 0) {
  1547. this.$message.success('操作成功')
  1548. this.getDataList()
  1549. } else {
  1550. this.$message.error(data.msg)
  1551. }
  1552. })
  1553. })
  1554. },
  1555. fields() {
  1556. let json = "{"
  1557. this.columnList.forEach((item, index) => {
  1558. if (index == this.columnList.length - 1) {
  1559. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1560. } else {
  1561. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1562. }
  1563. })
  1564. json += "}"
  1565. let s = eval("(" + json + ")")
  1566. return s
  1567. },
  1568. createExportData() {
  1569. // 点击导出按钮之后,开始导出数据之前的执行函数,返回值为需要下载的数据
  1570. // TODO:构造需要下载的数据返回
  1571. if (this.dataListSelections.length > 0) {
  1572. return this.dataListSelections;
  1573. }
  1574. return this.dataList;
  1575. },
  1576. startDownload() {
  1577. // this.exportData = this.dataList
  1578. },
  1579. finishDownload() {
  1580. }
  1581. },
  1582. created() {
  1583. this.getTableUserColumn()
  1584. this.getSysLanguageParamList()
  1585. this.getFunctionButtonList()
  1586. this.favoriteIsOk()
  1587. }
  1588. }
  1589. </script>
  1590. <style scoped>
  1591. .el-header, .el-footer {
  1592. background-color: #B3C0D1;
  1593. color: #333;
  1594. text-align: center;
  1595. line-height: 60px;
  1596. height: 300px;
  1597. }
  1598. .el-aside {
  1599. background-color: #D3DCE6;
  1600. color: #333;
  1601. /*text-align: center;*/
  1602. /*line-height: 200px;*/
  1603. }
  1604. .el-main {
  1605. background-color: #E9EEF3;
  1606. color: #333;
  1607. }
  1608. body > .el-container {
  1609. margin-bottom: 40px;
  1610. }
  1611. .el-container:nth-child(5) .el-aside,
  1612. .el-container:nth-child(6) .el-aside {
  1613. line-height: 260px;
  1614. }
  1615. .el-container:nth-child(7) .el-aside {
  1616. line-height: 320px;
  1617. }
  1618. /deep/ .customer-tab .el-tabs__content {
  1619. padding: 3px !important;
  1620. }
  1621. /deep/ .customer-tab .el-tabs__item {
  1622. padding: 0 20px;
  1623. height: 30px;
  1624. -webkit-box-sizing: border-box;
  1625. box-sizing: border-box;
  1626. line-height: 30px;
  1627. display: inline-block;
  1628. list-style: none;
  1629. font-size: 12px;
  1630. font-weight: 500;
  1631. color: #303133;
  1632. position: relative;
  1633. }
  1634. /*统一的input内容颜色样式*/
  1635. .customer-input-color-red /deep/ .el-input__inner {
  1636. color: red;
  1637. }
  1638. </style>