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.

1920 lines
68 KiB

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