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.

2258 lines
76 KiB

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