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.

2260 lines
76 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" :model="searchData">
  4. <el-form-item :label="'BU'">
  5. <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 80px">
  6. <el-option
  7. v-for = "i in userBuList"
  8. :key = "i.buNo"
  9. :label = "i.buDesc"
  10. :value = "i.buDesc">
  11. </el-option>
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item :label="'商品组编码'">
  15. <el-input v-model="searchData.productGroupId" clearable style="width: 120px"></el-input>
  16. </el-form-item>
  17. <el-form-item :label="'商品组名称'">
  18. <el-input v-model="searchData.productGroupName" clearable style="width: 200px"></el-input>
  19. </el-form-item>
  20. <el-form-item :label="'是否在用'">
  21. <el-select clearable v-model="searchData.active" style="width: 80px">
  22. <el-option label="是" value="Y"></el-option>
  23. <el-option label="否" value="N"></el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item :label="'商品组'">
  27. <el-select clearable v-model="searchData.type" style="width: 80px">
  28. <el-option label="商品组1" value="1"></el-option>
  29. <el-option label="商品组2" value="2"></el-option>
  30. <el-option label="商品组3" value="3"></el-option>
  31. <el-option label="商品组4" value="4"></el-option>
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item :label="' '">
  35. <el-button v-if="!authSearch" @click="getDataList">查询</el-button>
  36. <el-button v-if="!authSave" type="primary" @click="addModal">新增</el-button>
  37. <download-excel
  38. :fields="fields()"
  39. :data="exportData"
  40. type="xls"
  41. :name="exportName"
  42. :header="exportHeader"
  43. :footer="exportFooter"
  44. :fetch="createExportData"
  45. :before-generate="startDownload"
  46. :before-finish="finishDownload"
  47. worksheet="导出信息"
  48. class="el-button el-button--primary el-button--medium">
  49. {{ "导出" }}
  50. </download-excel>
  51. </el-form-item>
  52. </el-form>
  53. <el-table
  54. @header-dragend="handleColumnResize"
  55. :height="height"
  56. :data="dataList"
  57. border
  58. style="width: 100%;">
  59. <el-table-column
  60. v-for="(item,index) in columnList" :key="index"
  61. :sortable="item.columnSortable"
  62. :prop="item.columnProp"
  63. :header-align="item.headerAlign"
  64. :show-overflow-tooltip="item.showOverflowTooltip"
  65. :align="item.align"
  66. :fixed="item.fixed==''?false:item.fixed"
  67. :min-width="item.columnWidth"
  68. :label="item.columnLabel">
  69. <template slot-scope="scope">
  70. <div v-if="item.columnProp !== 'active'">
  71. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  72. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  73. </div>
  74. <div v-else>
  75. <span v-if="!item.columnHidden">
  76. <span v-if="scope.row.active === 'Y'"></span>
  77. <span v-if="scope.row.active === 'N'"></span>
  78. </span>
  79. </div>
  80. </template>
  81. </el-table-column>
  82. <el-table-column
  83. fixed="right"
  84. header-align="center"
  85. align="center"
  86. width="230"
  87. label="操作">
  88. <template slot-scope="scope">
  89. <el-link v-if="!authUpdate" style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link>
  90. <el-link v-if="!authDelete" style="cursor: pointer" @click="delModal(scope.row)">删除</el-link>
  91. <el-link v-if="scope.row.type === '1'" style="cursor: pointer" @click="stdProcessModal(scope.row)">标准工序</el-link>
  92. <el-link v-if="scope.row.type === '1'" style="cursor: pointer" @click="ProcessTimeMatrixModal(scope.row)">ProcessTimeMatrix</el-link>
  93. </template>
  94. </el-table-column>
  95. </el-table>
  96. <!-- 分页栏 -->
  97. <el-pagination
  98. @size-change="sizeChangeHandle"
  99. @current-change="currentChangeHandle"
  100. :current-page="pageIndex"
  101. :page-sizes="[20, 50, 100, 200, 500]"
  102. :page-size="pageSize"
  103. :total="totalPage"
  104. layout="total, sizes, prev, pager, next, jumper">
  105. </el-pagination>
  106. <el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="495px">
  107. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  108. <el-form-item label="BU" prop="bu" :rules="rules.bu">
  109. <el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 140px">
  110. <el-option
  111. v-for = "i in userBuList"
  112. :key = "i.buNo"
  113. :label = "i.buDesc"
  114. :value = "i.buNo">
  115. </el-option>
  116. </el-select>
  117. </el-form-item>
  118. <el-form-item label="是否在用" prop="active" :rules="rules.active">
  119. <el-select v-model="modalData.active" style="width: 70px">
  120. <el-option label="是" value="Y"></el-option>
  121. <el-option label="否" value="N"></el-option>
  122. </el-select>
  123. </el-form-item>
  124. <el-form-item label="商品组" prop="type" :rules="rules.type">
  125. <el-select v-model="modalData.type" style="width: 103px">
  126. <el-option label="商品组1" value="1"></el-option>
  127. <el-option label="商品组2" value="2"></el-option>
  128. <el-option label="商品组3" value="3"></el-option>
  129. </el-select>
  130. </el-form-item>
  131. <el-form-item label="Yield Rate(%)" prop="yieldRate">
  132. <el-input
  133. v-model="modalData.yieldRate"
  134. :disabled="this.modalData.type !== '2'"
  135. style="width: 103px"
  136. placeholder="0.00"
  137. class="inlineNumber numInput"
  138. ></el-input>
  139. </el-form-item>
  140. </el-form>
  141. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  142. <el-form-item label="商品组编码" prop="productGroupId" :rules="rules.productGroupId">
  143. <el-input v-model="modalData.productGroupId" :disabled="modalDisableFlag" style="width: 140px"></el-input>
  144. </el-form-item>
  145. <el-form-item label="商品组名称" prop="productGroupName" :rules="rules.productGroupName">
  146. <el-input v-model="modalData.productGroupName" style="width: 304px"></el-input>
  147. </el-form-item>
  148. </el-form>
  149. <el-footer style="height:30px;margin-top: 20px;text-align:center">
  150. <el-button type="primary" @click="saveData">保存</el-button>
  151. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  152. </el-footer>
  153. </el-dialog>
  154. <el-dialog :title="'商品组:' + productGroupCurrentRow.productGroupName + ' - 标准工序'" :close-on-click-modal="false" v-drag :visible.sync="stdProcessFlag" @close="closeStdProcessDialog" width="1200px">
  155. <el-form :inline="true" label-position="top" :model="searchData1" @keyup.enter.native="searchProductGroupStdProcess">
  156. <el-form-item :label="'工序号'">
  157. <el-input v-model="searchData1.operationNo" clearable style="width: 120px"></el-input>
  158. </el-form-item>
  159. <el-form-item :label="'工序名称'">
  160. <el-input v-model="searchData1.operationName" clearable style="width: 120px"></el-input>
  161. </el-form-item>
  162. <el-form-item :label="' '">
  163. <el-button @click="searchProductGroupStdProcess">查询</el-button>
  164. <el-button type="primary" @click="addStdProcessModal">新增</el-button>
  165. </el-form-item>
  166. </el-form>
  167. <el-table
  168. @header-dragend="handleColumnResize"
  169. :height="height - 200"
  170. :data="stdProcessList"
  171. border
  172. style="width: 100%;">
  173. <el-table-column
  174. v-for="(item,index) in stdProcessColumnList" :key="index"
  175. v-if="item.isVisible === true ?item.isVisible:isVisible1"
  176. :sortable="item.columnSortable"
  177. :prop="item.columnProp"
  178. :header-align="item.headerAlign"
  179. :show-overflow-tooltip="item.showOverflowTooltip"
  180. :align="item.align"
  181. :fixed="item.fixed==''?false:item.fixed"
  182. :min-width="item.columnWidth"
  183. :label="item.columnLabel">
  184. <template slot-scope="scope">
  185. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  186. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  187. </template>
  188. </el-table-column>
  189. <el-table-column
  190. fixed="right"
  191. header-align="center"
  192. align="center"
  193. width="70"
  194. label="操作">
  195. <template slot-scope="scope">
  196. <el-link v-if="!authDelete" style="cursor: pointer" @click="delProductGroupStdProcessModal(scope.row)">删除</el-link>
  197. </template>
  198. </el-table-column>
  199. </el-table>
  200. <el-footer style="height:30px;margin-top: 20px;text-align:center">
  201. <el-button type="primary" @click="stdProcessFlag = false">关闭</el-button>
  202. </el-footer>
  203. </el-dialog>
  204. <el-dialog title="商品组 - 标准工序(新增)" :close-on-click-modal="false" v-drag :visible.sync="stdProcessFlag1" @close="closeStdProcess1Dialog" width="1100px">
  205. <el-table
  206. @header-dragend="handleColumnResize"
  207. :height="height - 200"
  208. :data="stdProcessList1"
  209. border
  210. @selection-change="selectionChangeHandle"
  211. style="width: 100%;">
  212. <el-table-column
  213. type="selection"
  214. header-align="center"
  215. align="center"
  216. width="50">
  217. </el-table-column>
  218. <el-table-column
  219. v-for="(item,index) in stdProcessColumnList" :key="index"
  220. v-if="item.isVisible === true ?item.isVisible:isVisible1"
  221. :sortable="item.columnSortable"
  222. :prop="item.columnProp"
  223. :header-align="item.headerAlign"
  224. :show-overflow-tooltip="item.showOverflowTooltip"
  225. :align="item.align"
  226. :fixed="item.fixed==''?false:item.fixed"
  227. :min-width="item.columnWidth"
  228. :label="item.columnLabel">
  229. <template slot-scope="scope">
  230. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  231. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  232. </template>
  233. </el-table-column>
  234. </el-table>
  235. <el-footer style="height:30px;margin-top: 20px;text-align:center">
  236. <el-button type="primary" @click="saveStdProcessData">确定</el-button>
  237. <el-button type="primary" @click="stdProcessFlag1 = false">关闭</el-button>
  238. </el-footer>
  239. </el-dialog>
  240. <el-dialog title="商品组 - Process Time Matrix" :close-on-click-modal="false" v-drag :visible.sync="productGroupPtmFlag" @close="closeProductGroupPtmDialog" width="1073px" style="margin-top: -20px">
  241. <div class="table-container" style="height: 100%;margin-top: -5px;padding: 0px !important;">
  242. <el-form :inline="true" label-position="top" style="margin-top: -10px">
  243. <el-form-item :label="' '">
  244. <p type="text" size="small" style="margin-top: -5px;margin-left: 5px;">条件</p>
  245. </el-form-item>
  246. <el-form-item :label="' '" style="margin-top: -5px">
  247. <el-button type="primary" @click="saveProductGroupPtmModal">新增</el-button>
  248. </el-form-item>
  249. </el-form>
  250. <el-table
  251. @header-dragend="handleColumnResize"
  252. title="条件"
  253. height="205px"
  254. ref="conditionTable"
  255. :data="productGroupPtmConditionList"
  256. @current-change="currentConditionChangeHandle"
  257. highlight-current-row
  258. border
  259. style="width: 100%;margin-top: -8px;">
  260. <el-table-column label="序号" prop="seqNo" align="center" width="50px"></el-table-column>
  261. <el-table-column label="条件描述" prop="conditionDesc" align="center"></el-table-column>
  262. <el-table-column label="创建时间" prop="createDate" align="center"></el-table-column>
  263. <el-table-column label="创建人" prop="createBy" align="center"></el-table-column>
  264. <el-table-column
  265. fixed="right"
  266. header-align="center"
  267. align="center"
  268. width="70"
  269. label="操作">
  270. <template slot-scope="scope">
  271. <el-link v-if="!authDelete" style="cursor: pointer" @click="delProductGroupPtmModal(scope.row)">删除</el-link>
  272. </template>
  273. </el-table-column>
  274. </el-table>
  275. </div>
  276. <el-tabs style="margin-top: -7px; width: 100%; height: 100%;" v-model="activeName" class="customer-tab"
  277. type="border-card" @tab-click="tabClick">
  278. <el-tab-pane label="参数" name="first">
  279. <el-button type="primary" @click="updatePtmConditionItemModal" style="margin-top: 5px">编辑</el-button>
  280. <el-table
  281. @header-dragend="handleColumnResize"
  282. height="255px"
  283. :data="productGroupPtmConditionItemList"
  284. border
  285. style="width: 100%">
  286. <el-table-column
  287. v-for="(item,index) in columnItemList" :key="index"
  288. :sortable="item.columnSortable"
  289. :prop="item.columnProp"
  290. :header-align="item.headerAlign"
  291. :show-overflow-tooltip="item.showOverflowTooltip"
  292. :align="item.align"
  293. :fixed="item.fixed==''?false:item.fixed"
  294. :min-width="item.columnWidth"
  295. :label="item.columnLabel">
  296. <template slot-scope="scope">
  297. <div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
  298. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  299. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  300. </div>
  301. <div v-else>
  302. {{ scope.row.textValue ? scope.row.textValue : scope.row.numValue }}
  303. </div>
  304. </template>
  305. </el-table-column>
  306. </el-table>
  307. </el-tab-pane>
  308. <el-tab-pane label="工序Process Time" name="second">
  309. <el-button type="primary" @click="updatePtmConditionProcessModal" style="margin-top: 5px">编辑</el-button>
  310. <el-table
  311. @header-dragend="handleColumnResize"
  312. height="205px"
  313. :data="productGroupPtmConditionProcessList"
  314. border
  315. style="width: 100%;">
  316. <el-table-column
  317. v-for="(item,index) in stdProcessColumnList" :key="index"
  318. v-if="item.isVisible === true ?item.isVisible:isVisible1"
  319. :sortable="item.columnSortable"
  320. :prop="item.columnProp"
  321. :header-align="item.headerAlign"
  322. :show-overflow-tooltip="item.showOverflowTooltip"
  323. :align="item.align"
  324. :fixed="item.fixed==''?false:item.fixed"
  325. :min-width="item.columnWidth"
  326. :label="item.columnLabel">
  327. <template slot-scope="scope">
  328. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  329. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  330. </template>
  331. </el-table-column>
  332. </el-table>
  333. </el-tab-pane>
  334. </el-tabs>
  335. <el-footer style="height:30px;margin-top: 10px;text-align:center">
  336. <el-button type="primary" @click="productGroupPtmFlag = false">关闭</el-button>
  337. </el-footer>
  338. </el-dialog>
  339. <el-dialog title="Process Time Matrix - 新增" :close-on-click-modal="false" v-drag :visible.sync="ptmSaveFlag" @close="closeProductGroupPtmSaveDialog" width="444px">
  340. <el-form :inline="true" label-position="top" :model="ptmModalData" :rules="rules" style="margin-top: -5px;">
  341. <el-form-item label="序号" prop="seqNo" :rules="rules.seqNo">
  342. <el-input v-model="ptmModalData.seqNo" disabled style="width: 100px"></el-input>
  343. </el-form-item>
  344. <el-form-item label="条件描述" prop="conditionDesc" :rules="rules.conditionDesc">
  345. <el-input v-model="ptmModalData.conditionDesc" style="width: 300px"></el-input>
  346. </el-form-item>
  347. <el-form-item prop="itemNo" :rules="rules.itemNo">
  348. <span style="cursor: pointer" slot="label" @click="getBaseList(219)"><a herf="#">属性模板</a></span>
  349. <el-input v-model="ptmModalData.itemNo" @blur="modelBlur(219)" style="width: 110px"></el-input>
  350. <el-input v-model="ptmModalData.itemDesc" disabled style="width: 300px"></el-input>
  351. </el-form-item>
  352. </el-form>
  353. <el-footer style="height:35px;margin-top: 20px;text-align:center">
  354. <el-button type="primary" @click="saveProductGroupPtm()">保存</el-button>
  355. <el-button type="primary" @click="ptmSaveFlag = false">关闭</el-button>
  356. </el-footer>
  357. </el-dialog>
  358. <el-dialog title="属性值编辑" :close-on-click-modal="false" v-drag :visible.sync="ptmConditionItemUpdateFlag" @close="closePtmConditionItemUpdateDialog" width="888px">
  359. <el-table
  360. @header-dragend="handleColumnResize"
  361. :height="height - 149"
  362. :data="copyItemAttributeList"
  363. border
  364. style="width: 100%">
  365. <el-table-column
  366. v-for="(item,index) in columnItemList" :key="index"
  367. :sortable="item.columnSortable"
  368. :prop="item.columnProp"
  369. :header-align="item.headerAlign"
  370. :show-overflow-tooltip="item.showOverflowTooltip"
  371. :align="item.align"
  372. :fixed="item.fixed===''?false:item.fixed"
  373. :min-width="item.columnWidth"
  374. :label="item.columnLabel"
  375. >
  376. <template slot-scope="scope">
  377. <div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
  378. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  379. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  380. </div>
  381. <div v-else>
  382. <div v-if="scope.row.valueChooseFlag !== 'Y'">
  383. <el-input-number v-model="scope.row.numValue" style="padding: 0;width: 100%" v-if="scope.row.valueTypeDb === 'N'" :controls="false"></el-input-number>
  384. <el-input v-model="scope.row.textValue" v-else></el-input>
  385. </div>
  386. <div v-else>
  387. <el-select style="width: 100%;" v-if="scope.row.valueTypeDb === 'T'" v-model="scope.row.textValue">
  388. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  389. </el-select>
  390. <el-select style="width: 100%;" v-else v-model="scope.row.numValue">
  391. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  392. </el-select>
  393. </div>
  394. </div>
  395. </template>
  396. </el-table-column>
  397. </el-table>
  398. <el-footer style="height:35px;margin-top: 20px;text-align:center">
  399. <el-button type="primary" @click="updatePtmConditionItemValue()">保存</el-button>
  400. <el-button type="primary" @click="ptmConditionItemUpdateFlag = false">关闭</el-button>
  401. </el-footer>
  402. </el-dialog>
  403. <el-dialog title="工序Process Time编辑" :close-on-click-modal="false" v-drag :visible.sync="ptmConditionProcessUpdateFlag" @close="closePtmConditionProcessUpdateDialog" width="888px">
  404. <el-table
  405. @header-dragend="handleColumnResize"
  406. height="215px"
  407. :data="copyProcessAttributeList"
  408. border
  409. style="width: 100%">
  410. <el-table-column
  411. v-for="(item,index) in stdProcessColumnList1" :key="index"
  412. v-if="item.isVisible === true ? item.isVisible : isVisible1"
  413. :sortable="item.columnSortable"
  414. :prop="item.columnProp"
  415. :header-align="item.headerAlign"
  416. :show-overflow-tooltip="item.showOverflowTooltip"
  417. :align="item.align"
  418. :fixed="item.fixed==''?false:item.fixed"
  419. :min-width="item.columnWidth"
  420. :label="item.columnLabel">
  421. <template slot-scope="scope">
  422. <div v-if="item.columnProp !== 'laborRunFactor' && item.columnProp !== 'laborCycleTime' && item.columnProp !== 'machRunFactor' && item.columnProp !== 'machCycleTime'">
  423. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  424. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  425. </div>
  426. <div v-else>
  427. <el-input v-model="scope.row.machCycleTime" v-if="item.columnProp === 'machCycleTime'" @change="changeMachCycleTime(scope.row)" class="inlineNumber numInput"></el-input>
  428. <el-input v-model="scope.row.machRunFactor" v-if="item.columnProp === 'machRunFactor'" @change="changeMachRunFactor(scope.row)" placeholder="将保留2位小数" class="inlineNumber numInput"></el-input>
  429. <el-input v-model="scope.row.laborCycleTime" v-if="item.columnProp === 'laborCycleTime'" @change="changeLaborCycleTime(scope.row)" class="inlineNumber numInput"></el-input>
  430. <el-input v-model="scope.row.laborRunFactor" v-if="item.columnProp === 'laborRunFactor'" placeholder="将保留2位小数" class="inlineNumber numInput"></el-input>
  431. </div>
  432. </template>
  433. </el-table-column>
  434. </el-table>
  435. <el-footer style="height:30px;margin-top: 20px;text-align:center">
  436. <el-button type="primary" @click="updatePtmConditionProcessValue()">保存</el-button>
  437. <el-button type="primary" @click="ptmConditionProcessUpdateFlag = false">关闭</el-button>
  438. </el-footer>
  439. </el-dialog>
  440. <!-- chooseList模态框 -->
  441. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  442. </div>
  443. </template>
  444. <script>
  445. import {
  446. productGroupInformationSearch, // 商品信息列表查询
  447. productGroupInformationSave, // 商品信息新增
  448. productGroupInformationEdit, // 商品信息编辑
  449. productGroupInformationDelete // 商品信息删除
  450. } from '@/api/part/partProductGroupInformation.js'
  451. import {searchProductGroupStdProcess,saveStdProcessData,delProductGroupStdProcess} from '@/api/part/partProductGroupStdProcess.js'
  452. import {getSiteAndBuByUserName} from "@/api/eam/eam.js"
  453. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  454. import Chooselist from '@/views/modules/common/Chooselist_eam'
  455. import {searchStandardRoutingOperationList} from "../../../api/part/standardRoutingOperation";
  456. import {delProductGroupPtm, saveProductGroupPtm, searchProductGroupPtmCondition, searchProductGroupPtmConditionItemProcess,updatePtmConditionItemValue,updatePtmConditionProcessValue} from "../../../api/part/partProductGroupPtm";
  457. import {verifyData} from "../../../api/part/partInformation";
  458. import {updateColumnSize} from "../../../api/table";
  459. export default {
  460. components: {
  461. Chooselist
  462. },
  463. watch: {
  464. searchData: {
  465. deep: true,
  466. handler: function (newV, oldV) {
  467. this.searchData.productGroupId = this.searchData.productGroupId.toUpperCase()
  468. }
  469. },
  470. modalData: {
  471. deep: true,
  472. handler: function (newV, oldV) {
  473. this.modalData.productGroupId = this.modalData.productGroupId.toUpperCase()
  474. }
  475. },
  476. ptmModalData: {
  477. deep: true,
  478. handler: function (newV, oldV) {
  479. this.ptmModalData.itemNo = this.ptmModalData.itemNo.toUpperCase()
  480. }
  481. }
  482. },
  483. data () {
  484. return {
  485. isVisible1: false,
  486. // 导出
  487. exportData: [],
  488. exportName: '商品组' + this.dayjs().format('YYYYMMDDHHmmss'),
  489. exportHeader: ['商品组'],
  490. exportFooter: [],
  491. resultList: [],
  492. userBuList: [],
  493. stdProcessList: [],
  494. stdProcessList1: [],
  495. productGroupCurrentRow: {},
  496. productGroupConditionCurrentRow: {},
  497. // 多选
  498. stdProcessList1Selections: [],
  499. // ======== 行高 ========
  500. height: 200,
  501. // ======== 分页 ========
  502. pageIndex: 1,
  503. pageSize: 50,
  504. totalPage: 0,
  505. activeName: 'first',
  506. // 条件查询
  507. searchData: {
  508. site: '',
  509. userName: this.$store.state.user.name,
  510. buDesc: '',
  511. productGroupId: '',
  512. productGroupName: '',
  513. active: '',
  514. type: '',
  515. operationNo: '',
  516. operationName: '',
  517. page: 1,
  518. limit: 10
  519. },
  520. searchData1: {
  521. site: '',
  522. userName: this.$store.state.user.name,
  523. buNo: '',
  524. productGroupId: '',
  525. productGroupName: '',
  526. active: '',
  527. type: '',
  528. operationNo: '',
  529. operationName: '',
  530. page: 1,
  531. limit: 10
  532. },
  533. searchData2: {
  534. site: '',
  535. userName: this.$store.state.user.name,
  536. buNo: '',
  537. page: 1,
  538. limit: 10
  539. },
  540. modalData: {
  541. flag: '',
  542. title: '',
  543. bu: '',
  544. site: this.$store.state.user.site,
  545. buNo: '',
  546. yieldRate: '',
  547. productGroupId: '',
  548. productGroupName: '',
  549. active: '',
  550. type: ''
  551. },
  552. ptmModalData: {
  553. bu: '',
  554. site: this.$store.state.user.site,
  555. buNo: '',
  556. seqNo: '',
  557. conditionDesc: '',
  558. recordType: '',
  559. itemNo: '',
  560. itemDesc: '',
  561. productGroupId: '',
  562. },
  563. // ======== 数据列表 ========
  564. dataList: [],
  565. productGroupPtmConditionList: [],
  566. productGroupPtmConditionItemList: [],
  567. copyItemAttributeList: [],
  568. productGroupPtmConditionProcessList: [],
  569. copyProcessAttributeList: [],
  570. // 展示列集
  571. columnList: [
  572. {
  573. userId: this.$store.state.user.name,
  574. functionId: 601006,
  575. serialNumber: '601006Table1BuDesc',
  576. tableId: "601006Table1",
  577. tableName: "商品组信息表",
  578. columnProp: 'buDesc',
  579. headerAlign: "center",
  580. align: "center",
  581. columnLabel: 'BU',
  582. columnHidden: false,
  583. columnImage: false,
  584. columnSortable: false,
  585. sortLv: 0,
  586. status: true,
  587. fixed: '',
  588. columnWidth: 80
  589. },
  590. {
  591. userId: this.$store.state.user.name,
  592. functionId: 601006,
  593. serialNumber: '601006Table1ProductGroupId',
  594. tableId: "601006Table1",
  595. tableName: "商品组信息表",
  596. columnProp: 'productGroupId',
  597. headerAlign: "center",
  598. align: "center",
  599. columnLabel: '商品组编码',
  600. columnHidden: false,
  601. columnImage: false,
  602. columnSortable: false,
  603. sortLv: 0,
  604. status: true,
  605. fixed: '',
  606. columnWidth: 120
  607. },
  608. {
  609. userId: this.$store.state.user.name,
  610. functionId: 601006,
  611. serialNumber: '601006Table1ProductGroupName',
  612. tableId: "601006Table1",
  613. tableName: "商品组信息表",
  614. columnProp: 'productGroupName',
  615. headerAlign: "center",
  616. align: "center",
  617. columnLabel: '商品组名称',
  618. columnHidden: false,
  619. columnImage: false,
  620. columnSortable: false,
  621. sortLv: 0,
  622. status: true,
  623. fixed: '',
  624. columnWidth: 300
  625. },
  626. {
  627. functionId: 601006,
  628. serialNumber: '601006Table1Active',
  629. tableId: '601006Table1',
  630. tableName: '商品组信息表',
  631. columnProp: 'active',
  632. headerAlign: 'center',
  633. align: 'center',
  634. columnLabel: '是否在用',
  635. columnHidden: false,
  636. columnImage: false,
  637. columnSortable: false,
  638. sortLv: 0,
  639. status: true,
  640. fixed: '',
  641. columnWidth: 100
  642. },
  643. {
  644. functionId: 601006,
  645. serialNumber: '601006Table1Type',
  646. tableId: "601006Table1",
  647. tableName: "商品组信息表",
  648. columnProp: "type",
  649. headerAlign: "center",
  650. align: "center",
  651. columnLabel: '商品组',
  652. columnHidden: false,
  653. columnImage: false,
  654. columnSortable: false,
  655. sortLv: 0,
  656. status: true,
  657. fixed: '',
  658. columnWidth: 120
  659. },
  660. // yieldRate
  661. {
  662. functionId: 601006,
  663. serialNumber: '601006Table1YieldRate',
  664. tableId: '601006Table1',
  665. tableName: '商品组信息表',
  666. columnProp: 'yieldRate',
  667. headerAlign: 'center',
  668. align: 'right',
  669. columnLabel: 'Yield Rate(%)',
  670. columnHidden: false,
  671. columnImage: false,
  672. columnSortable: false,
  673. sortLv: 0,
  674. status: true,
  675. fixed: '',
  676. columnWidth: 90
  677. },
  678. {
  679. userId: this.$store.state.user.name,
  680. functionId: 601006,
  681. serialNumber: '601006Table1CreateDate',
  682. tableId: '601006Table1',
  683. tableName: '商品组信息表',
  684. columnProp: 'createDate',
  685. headerAlign: 'center',
  686. align: 'center',
  687. columnLabel: '创建时间',
  688. columnHidden: false,
  689. columnImage: false,
  690. columnSortable: false,
  691. sortLv: 0,
  692. status: true,
  693. fixed: '',
  694. columnWidth: 170
  695. },
  696. {
  697. userId: this.$store.state.user.name,
  698. functionId: 601006,
  699. serialNumber: '601006Table1CreateBy',
  700. tableId: "601006Table1",
  701. tableName: "商品组信息表",
  702. columnProp: 'createBy',
  703. headerAlign: "center",
  704. align: "center",
  705. columnLabel: '创建人',
  706. columnHidden: false,
  707. columnImage: false,
  708. columnSortable: false,
  709. sortLv: 0,
  710. status: true,
  711. fixed: '',
  712. columnWidth: 100
  713. },
  714. {
  715. userId: this.$store.state.user.name,
  716. functionId: 601006,
  717. serialNumber: '601006Table1UpdateDate',
  718. tableId: "601006Table1",
  719. tableName: "商品组信息表",
  720. columnProp: 'updateDate',
  721. headerAlign: "center",
  722. align: "center",
  723. columnLabel: '更新时间',
  724. columnHidden: false,
  725. columnImage: false,
  726. columnSortable: false,
  727. sortLv: 0,
  728. status: true,
  729. fixed: '',
  730. columnWidth: 170
  731. },
  732. {
  733. userId: this.$store.state.user.name,
  734. functionId: 601006,
  735. serialNumber: '601006Table1UpdateBy',
  736. tableId: "601006Table1",
  737. tableName: "商品组信息表",
  738. columnProp: 'updateBy',
  739. headerAlign: "center",
  740. align: "center",
  741. columnLabel: '更新人',
  742. columnHidden: false,
  743. columnImage: false,
  744. columnSortable: false,
  745. sortLv: 0,
  746. status: true,
  747. fixed: '',
  748. columnWidth: 100
  749. },
  750. ],
  751. stdProcessColumnList: [
  752. {
  753. userId: this.$store.state.user.name,
  754. functionId: 601006,
  755. serialNumber: '601006Table2OperationNo',
  756. tableId: "601006Table2",
  757. tableName: "标准工序表",
  758. columnProp: 'operationNo',
  759. headerAlign: "center",
  760. align: "center",
  761. columnLabel: '工序号',
  762. columnHidden: false,
  763. columnImage: false,
  764. columnSortable: false,
  765. sortLv: 0,
  766. status: true,
  767. fixed: '',
  768. columnWidth: 80,
  769. isVisible: true // 控制显示的属性
  770. },
  771. {
  772. userId: this.$store.state.user.name,
  773. functionId: 601006,
  774. serialNumber: '601006Table2OperationName',
  775. tableId: "601006Table2",
  776. tableName: "标准工序表",
  777. columnProp: 'operationName',
  778. headerAlign: "center",
  779. align: "center",
  780. columnLabel: '工序名称',
  781. columnHidden: false,
  782. columnImage: false,
  783. columnSortable: false,
  784. sortLv: 0,
  785. status: true,
  786. fixed: '',
  787. columnWidth: 170,
  788. isVisible: true // 控制显示的属性
  789. },
  790. {
  791. functionId: 601006,
  792. serialNumber: '601006Table2WorkCenterNo',
  793. tableId: '601006Table2',
  794. tableName: '标准工序表',
  795. columnProp: 'setupCrewSize',
  796. headerAlign: 'center',
  797. align: 'right',
  798. columnLabel: '调机过程人数',
  799. columnHidden: false,
  800. columnImage: false,
  801. columnSortable: false,
  802. sortLv: 0,
  803. status: true,
  804. fixed: '',
  805. columnWidth: 100,
  806. isVisible: true // 控制显示的属性
  807. },
  808. {
  809. userId: this.$store.state.user.name,
  810. functionId: 601006,
  811. serialNumber: '601006Table2SetupLaborClassDesc',
  812. tableId: "601006Table2",
  813. tableName: "标准工序表",
  814. columnProp: 'setupLaborClassNo',
  815. headerAlign: "center",
  816. align: "center",
  817. columnLabel: '调机时人员等级编码',
  818. columnHidden: false,
  819. columnImage: false,
  820. columnSortable: false,
  821. sortLv: 0,
  822. status: true,
  823. fixed: '',
  824. columnWidth: 118,
  825. isVisible: true // 控制显示的属性
  826. },
  827. {
  828. userId: this.$store.state.user.name,
  829. functionId: 601006,
  830. serialNumber: '601006Table2SetupLaborClassDesc',
  831. tableId: "601006Table2",
  832. tableName: "标准工序表",
  833. columnProp: 'setupLaborClassDesc',
  834. headerAlign: "center",
  835. align: "left",
  836. columnLabel: '调机时人员等级描述',
  837. columnHidden: false,
  838. columnImage: false,
  839. columnSortable: false,
  840. sortLv: 0,
  841. status: true,
  842. fixed: '',
  843. columnWidth: 118,
  844. isVisible: true // 控制显示的属性
  845. },
  846. {
  847. userId: this.$store.state.user.name,
  848. functionId: 601006,
  849. serialNumber: '601006Table2MachCycleTime',
  850. tableId: "601006Table2",
  851. tableName: "标准工序表",
  852. columnProp: 'machCycleTime',
  853. headerAlign: "center",
  854. align: "right",
  855. columnLabel: '机器处理时间',
  856. columnHidden: false,
  857. columnImage: false,
  858. columnSortable: false,
  859. sortLv: 0,
  860. status: true,
  861. fixed: '',
  862. columnWidth: 100,
  863. isVisible: false // 控制显示的属性
  864. },
  865. {
  866. userId: this.$store.state.user.name,
  867. functionId: 601006,
  868. serialNumber: '601006Table2MachRunFactor',
  869. tableId: "601006Table2",
  870. tableName: "标准工序表",
  871. columnProp: 'machRunFactor',
  872. headerAlign: "center",
  873. align: "right",
  874. columnLabel: '机器单位产出',
  875. columnHidden: false,
  876. columnImage: false,
  877. columnSortable: false,
  878. sortLv: 0,
  879. status: true,
  880. fixed: '',
  881. columnWidth: 100,
  882. isVisible: false // 控制显示的属性
  883. },
  884. {
  885. functionId: 601006,
  886. serialNumber: '601006Table2WorkCenterNo',
  887. tableId: '601006Table2',
  888. tableName: '标准工序表',
  889. columnProp: 'crewSize',
  890. headerAlign: 'center',
  891. align: 'right',
  892. columnLabel: '生产过程人数',
  893. columnHidden: false,
  894. columnImage: false,
  895. columnSortable: false,
  896. sortLv: 0,
  897. status: true,
  898. fixed: '',
  899. columnWidth: 100,
  900. isVisible: true // 控制显示的属性
  901. },
  902. {
  903. userId: this.$store.state.user.name,
  904. functionId: 601006,
  905. serialNumber: '601006Table2LaborClassDesc',
  906. tableId: "601006Table2",
  907. tableName: "标准工序表",
  908. columnProp: 'laborClassNo',
  909. headerAlign: "center",
  910. align: "center",
  911. columnLabel: '人员等级编码',
  912. columnHidden: false,
  913. columnImage: false,
  914. columnSortable: false,
  915. sortLv: 0,
  916. status: true,
  917. fixed: '',
  918. columnWidth: 100,
  919. isVisible: true // 控制显示的属性
  920. },
  921. {
  922. userId: this.$store.state.user.name,
  923. functionId: 601006,
  924. serialNumber: '601006Table2LaborClassDesc',
  925. tableId: "601006Table2",
  926. tableName: "标准工序表",
  927. columnProp: 'laborClassDesc',
  928. headerAlign: "center",
  929. align: "center",
  930. columnLabel: '人员等级描述',
  931. columnHidden: false,
  932. columnImage: false,
  933. columnSortable: false,
  934. sortLv: 0,
  935. status: true,
  936. fixed: '',
  937. columnWidth: 100,
  938. isVisible: true // 控制显示的属性
  939. },
  940. {
  941. userId: this.$store.state.user.name,
  942. functionId: 601006,
  943. serialNumber: '601006Table2LaborCycleTime',
  944. tableId: "601006Table2",
  945. tableName: "标准工序表",
  946. columnProp: 'laborCycleTime',
  947. headerAlign: "center",
  948. align: "right",
  949. columnLabel: '人工处理时间',
  950. columnHidden: false,
  951. columnImage: false,
  952. columnSortable: false,
  953. sortLv: 0,
  954. status: true,
  955. fixed: '',
  956. columnWidth: 100,
  957. isVisible: false // 控制显示的属性
  958. },
  959. {
  960. userId: this.$store.state.user.name,
  961. functionId: 601006,
  962. serialNumber: '601006Table2LaborRunFactor',
  963. tableId: "601006Table2",
  964. tableName: "标准工序表",
  965. columnProp: 'laborRunFactor',
  966. headerAlign: "center",
  967. align: "right",
  968. columnLabel: '人工单位产出',
  969. columnHidden: false,
  970. columnImage: false,
  971. columnSortable: false,
  972. sortLv: 0,
  973. status: true,
  974. fixed: '',
  975. columnWidth: 100,
  976. isVisible: false // 控制显示的属性
  977. },
  978. {
  979. functionId: 601006,
  980. serialNumber: '601006Table2WorkCenterNo',
  981. tableId: '601006Table2',
  982. tableName: '标准工序表',
  983. columnProp: 'workCenterNo',
  984. headerAlign: 'center',
  985. align: 'center',
  986. columnLabel: '加工中心编码',
  987. columnHidden: false,
  988. columnImage: false,
  989. columnSortable: false,
  990. sortLv: 0,
  991. status: true,
  992. fixed: '',
  993. columnWidth: 100,
  994. isVisible: true // 控制显示的属性
  995. },
  996. {
  997. functionId: 601006,
  998. serialNumber: '601006Table2WorkCenterDesc',
  999. tableId: '601006Table2',
  1000. tableName: '标准工序表',
  1001. columnProp: 'workCenterDesc',
  1002. headerAlign: 'center',
  1003. align: 'center',
  1004. columnLabel: '加工中心名称',
  1005. columnHidden: false,
  1006. columnImage: false,
  1007. columnSortable: false,
  1008. sortLv: 0,
  1009. status: true,
  1010. fixed: '',
  1011. columnWidth: 170,
  1012. isVisible: true // 控制显示的属性
  1013. },
  1014. ],
  1015. stdProcessColumnList1: [
  1016. {
  1017. userId: this.$store.state.user.name,
  1018. functionId: 601006,
  1019. serialNumber: '601006Table2OperationNo',
  1020. tableId: "601006Table2",
  1021. tableName: "标准工序表",
  1022. columnProp: 'operationNo',
  1023. headerAlign: "center",
  1024. align: "center",
  1025. columnLabel: '工序号',
  1026. columnHidden: false,
  1027. columnImage: false,
  1028. columnSortable: false,
  1029. sortLv: 0,
  1030. status: true,
  1031. fixed: '',
  1032. columnWidth: 50,
  1033. isVisible: true // 控制显示的属性
  1034. },
  1035. {
  1036. userId: this.$store.state.user.name,
  1037. functionId: 601006,
  1038. serialNumber: '601006Table2OperationName',
  1039. tableId: "601006Table2",
  1040. tableName: "标准工序表",
  1041. columnProp: 'operationName',
  1042. headerAlign: "center",
  1043. align: "center",
  1044. columnLabel: '工序名称',
  1045. columnHidden: false,
  1046. columnImage: false,
  1047. columnSortable: false,
  1048. sortLv: 0,
  1049. status: true,
  1050. fixed: '',
  1051. columnWidth: 170,
  1052. isVisible: true // 控制显示的属性
  1053. },
  1054. {
  1055. functionId: 601006,
  1056. serialNumber: '601006Table2WorkCenterNo',
  1057. tableId: '601006Table2',
  1058. tableName: '标准工序表',
  1059. columnProp: 'setupCrewSize',
  1060. headerAlign: 'center',
  1061. align: 'right',
  1062. columnLabel: '调机过程人数',
  1063. columnHidden: false,
  1064. columnImage: false,
  1065. columnSortable: false,
  1066. sortLv: 0,
  1067. status: true,
  1068. fixed: '',
  1069. columnWidth: 100,
  1070. isVisible: true // 控制显示的属性
  1071. },
  1072. {
  1073. userId: this.$store.state.user.name,
  1074. functionId: 601006,
  1075. serialNumber: '601006Table2SetupLaborClassDesc',
  1076. tableId: "601006Table2",
  1077. tableName: "标准工序表",
  1078. columnProp: 'setupLaborClassNo',
  1079. headerAlign: "center",
  1080. align: "center",
  1081. columnLabel: '调机时人员等级编码',
  1082. columnHidden: false,
  1083. columnImage: false,
  1084. columnSortable: false,
  1085. sortLv: 0,
  1086. status: true,
  1087. fixed: '',
  1088. columnWidth: 118,
  1089. isVisible: true // 控制显示的属性
  1090. },
  1091. {
  1092. userId: this.$store.state.user.name,
  1093. functionId: 601006,
  1094. serialNumber: '601006Table2SetupLaborClassDesc',
  1095. tableId: "601006Table2",
  1096. tableName: "标准工序表",
  1097. columnProp: 'setupLaborClassDesc',
  1098. headerAlign: "center",
  1099. align: "center",
  1100. columnLabel: '调机时人员等级描述',
  1101. columnHidden: false,
  1102. columnImage: false,
  1103. columnSortable: false,
  1104. sortLv: 0,
  1105. status: true,
  1106. fixed: '',
  1107. columnWidth: 118,
  1108. isVisible: true // 控制显示的属性
  1109. },
  1110. {
  1111. userId: this.$store.state.user.name,
  1112. functionId: 601006,
  1113. serialNumber: '601006Table2MachCycleTime',
  1114. tableId: "601006Table2",
  1115. tableName: "标准工序表",
  1116. columnProp: 'machCycleTime',
  1117. headerAlign: "center",
  1118. align: "right",
  1119. columnLabel: '机器处理时间',
  1120. columnHidden: false,
  1121. columnImage: false,
  1122. columnSortable: false,
  1123. sortLv: 0,
  1124. status: true,
  1125. fixed: '',
  1126. columnWidth: 100,
  1127. isVisible: false // 控制显示的属性
  1128. },
  1129. {
  1130. userId: this.$store.state.user.name,
  1131. functionId: 601006,
  1132. serialNumber: '601006Table2MachRunFactor',
  1133. tableId: "601006Table2",
  1134. tableName: "标准工序表",
  1135. columnProp: 'machRunFactor',
  1136. headerAlign: "center",
  1137. align: "right",
  1138. columnLabel: '机器单位产出',
  1139. columnHidden: false,
  1140. columnImage: false,
  1141. columnSortable: false,
  1142. sortLv: 0,
  1143. status: true,
  1144. fixed: '',
  1145. columnWidth: 100,
  1146. isVisible: false // 控制显示的属性
  1147. },
  1148. {
  1149. functionId: 601006,
  1150. serialNumber: '601006Table2WorkCenterNo',
  1151. tableId: '601006Table2',
  1152. tableName: '标准工序表',
  1153. columnProp: 'crewSize',
  1154. headerAlign: 'center',
  1155. align: 'right',
  1156. columnLabel: '生产过程人数',
  1157. columnHidden: false,
  1158. columnImage: false,
  1159. columnSortable: false,
  1160. sortLv: 0,
  1161. status: true,
  1162. fixed: '',
  1163. columnWidth: 100,
  1164. isVisible: true // 控制显示的属性
  1165. },
  1166. {
  1167. userId: this.$store.state.user.name,
  1168. functionId: 601006,
  1169. serialNumber: '601006Table2LaborClassDesc',
  1170. tableId: "601006Table2",
  1171. tableName: "标准工序表",
  1172. columnProp: 'laborClassNo',
  1173. headerAlign: "center",
  1174. align: "center",
  1175. columnLabel: '人员等级编码',
  1176. columnHidden: false,
  1177. columnImage: false,
  1178. columnSortable: false,
  1179. sortLv: 0,
  1180. status: true,
  1181. fixed: '',
  1182. columnWidth: 100,
  1183. isVisible: true // 控制显示的属性
  1184. },
  1185. {
  1186. userId: this.$store.state.user.name,
  1187. functionId: 601006,
  1188. serialNumber: '601006Table2LaborClassDesc',
  1189. tableId: "601006Table2",
  1190. tableName: "标准工序表",
  1191. columnProp: 'laborClassDesc',
  1192. headerAlign: "center",
  1193. align: "center",
  1194. columnLabel: '人员等级描述',
  1195. columnHidden: false,
  1196. columnImage: false,
  1197. columnSortable: false,
  1198. sortLv: 0,
  1199. status: true,
  1200. fixed: '',
  1201. columnWidth: 100,
  1202. isVisible: true // 控制显示的属性
  1203. },
  1204. {
  1205. userId: this.$store.state.user.name,
  1206. functionId: 601006,
  1207. serialNumber: '601006Table2LaborCycleTime',
  1208. tableId: "601006Table2",
  1209. tableName: "标准工序表",
  1210. columnProp: 'laborCycleTime',
  1211. headerAlign: "center",
  1212. align: "right",
  1213. columnLabel: '人工处理时间',
  1214. columnHidden: false,
  1215. columnImage: false,
  1216. columnSortable: false,
  1217. sortLv: 0,
  1218. status: true,
  1219. fixed: '',
  1220. columnWidth: 100,
  1221. isVisible: false // 控制显示的属性
  1222. },
  1223. {
  1224. userId: this.$store.state.user.name,
  1225. functionId: 601006,
  1226. serialNumber: '601006Table2LaborRunFactor',
  1227. tableId: "601006Table2",
  1228. tableName: "标准工序表",
  1229. columnProp: 'laborRunFactor',
  1230. headerAlign: "center",
  1231. align: "right",
  1232. columnLabel: '人工单位产出',
  1233. columnHidden: false,
  1234. columnImage: false,
  1235. columnSortable: false,
  1236. sortLv: 0,
  1237. status: true,
  1238. fixed: '',
  1239. columnWidth: 100,
  1240. isVisible: false // 控制显示的属性
  1241. },
  1242. {
  1243. functionId: 601006,
  1244. serialNumber: '601006Table2WorkCenterNo',
  1245. tableId: '601006Table2',
  1246. tableName: '标准工序表',
  1247. columnProp: 'workCenterNo',
  1248. headerAlign: 'center',
  1249. align: 'center',
  1250. columnLabel: '加工中心编码',
  1251. columnHidden: false,
  1252. columnImage: false,
  1253. columnSortable: false,
  1254. sortLv: 0,
  1255. status: true,
  1256. fixed: '',
  1257. columnWidth: 100,
  1258. isVisible: true // 控制显示的属性
  1259. },
  1260. {
  1261. functionId: 601006,
  1262. serialNumber: '601006Table2WorkCenterDesc',
  1263. tableId: '601006Table2',
  1264. tableName: '标准工序表',
  1265. columnProp: 'workCenterDesc',
  1266. headerAlign: 'center',
  1267. align: 'center',
  1268. columnLabel: '加工中心名称',
  1269. columnHidden: false,
  1270. columnImage: false,
  1271. columnSortable: false,
  1272. sortLv: 0,
  1273. status: true,
  1274. fixed: '',
  1275. columnWidth: 170,
  1276. isVisible: true // 控制显示的属性
  1277. },
  1278. ],
  1279. columnItemList: [
  1280. {
  1281. userId: this.$store.state.user.name,
  1282. functionId: 601006,
  1283. serialNumber: '601006Table3ItemID',
  1284. tableId: "601006Table3",
  1285. tableName: "物料属性表",
  1286. columnProp: 'itemNo',
  1287. headerAlign: "center",
  1288. align: "center",
  1289. columnLabel: '属性编码',
  1290. columnHidden: false,
  1291. columnImage: false,
  1292. status: true,
  1293. fixed: '',
  1294. columnWidth: 100,
  1295. },
  1296. {
  1297. userId: this.$store.state.user.name,
  1298. functionId: 601006,
  1299. serialNumber: '601006Table3PropertiesItemDesc',
  1300. tableId: "601006Table3",
  1301. tableName: "物料属性表",
  1302. columnProp: 'itemDesc',
  1303. headerAlign: "center",
  1304. align: "center",
  1305. columnLabel: '属性名称',
  1306. columnHidden: false,
  1307. columnImage: false,
  1308. status: true,
  1309. fixed: '',
  1310. columnWidth: 120,
  1311. },
  1312. {
  1313. userId: this.$store.state.user.name,
  1314. functionId: 601006,
  1315. serialNumber: '601006Table3ValueType',
  1316. tableId: "601006Table3",
  1317. tableName: "物料属性表",
  1318. columnProp: 'valueType',
  1319. headerAlign: "center",
  1320. align: "center",
  1321. columnLabel: '属性类型',
  1322. columnHidden: false,
  1323. columnImage: false,
  1324. status: true,
  1325. fixed: '',
  1326. columnWidth: 100,
  1327. },
  1328. {
  1329. userId: this.$store.state.user.name,
  1330. functionId: 601006,
  1331. serialNumber: '601006Table3ValueChooseFlag',
  1332. tableId: "601006Table3",
  1333. tableName: "物料属性表",
  1334. columnProp: 'textValue',
  1335. headerAlign: "center",
  1336. align: "center",
  1337. columnLabel: '属性值',
  1338. columnHidden: false,
  1339. columnImage: false,
  1340. status: true,
  1341. fixed: '',
  1342. columnWidth: 100,
  1343. },
  1344. // {
  1345. // userId: this.$store.state.user.name,
  1346. // functionId: 601006,
  1347. // serialNumber: '601006Table3ValueChooseFlag',
  1348. // tableId: "601006Table3",
  1349. // tableName: "物料属性表",
  1350. // columnProp: 'numValue',
  1351. // headerAlign: "center",
  1352. // align: "center",
  1353. // columnLabel: '数字值',
  1354. // columnHidden: false,
  1355. // columnImage: false,
  1356. // status: true,
  1357. // fixed: '',
  1358. // columnWidth: 70,
  1359. // },
  1360. ],
  1361. rules: {
  1362. bu: [
  1363. {
  1364. required: true,
  1365. message: ' ',
  1366. trigger: ['blur', 'change']
  1367. }
  1368. ],
  1369. productGroupId: [
  1370. {
  1371. required: true,
  1372. message: ' ',
  1373. trigger: 'change'
  1374. }
  1375. ],
  1376. productGroupName: [
  1377. {
  1378. required: true,
  1379. message: ' ',
  1380. trigger: 'change'
  1381. }
  1382. ],
  1383. active:[
  1384. {
  1385. required: true,
  1386. message: ' ',
  1387. trigger: 'change'
  1388. }
  1389. ],
  1390. type:[
  1391. {
  1392. required: true,
  1393. message: ' ',
  1394. trigger: 'change'
  1395. }
  1396. ],
  1397. seqNo:[
  1398. {
  1399. required: true,
  1400. message: ' ',
  1401. trigger: 'change'
  1402. }
  1403. ],
  1404. conditionDesc:[
  1405. {
  1406. required: true,
  1407. message: ' ',
  1408. trigger: 'change'
  1409. }
  1410. ],
  1411. itemNo:[
  1412. {
  1413. required: true,
  1414. message: ' ',
  1415. trigger: 'change'
  1416. }
  1417. ]
  1418. },
  1419. // ======== 模态框开关控制 ========
  1420. authSearch: false,
  1421. authSave: false,
  1422. authUpdate: false,
  1423. authDelete: false,
  1424. modalFlag: false,
  1425. stdProcessFlag: false,
  1426. stdProcessFlag1: false,
  1427. productGroupPtmFlag: false,
  1428. ptmSaveFlag: false,
  1429. ptmConditionItemUpdateFlag: false,
  1430. ptmConditionProcessUpdateFlag: false,
  1431. modalDisableFlag: false,
  1432. menuId: this.$route.meta.menuId,
  1433. }
  1434. },
  1435. mounted () {
  1436. this.$nextTick(() => {
  1437. this.height = window.innerHeight - 180
  1438. })
  1439. },
  1440. created () {
  1441. // 按钮控制
  1442. this.getButtonAuthData()
  1443. // 获取用户的 site 和 bu
  1444. this.getSiteAndBuByUserName()
  1445. // 动态列
  1446. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  1447. if (!this.authSearch) {
  1448. // 获取数据列表
  1449. this.getDataList()
  1450. }
  1451. },
  1452. methods: {
  1453. handleColumnResize(newWidth, oldWidth, column, event){
  1454. let inData= this.columnList.filter(item => item.columnProp === column.property)[0]
  1455. inData.columnWidth=newWidth
  1456. updateColumnSize(inData).then(({data}) => {
  1457. if (data.code === 0) {
  1458. console.log("栏位宽度保存成功!")
  1459. }
  1460. })
  1461. },
  1462. // 获取用户的bu
  1463. getSiteAndBuByUserName () {
  1464. let tempData = {
  1465. username: this.$store.state.user.name,
  1466. }
  1467. getSiteAndBuByUserName(tempData).then(({data}) => {
  1468. if (data.code === 0) {
  1469. this.userBuList = data.rows
  1470. }
  1471. })
  1472. },
  1473. // 每页数
  1474. sizeChangeHandle (val) {
  1475. this.pageSize = val
  1476. this.pageIndex = 1
  1477. this.getDataList()
  1478. },
  1479. // 当前页
  1480. currentChangeHandle (val) {
  1481. this.pageIndex = val
  1482. this.getDataList()
  1483. },
  1484. //导出excel
  1485. async createExportData () {
  1486. this.searchData.limit = -1
  1487. this.searchData.page = 1
  1488. await productGroupInformationSearch(this.searchData).then(({data}) => {
  1489. this.exportList = data.page.list
  1490. })
  1491. return this.exportList
  1492. },
  1493. startDownload() {
  1494. },
  1495. finishDownload() {
  1496. },
  1497. fields () {
  1498. let json = "{"
  1499. this.columnList.forEach((item, index) => {
  1500. if (index == this.columnList.length - 1) {
  1501. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1502. } else {
  1503. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1504. }
  1505. })
  1506. json += "}"
  1507. let s = eval("(" + json + ")")
  1508. return s
  1509. },
  1510. // ======== chooseList相关方法 ========
  1511. /**
  1512. * 获取基础数据列表S
  1513. * @param val
  1514. * @param type
  1515. */
  1516. getBaseList (val, type) {
  1517. this.tagNo = val
  1518. // this.tempCodeNo = this.ptmModalData.itemNo
  1519. this.$nextTick(() => {
  1520. let strVal = ''
  1521. let conSql = ''
  1522. if (val === 219) {
  1523. strVal = this.ptmModalData.itemNo
  1524. }
  1525. if (this.ptmModalData.bu !== null && this.ptmModalData.bu !== '' && this.ptmModalData.bu !== undefined) {
  1526. conSql = " and site = '" + this.ptmModalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.ptmModalData.bu.split('_')[1] + "'"
  1527. this.$refs.baseList.init(val, strVal, conSql)
  1528. } else {
  1529. this.$refs.baseList.init(val, strVal)
  1530. }
  1531. })
  1532. },
  1533. /**
  1534. * 列表方法的回调
  1535. * @param val
  1536. */
  1537. getBaseData (val) {
  1538. console.log(val)
  1539. if (this.tagNo === 219) {
  1540. // if (this.modalData.flag === '2') {
  1541. // if (val.code_no != this.tempCodeNo) {
  1542. // this.$confirm(`更换属性模板将替换下方物料属性数据,请确认?`, '提示', {
  1543. // confirmButtonText: '确定',
  1544. // cancelButtonText: '取消',
  1545. // type: 'warning'
  1546. // }).then(() => {
  1547. // this.ptmModalData.itemNo = val.code_no
  1548. // }).catch(() => {
  1549. // })
  1550. // }
  1551. // } else {
  1552. this.ptmModalData.itemNo = val.code_no
  1553. this.ptmModalData.itemDesc = val.code_desc
  1554. // }
  1555. }
  1556. },
  1557. // 获取数据列表
  1558. getDataList () {
  1559. this.searchData.limit = this.pageSize
  1560. this.searchData.page = this.pageIndex
  1561. productGroupInformationSearch(this.searchData).then(({data}) => {
  1562. if (data.code === 0) {
  1563. this.dataList = data.page.list
  1564. this.pageIndex = data.page.currPage
  1565. this.pageSize = data.page.pageSize
  1566. this.totalPage = data.page.totalCount
  1567. this.dataList.forEach((item) => {
  1568. if (item.type !== '2'){
  1569. item.yieldRate = '0'
  1570. }
  1571. })
  1572. }
  1573. })
  1574. },
  1575. addModal () {
  1576. this.modalData = {
  1577. flag: '1',
  1578. title: '商品组新增',
  1579. bu: this.userBuList[0].buNo,
  1580. buNo: '',
  1581. site: '',
  1582. productGroupId: '',
  1583. productGroupName: '',
  1584. active: 'Y',
  1585. type: '',
  1586. yieldRate: '',
  1587. createBy: this.$store.state.user.name,
  1588. }
  1589. this.modalDisableFlag = false
  1590. this.modalFlag = true
  1591. },
  1592. /**
  1593. * 商品信息编辑模态框
  1594. * @param row
  1595. */
  1596. updateModal (row) {
  1597. this.modalData = {
  1598. flag: '2',
  1599. title: '商品组编辑',
  1600. site: row.site,
  1601. bu: row.site + '_' + row.buNo,
  1602. buNo: row.buNo,
  1603. productGroupId: row.productGroupId,
  1604. productGroupName: row.productGroupName,
  1605. active: row.active,
  1606. type: row.type,
  1607. yieldRate: row.yieldRate,
  1608. updateBy: this.$store.state.user.name,
  1609. }
  1610. this.modalDisableFlag = true
  1611. this.modalFlag = true
  1612. },
  1613. // ======== 新增/编辑/删除方法 ========
  1614. /**
  1615. * 商品信息新增/编辑
  1616. */
  1617. saveData () {
  1618. if (this.modalData.bu === '' || this.modalData.bu == null) {
  1619. this.$message.warning('请选择BU!')
  1620. return
  1621. }
  1622. if (this.modalData.productGroupId === '' || this.modalData.productGroupId == null) {
  1623. this.$message.warning('请填写商品组编码!')
  1624. return
  1625. }
  1626. if (this.modalData.productGroupName === '' || this.modalData.productGroupName == null) {
  1627. this.$message.warning('请填写商品组名称!')
  1628. return
  1629. }
  1630. if (this.modalData.active === '' || this.modalData.active == null) {
  1631. this.$message.warning('请选择是否可用!')
  1632. return
  1633. }
  1634. if (this.modalData.type === '' || this.modalData.type == null) {
  1635. this.$message.warning('请选择商品组!')
  1636. return
  1637. }
  1638. // yieldRate 0 – 100(包含100),而且需要支持小数,保留2位小数
  1639. if (this.modalData.type === '2') {
  1640. if (this.modalData.yieldRate === '' || this.modalData.yieldRate == null) {
  1641. this.$message.warning('请填写Yield Rate!')
  1642. return
  1643. }
  1644. if (this.modalData.yieldRate <= 0 || this.modalData.yieldRate >= 100) {
  1645. this.$message.warning('Yield Rate范围为0-100!')
  1646. return
  1647. }
  1648. if (!/^\d+(\.\d{1,2})?$/.test(this.modalData.yieldRate)) {
  1649. this.$message.warning('Yield Rate最多保留两位小数!')
  1650. return
  1651. }
  1652. }
  1653. if (this.modalData.flag === '1') {
  1654. productGroupInformationSave(this.modalData).then(({data}) => {
  1655. if (data && data.code === 0) {
  1656. this.getDataList()
  1657. this.modalFlag = false
  1658. this.$message({
  1659. message: '操作成功',
  1660. type: 'success',
  1661. duration: 1500,
  1662. onClose: () => {}
  1663. })
  1664. } else {
  1665. this.$alert(data.msg, '错误', {
  1666. confirmButtonText: '确定'
  1667. })
  1668. }
  1669. })
  1670. } else {
  1671. productGroupInformationEdit(this.modalData).then(({data}) => {
  1672. if (data && data.code === 0) {
  1673. this.getDataList()
  1674. this.modalFlag = false
  1675. this.$message({
  1676. message: '操作成功',
  1677. type: 'success',
  1678. duration: 1500,
  1679. onClose: () => {}
  1680. })
  1681. } else {
  1682. this.$alert(data.msg, '错误', {
  1683. confirmButtonText: '确定'
  1684. })
  1685. }
  1686. })
  1687. }
  1688. },
  1689. /**
  1690. * 商品信息删除
  1691. */
  1692. delModal (row) {
  1693. this.$confirm(`是否删除这条商品组信息?`, '提示', {
  1694. confirmButtonText: '确定',
  1695. cancelButtonText: '取消',
  1696. type: 'warning'
  1697. }).then(() => {
  1698. productGroupInformationDelete(row).then(({data}) => {
  1699. if (data && data.code === 0) {
  1700. this.getDataList()
  1701. this.partSelections = []
  1702. this.$message({
  1703. message: '操作成功',
  1704. type: 'success',
  1705. duration: 1500,
  1706. onClose: () => {}
  1707. })
  1708. } else {
  1709. this.$alert(data.msg, '错误', {
  1710. confirmButtonText: '确定'
  1711. })
  1712. }
  1713. })
  1714. }).catch(() => {
  1715. })
  1716. },
  1717. stdProcessModal (row) {
  1718. this.productGroupCurrentRow = JSON.parse(JSON.stringify(row));
  1719. this.searchProductGroupStdProcess()
  1720. this.isVisible1 = false
  1721. this.stdProcessFlag = true
  1722. },
  1723. addStdProcessModal () {
  1724. this.searchData2.limit = -1
  1725. this.searchData2.page = 1
  1726. this.searchData2.buNo = this.productGroupCurrentRow.buNo
  1727. this.searchData2.site = this.productGroupCurrentRow.site
  1728. searchStandardRoutingOperationList(this.searchData2).then(({data}) => {
  1729. if (data.code === 0) {
  1730. let operationIds = []
  1731. this.stdProcessList.forEach((item) => {
  1732. operationIds.push(item.operationId)
  1733. })
  1734. data.page.list.forEach((item) => {
  1735. if (!operationIds.includes(item.id)) {
  1736. this.stdProcessList1.push(item)
  1737. }
  1738. })
  1739. this.pageIndex = data.page.currPage
  1740. this.pageSize = data.page.pageSize
  1741. this.totalPage = data.page.totalCount
  1742. }
  1743. })
  1744. this.stdProcessFlag1 = true
  1745. },
  1746. closeStdProcessDialog () {
  1747. this.searchData1 = {
  1748. site: '',
  1749. userName: this.$store.state.user.name,
  1750. buDesc: '',
  1751. productGroupId: '',
  1752. productGroupName: '',
  1753. active: '',
  1754. type: '',
  1755. operationNo: '',
  1756. operationName: '',
  1757. page: 1,
  1758. limit: 10
  1759. }
  1760. this.stdProcessList = []
  1761. },
  1762. closeStdProcess1Dialog () {
  1763. this.stdProcessList1 = []
  1764. },
  1765. // 多选
  1766. selectionChangeHandle (val) {
  1767. this.stdProcessList1Selections = val
  1768. },
  1769. searchProductGroupStdProcess () {
  1770. this.productGroupCurrentRow.userName = this.$store.state.user.name
  1771. this.productGroupCurrentRow.operationNo = this.searchData1.operationNo
  1772. this.productGroupCurrentRow.operationName = this.searchData1.operationName
  1773. searchProductGroupStdProcess(this.productGroupCurrentRow).then(({data}) => {
  1774. if (data.code === 0) {
  1775. this.stdProcessList = data.rows
  1776. }
  1777. })
  1778. },
  1779. saveStdProcessData () {
  1780. if (this.stdProcessList1Selections.length === 0) {
  1781. this.$message.warning('请选择工序!')
  1782. return
  1783. }
  1784. let tempData = {
  1785. productGroupId: this.productGroupCurrentRow.productGroupId,
  1786. stdProcessAddList: this.stdProcessList1Selections,
  1787. createBy: this.$store.state.user.name
  1788. }
  1789. saveStdProcessData(tempData).then(({data}) => {
  1790. if (data.code === 0) {
  1791. this.$message({
  1792. message: '操作成功',
  1793. type: 'success',
  1794. duration: 1500,
  1795. onClose: () => {}
  1796. })
  1797. this.searchProductGroupStdProcess()
  1798. this.stdProcessFlag1 = false
  1799. } else {
  1800. this.$alert(data.msg, '错误', {
  1801. confirmButtonText: '确定'
  1802. })
  1803. }
  1804. })
  1805. },
  1806. delProductGroupStdProcessModal (row) {
  1807. this.$confirm(`是否删除这条标准工序信息?`, '提示', {
  1808. confirmButtonText: '确定',
  1809. cancelButtonText: '取消',
  1810. type: 'warning'
  1811. }).then(() => {
  1812. delProductGroupStdProcess(row).then(({data}) => {
  1813. if (data.code === 0) {
  1814. this.$message({
  1815. message: '操作成功',
  1816. type: 'success',
  1817. duration: 1500,
  1818. onClose: () => {}
  1819. })
  1820. this.searchProductGroupStdProcess()
  1821. } else {
  1822. this.$alert(data.msg, '错误', {
  1823. confirmButtonText: '确定'
  1824. })
  1825. }
  1826. })
  1827. }).catch(() => {
  1828. })
  1829. },
  1830. ProcessTimeMatrixModal (row) {
  1831. this.productGroupCurrentRow = JSON.parse(JSON.stringify(row));
  1832. this.searchProductGroupPtmCondition()
  1833. this.isVisible1 = true
  1834. this.productGroupPtmFlag = true
  1835. },
  1836. currentConditionChangeHandle (row) {
  1837. this.productGroupConditionCurrentRow = {
  1838. conditionId: row.conditionId,
  1839. site: row.site,
  1840. buNo: row.buNo,
  1841. bu: row.site + '_' + row.buNo,
  1842. }
  1843. this.searchProductGroupPtmConditionItemProcess()
  1844. },
  1845. searchProductGroupPtmCondition (seqNo) {
  1846. searchProductGroupPtmCondition(this.productGroupCurrentRow).then(({data}) => {
  1847. if (data.code === 0) {
  1848. this.productGroupPtmConditionList = data.rows1
  1849. this.activeName = 'first'
  1850. // this.productGroupPtmConditionItemList = data.rows2
  1851. // this.productGroupPtmConditionProcessList = data.rows3
  1852. }
  1853. let length = this.productGroupPtmConditionList.length;
  1854. if (length > 0) {
  1855. if (seqNo) {
  1856. this.$refs.conditionTable.setCurrentRow(this.productGroupPtmConditionList[length-1])
  1857. this.currentConditionChangeHandle(this.productGroupPtmConditionList[length-1])
  1858. } else {
  1859. this.$refs.conditionTable.setCurrentRow(this.productGroupPtmConditionList[0])
  1860. this.currentConditionChangeHandle(this.productGroupPtmConditionList[0])
  1861. }
  1862. } else {
  1863. this.productGroupPtmConditionItemList = []
  1864. this.productGroupPtmConditionProcessList = []
  1865. }
  1866. })
  1867. },
  1868. searchProductGroupPtmConditionItemProcess(){
  1869. let inData = {
  1870. conditionId: this.productGroupConditionCurrentRow.conditionId,
  1871. site: this.productGroupConditionCurrentRow.site,
  1872. buNo: this.productGroupConditionCurrentRow.buNo,
  1873. recordType : 'IP',
  1874. }
  1875. searchProductGroupPtmConditionItemProcess(inData).then(({data}) => {
  1876. if (data.code === 0) {
  1877. this.productGroupPtmConditionItemList = data.rows1
  1878. this.productGroupPtmConditionProcessList = data.rows2
  1879. }
  1880. })
  1881. },
  1882. saveProductGroupPtmModal () {
  1883. if (this.productGroupPtmConditionList.length > 0) {
  1884. let seqNos = []
  1885. this.productGroupPtmConditionList.forEach((item) => {
  1886. seqNos.push(item.seqNo)
  1887. })
  1888. this.ptmModalData.seqNo = Math.max.apply(null, seqNos) + 1
  1889. } else {
  1890. this.ptmModalData.seqNo = 1
  1891. }
  1892. this.ptmModalData.buNo = this.productGroupCurrentRow.buNo
  1893. this.ptmModalData.site = this.productGroupCurrentRow.site
  1894. this.ptmModalData.bu = this.ptmModalData.site + '_' + this.ptmModalData.buNo
  1895. this.ptmSaveFlag = true
  1896. },
  1897. async saveProductGroupPtm () {
  1898. console.log(this.ptmModalData)
  1899. // 确保 modelBlur 完成
  1900. await this.modelBlur(219);
  1901. if (this.ptmModalData.conditionDesc === '' || this.ptmModalData.conditionDesc == null) {
  1902. this.$message.warning('请填写条件描述!')
  1903. return
  1904. }
  1905. if (this.ptmModalData.itemNo === '' || this.ptmModalData.itemNo == null) {
  1906. this.$message.warning('请选择属性模板!')
  1907. return
  1908. }
  1909. if (this.ptmModalData.itemDesc === '' || this.ptmModalData.itemDesc == null) {
  1910. this.$alert('该属性模板不存在!', '错误', {
  1911. confirmButtonText: '确定'
  1912. })
  1913. return
  1914. }
  1915. let tempData = {
  1916. site: this.productGroupCurrentRow.site,
  1917. buNo: this.productGroupCurrentRow.buNo,
  1918. recordType : 'IP',
  1919. productGroupId: this.productGroupCurrentRow.productGroupId,
  1920. seqNo: this.ptmModalData.seqNo,
  1921. conditionDesc: this.ptmModalData.conditionDesc,
  1922. createBy: this.$store.state.user.name,
  1923. userName: this.$store.state.user.name
  1924. }
  1925. saveProductGroupPtm(tempData).then(({data}) => {
  1926. if (data.code === 0) {
  1927. this.$message({
  1928. message: '操作成功',
  1929. type: 'success',
  1930. duration: 1500,
  1931. onClose: () => {}
  1932. })
  1933. this.searchProductGroupPtmCondition(tempData.seqNo)
  1934. this.ptmSaveFlag = false
  1935. } else {
  1936. this.$alert(data.msg, '错误', {
  1937. confirmButtonText: '确定'
  1938. })
  1939. }
  1940. })
  1941. },
  1942. delProductGroupPtmModal (row) {
  1943. this.$confirm(`是否删除这条信息?`, '提示', {
  1944. confirmButtonText: '确定',
  1945. cancelButtonText: '取消',
  1946. type: 'warning'
  1947. }).then(() => {
  1948. delProductGroupPtm(row).then(({data}) => {
  1949. if (data.code === 0) {
  1950. this.$message({
  1951. message: '操作成功',
  1952. type: 'success',
  1953. duration: 1500,
  1954. onClose: () => {}
  1955. })
  1956. this.searchProductGroupPtmCondition()
  1957. } else {
  1958. this.$alert(data.msg, '错误', {
  1959. confirmButtonText: '确定'
  1960. })
  1961. }
  1962. })
  1963. }).catch(() => {
  1964. })
  1965. },
  1966. closeProductGroupPtmDialog (){
  1967. this.productGroupPtmConditionList = []
  1968. this.productGroupPtmConditionItemList = []
  1969. this.productGroupPtmConditionProcessList = []
  1970. this.productGroupPtmFlag = false
  1971. this.activeName = 'first'
  1972. },
  1973. closeProductGroupPtmSaveDialog () {
  1974. this.ptmModalData = {
  1975. conditionDesc: '',
  1976. itemNo: '',
  1977. itemDesc: '',
  1978. createBy: this.$store.state.user.name,
  1979. }
  1980. },
  1981. updatePtmConditionItemModal () {
  1982. this.copyItemAttributeList = JSON.parse(JSON.stringify(this.productGroupPtmConditionItemList))
  1983. this.ptmConditionItemUpdateFlag = true
  1984. },
  1985. /**
  1986. * 编辑属性值
  1987. */
  1988. updatePtmConditionItemValue () {
  1989. let tempData = {
  1990. ptmItemAddList: JSON.parse(JSON.stringify(this.copyItemAttributeList))
  1991. }
  1992. updatePtmConditionItemValue(tempData).then(({data}) => {
  1993. if (data && data.code === 0) {
  1994. this.searchProductGroupPtmConditionItemProcess()
  1995. this.closePtmConditionItemUpdateDialog()
  1996. this.$message({
  1997. message: '操作成功',
  1998. type: 'success',
  1999. duration: 1500,
  2000. onClose: () => {}
  2001. })
  2002. } else {
  2003. this.$alert(data.msg, '错误', {
  2004. confirmButtonText: '确定'
  2005. })
  2006. }
  2007. this.loading = false
  2008. }).catch((error) => {
  2009. this.$message.error(error)
  2010. this.loading = false
  2011. })
  2012. },
  2013. closePtmConditionItemUpdateDialog () {
  2014. this.copyItemAttributeList = []
  2015. this.ptmConditionItemUpdateFlag = false
  2016. },
  2017. updatePtmConditionProcessModal () {
  2018. this.copyProcessAttributeList = JSON.parse(JSON.stringify(this.productGroupPtmConditionProcessList))
  2019. this.ptmConditionProcessUpdateFlag = true
  2020. },
  2021. updatePtmConditionProcessValue () {
  2022. let tempData = {
  2023. updateBy: this.$store.state.user.name,
  2024. ptmProcessAddList: JSON.parse(JSON.stringify(this.copyProcessAttributeList))
  2025. }
  2026. updatePtmConditionProcessValue(tempData).then(({data}) => {
  2027. if (data && data.code === 0) {
  2028. this.searchProductGroupPtmConditionItemProcess()
  2029. this.closePtmConditionProcessUpdateDialog()
  2030. this.$message({
  2031. message: '操作成功',
  2032. type: 'success',
  2033. duration: 1500,
  2034. onClose: () => {}
  2035. })
  2036. } else {
  2037. this.$alert(data.msg, '错误', {
  2038. confirmButtonText: '确定'
  2039. })
  2040. }
  2041. this.loading = false
  2042. }).catch((error) => {
  2043. this.$message.error(error)
  2044. this.loading = false
  2045. })
  2046. },
  2047. closePtmConditionProcessUpdateDialog () {
  2048. this.copyProcessAttributeList = []
  2049. this.ptmConditionProcessUpdateFlag = false
  2050. },
  2051. // 机器单位产出改变
  2052. changeMachRunFactor (row) {
  2053. row.laborRunFactor = row.machRunFactor
  2054. },
  2055. // 机器处理时间改变
  2056. changeMachCycleTime (row) {
  2057. // 人工处理时间赋值
  2058. row.laborCycleTime = row.machCycleTime
  2059. // 计算机器单位产出
  2060. if (row.machCycleTime === 0 || row.machCycleTime === '0') {
  2061. row.machRunFactor = 0
  2062. } else if(row.machCycleTime === '' || row.machCycleTime === null) {
  2063. row.machRunFactor = ''
  2064. } else {
  2065. row.machRunFactor = (1/row.machCycleTime).toFixed(2)
  2066. }
  2067. // 人工单位产出赋值
  2068. row.laborRunFactor = row.machRunFactor
  2069. },
  2070. // 人工处理时间改变
  2071. changeLaborCycleTime (row) {
  2072. // 计算人工单位产出
  2073. if (row.laborCycleTime === 0 || row.laborCycleTime === '0') {
  2074. row.laborRunFactor = 0
  2075. } else if(row.laborCycleTime === '' || row.laborCycleTime === null) {
  2076. row.laborRunFactor = ''
  2077. } else {
  2078. row.laborRunFactor = (1/row.laborCycleTime).toFixed(2)
  2079. }
  2080. },
  2081. // 属性输入校验
  2082. async modelBlur(tagNo) {
  2083. if (this.ptmModalData.itemNo != null && this.ptmModalData.itemNo !== '') {
  2084. let tempData = {
  2085. tagno: tagNo,
  2086. conditionSql: " and code_no = '" + this.ptmModalData.itemNo + "'" +
  2087. " and site = '" + this.ptmModalData.bu.split('_')[0] + "'" +
  2088. " and bu_no = '" + this.ptmModalData.bu.split('_')[1] + "'"
  2089. };
  2090. // 返回 Promise
  2091. return verifyData(tempData).then(({ data }) => {
  2092. if (data && data.code === 0) {
  2093. if (data.baseListData.length > 0) {
  2094. this.ptmModalData.itemDesc = data.baseListData[0].code_desc;
  2095. } else {
  2096. this.ptmModalData.itemDesc = '';
  2097. }
  2098. } else {
  2099. this.$message.warning(data.msg);
  2100. this.ptmModalData.itemDesc = '';
  2101. }
  2102. }).catch(error => {
  2103. console.error(error);
  2104. this.$message.error('校验失败,请重试');
  2105. this.ptmModalData.itemDesc = '';
  2106. });
  2107. } else {
  2108. this.ptmModalData.itemDesc = '';
  2109. return Promise.resolve(); // 如果 itemNo 为空,直接返回 resolved Promise
  2110. }
  2111. },
  2112. // 列表表格选择替换
  2113. tabClick (tab, event) {
  2114. // 刷新列表数据
  2115. this.searchProductGroupPtmConditionItemProcess()
  2116. },
  2117. // 动态列开始 获取 用户保存的 格式列
  2118. async getTableUserColumn(tableId, columnId) {
  2119. let queryTableUser = {
  2120. userId: this.$store.state.user.name,
  2121. functionId: this.$route.meta.menuId,
  2122. tableId: tableId,
  2123. status: true,
  2124. languageCode: this.$i18n.locale
  2125. }
  2126. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  2127. if (data.rows.length > 0) {
  2128. switch (columnId) {
  2129. case 1:
  2130. this.columnList = data.rows
  2131. break;
  2132. }
  2133. } else {
  2134. this.getColumnList(tableId, columnId)
  2135. }
  2136. })
  2137. },
  2138. // 获取 tableDefault 列
  2139. async getColumnList (tableId, columnId) {
  2140. let queryTable= {
  2141. functionId: this.$route.meta.menuId,
  2142. tableId: tableId,
  2143. languageCode: this.$i18n.locale
  2144. }
  2145. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  2146. if (!data.rows.length === 0) {
  2147. switch (columnId) {
  2148. case 1:
  2149. this.columnList = data.rows
  2150. break;
  2151. }
  2152. }
  2153. })
  2154. },
  2155. //获取按钮的权限数据
  2156. getButtonAuthData () {
  2157. let searchFlag = this.isAuth(this.menuId+":search")
  2158. let saveFlag = this.isAuth(this.menuId+":save")
  2159. let updateFlag = this.isAuth(this.menuId+":update")
  2160. let deleteFlag = this.isAuth(this.menuId+":delete")
  2161. //处理页面的权限数据
  2162. this.authSearch = !searchFlag
  2163. this.authSave = !saveFlag
  2164. this.authUpdate = !updateFlag
  2165. this.authDelete = !deleteFlag
  2166. },
  2167. }
  2168. }
  2169. </script>
  2170. <style scoped lang="scss">
  2171. /deep/ .customer-tab .el-tabs__content {
  2172. padding: 0px !important;
  2173. height: 100%;
  2174. }
  2175. /deep/ .table-container {
  2176. border: 1px solid #e0e0e0;
  2177. border-radius: 4px;
  2178. padding: 10px;
  2179. margin-bottom: 10px;
  2180. }
  2181. .el-table /deep/ .cell{
  2182. height: auto;
  2183. line-height: 1.5;
  2184. }
  2185. .numInput /deep/ .el-input__inner{
  2186. text-align: right;
  2187. }
  2188. /deep/ .inlineNumber input::-webkit-outer-spin-button,
  2189. /deep/ .inlineNumber input::-webkit-inner-spin-button {
  2190. -webkit-appearance: none;
  2191. }
  2192. /deep/ .inlineNumber input[type="number"]{
  2193. -moz-appearance: textfield;
  2194. padding-right: 5px !important;
  2195. }
  2196. </style>