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.

2072 lines
70 KiB

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