plm前端
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.

4974 lines
224 KiB

  1. <template>
  2. <div class="mod-config">
  3. <!-- 查询条件 -->
  4. <el-form :inline="true" label-position="top" :model="searchData">
  5. <el-form-item label="序列号">
  6. <el-input v-model="searchData.referenceNo" clearable style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item label="单据状态">
  9. <el-select v-model="searchData.status" clearable style="width: 120px">
  10. <el-option label="草稿" value="草稿"></el-option>
  11. <el-option label="审批中" value="审批中"></el-option>
  12. <el-option label="已完成" value="已完成"></el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="RoHS状态">
  16. <el-select v-model="searchData.rohsStatus" clearable style="width: 120px">
  17. <el-option label="Active" value="Active"></el-option>
  18. <el-option label="Dead" value="Dead"></el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item label="节点审批人">
  22. <el-input v-model="searchData.currentApprover" clearable style="width: 120px"></el-input>
  23. </el-form-item>
  24. <el-form-item label="当前节点">
  25. <el-select v-model="searchData.nodeId" placeholder="请选择节点" clearable style="width: 120px">
  26. <el-option
  27. v-for="option in nodeOptions"
  28. :key="option.id"
  29. :label="option.name"
  30. :value="option.id">
  31. </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="authUpdate" @click="addOrUpdateHandle()">新增</el-button>
  37. <el-button v-if="authDelete" type="danger" @click="deleteHandle()">删除</el-button>
  38. <download-excel
  39. v-if="authSearch"
  40. :fields="exportFieldMap"
  41. :data="exportData"
  42. type="xls"
  43. :name="exportName"
  44. :header="exportHeader"
  45. :footer="exportFooter"
  46. :fetch="createExportData"
  47. :before-generate="startDownload"
  48. :before-finish="finishDownload"
  49. worksheet="导出信息"
  50. :class="['el-button', 'el-button--primary', 'el-button--medium', {'is-loading': exportLoading}]">
  51. <i v-if="exportLoading" class="el-icon-loading"></i>
  52. <span>{{ "导出" }}</span>
  53. </download-excel>
  54. <el-button v-if="authSearch" @click="searchHandle()">搜索</el-button>
  55. </el-form-item>
  56. </el-form>
  57. <!-- 列表 -->
  58. <el-table
  59. ref="rohsTable"
  60. :height="height"
  61. :data="dataList"
  62. border
  63. :row-style="rowStyle"
  64. @row-click="changeClickRow"
  65. @current-change="currentChange"
  66. @selection-change="dataListSelectionChange"
  67. v-loading="dataListLoading"
  68. style="width: 100%;">
  69. <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
  70. <el-table-column prop="referenceNo" header-align="center" align="center" label="序列号" width="165"></el-table-column>
  71. <el-table-column prop="status" header-align="center" align="center" label="单据状态" width="120"></el-table-column>
  72. <el-table-column prop="nodeId" header-align="center" align="center" label="当前节点ID" width="130"></el-table-column>
  73. <el-table-column prop="nodeName" header-align="center" align="center" label="当前节点" width="150"></el-table-column>
  74. <el-table-column prop="currentApprover" header-align="center" align="center" label="当前节点审批人" width="170"></el-table-column>
  75. <el-table-column prop="applicant" header-align="center" align="center" label="申请人编码" width="130"></el-table-column>
  76. <el-table-column prop="applicantName" header-align="center" align="center" label="申请人名称" width="150"></el-table-column>
  77. <el-table-column prop="pm" header-align="center" align="center" label="PM编码" width="130"></el-table-column>
  78. <el-table-column prop="pmName" header-align="center" align="center" label="PM名称" width="150"></el-table-column>
  79. <el-table-column prop="applicationDate" header-align="center" align="center" label="申请日期" width="165"></el-table-column>
  80. <el-table-column prop="plannedMassProductionDate" header-align="center" align="center" label="计划转量产时间" width="165">
  81. <template slot-scope="scope">
  82. <span>{{ normalizeDateOnly(scope.row.plannedMassProductionDate) }}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column prop="process" header-align="center" align="center" label="工艺" width="120"></el-table-column>
  86. <el-table-column prop="color" header-align="center" align="center" label="颜色" width="120"></el-table-column>
  87. <el-table-column prop="vendorCode" header-align="center" align="center" label="供应商" width="160"></el-table-column>
  88. <el-table-column prop="vendorMaterialCode" header-align="center" align="center" label="供应商材料编码" width="200" :show-overflow-tooltip="true"></el-table-column>
  89. <el-table-column prop="materialClassify" header-align="center" align="center" label="材料分类" width="200" :show-overflow-tooltip="true"></el-table-column>
  90. <el-table-column prop="otherMaterialClassify" header-align="center" align="center" label="其他材料分类" width="210" :show-overflow-tooltip="true"></el-table-column>
  91. <el-table-column prop="materialUseFor" header-align="center" align="center" label="辅材用途" width="180" :show-overflow-tooltip="true"></el-table-column>
  92. <el-table-column prop="endCustomer" header-align="center" align="center" label="最终客户编码" width="160"></el-table-column>
  93. <el-table-column prop="endCustomerName" header-align="center" align="center" label="最终客户名称" width="180"></el-table-column>
  94. <el-table-column prop="projectId" header-align="center" align="center" label="项目编码" width="140"></el-table-column>
  95. <el-table-column prop="projectName" header-align="center" align="center" label="项目名称" width="180"></el-table-column>
  96. <el-table-column prop="commGroup1" header-align="center" align="center" label="商品组1编码" width="170"></el-table-column>
  97. <el-table-column prop="commGroup1Desc" header-align="center" align="center" label="商品组1名称" width="170"></el-table-column>
  98. <el-table-column prop="commGroup2" header-align="center" align="center" label="商品组2编码" width="170"></el-table-column>
  99. <el-table-column prop="commGroup2Desc" header-align="center" align="center" label="商品组2名称" width="170"></el-table-column>
  100. <el-table-column prop="commGroup3" header-align="center" align="center" label="商品组3编码" width="170"></el-table-column>
  101. <el-table-column prop="commGroup3Desc" header-align="center" align="center" label="商品组3名称" width="170"></el-table-column>
  102. <el-table-column prop="needCreateNumber" header-align="center" align="center" label="需创建内部编号" width="200"></el-table-column>
  103. <el-table-column prop="npdEngineer" header-align="center" align="center" label="NPD工程师编码" width="170"></el-table-column>
  104. <el-table-column prop="npdEngineerName" header-align="center" align="center" label="NPD工程师名称" width="170"></el-table-column>
  105. <el-table-column prop="materialValidityTime" header-align="center" align="center" label="材料有效期" width="200"></el-table-column>
  106. <el-table-column prop="needDeviation" header-align="center" align="center" label="是否需偏差许可" width="190"></el-table-column>
  107. <el-table-column prop="technicalPlan" header-align="center" align="center" label="技术计划编码" width="170"></el-table-column>
  108. <el-table-column prop="technicalPlanName" header-align="center" align="center" label="技术计划名称" width="170"></el-table-column>
  109. <el-table-column prop="buyer" header-align="center" align="center" label="采购编码" width="130"></el-table-column>
  110. <el-table-column prop="buyerName" header-align="center" align="center" label="采购名称" width="130"></el-table-column>
  111. <el-table-column prop="expectReportTime" header-align="center" align="center" label="预计提供报告时间(一个月内)" width="200">
  112. <template slot-scope="scope">
  113. <span>{{ normalizeDateOnly(scope.row.expectReportTime) }}</span>
  114. </template>
  115. </el-table-column>
  116. <el-table-column prop="rohsStatus" header-align="center" align="center" label="RoHS状态" width="130"></el-table-column>
  117. <el-table-column prop="expiredDate" header-align="center" align="center" label="报告日期" width="165"></el-table-column>
  118. <el-table-column prop="validUntilDisplay" header-align="center" align="center" label="有效期" width="170" :show-overflow-tooltip="true">
  119. <template slot-scope="scope">
  120. <span>{{ getValidUntilDisplay(scope.row.validUntilValue, scope.row.validUntil) }}</span>
  121. </template>
  122. </el-table-column>
  123. <el-table-column prop="isMeetRohsRequirement" header-align="center" align="center" label="符合RoHS" width="170"></el-table-column>
  124. <el-table-column prop="isAhGrade" header-align="center" align="center" label="AH属性" width="140"></el-table-column>
  125. <el-table-column prop="hsfSupplierClassification" header-align="center" align="center" label="HSF供应商等级" width="220"></el-table-column>
  126. <el-table-column prop="hsfApproverName" header-align="center" align="center" label="HSF审批人" width="240" :show-overflow-tooltip="true">
  127. <template slot-scope="scope">
  128. <span>{{ scope.row.hsfApproverName || scope.row.hsfApprover || '' }}</span>
  129. </template>
  130. </el-table-column>
  131. <el-table-column prop="relatedPeopleName" header-align="center" align="center" label="Inform Related people" width="200" :show-overflow-tooltip="true">
  132. <template slot-scope="scope">
  133. <span>{{ scope.row.relatedPeopleName || scope.row.relatedPeople || '' }}</span>
  134. </template>
  135. </el-table-column>
  136. <el-table-column prop="isSameMaterialDiffSize" header-align="center" align="center" label="同材不同规格" width="220"></el-table-column>
  137. <el-table-column prop="ifsPartNo" header-align="center" align="center" label="IFS编号" width="150"></el-table-column>
  138. <el-table-column prop="remark" header-align="center" align="center" label="备注" width="220" :show-overflow-tooltip="true"></el-table-column>
  139. <el-table-column fixed="right" header-align="center" align="center" width="130" label="操作">
  140. <template slot-scope="scope">
  141. <el-link v-if="authUpdate && scope.row.status !== '已完成'" style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">编辑</el-link>
  142. <el-link v-if="authUpdate && scope.row.status === '已完成'" style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">详情</el-link>
  143. <el-link v-if="authIssue && scope.row.status === '草稿'" style="cursor: pointer; margin-left: 10px;" @click="issueModal(scope.row)">下达</el-link>
  144. </template>
  145. </el-table-column>
  146. </el-table>
  147. <!-- 分页 -->
  148. <el-pagination style="margin-top: 0px"
  149. @size-change="sizeChangeHandle"
  150. @current-change="currentChangeHandle"
  151. :current-page="pageIndex"
  152. :page-sizes="[20, 50, 100, 200, 500]"
  153. :page-size="pageSize"
  154. :total="totalPage"
  155. layout="total, sizes, prev, pager, next, jumper">
  156. </el-pagination>
  157. <!-- 编辑模态框 -->
  158. <el-dialog
  159. :title="modalTitle"
  160. :visible.sync="modalFlag"
  161. width="1012px"
  162. top="3.8vh"
  163. v-drag
  164. :close-on-click-modal="false"
  165. :showClose="false">
  166. <el-tabs tab-position="left" type="border-card" v-model="activeName" style="width: 100%;height: 777px;">
  167. <!-- 基本信息 -->
  168. <el-tab-pane label="基本信息" name="basicInfo">
  169. <div style="height: 755px">
  170. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  171. <el-form-item>
  172. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('applicant')" slot="label" @click="getBaseList(103, 1)"><a herf="#">申请人/Reference No.</a></span>
  173. <span v-else slot="label">申请人/Reference No.</span>
  174. <el-input v-model="modalData.applicant" @blur="applicantBlur(103)" :disabled="isRohsFieldDisabled('applicant')" style="width: 100px"></el-input>
  175. <el-input v-model="modalData.applicantName" disabled style="width: 155px"></el-input>
  176. </el-form-item>
  177. <el-form-item label="申请日期/Date">
  178. <el-date-picker v-model="modalData.applicationDate" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('applicationDate')" style="width: 150px" :editable=false></el-date-picker>
  179. </el-form-item>
  180. <el-form-item label="Site">
  181. <el-input v-model="modalData.site" disabled style="width: 95px"></el-input>
  182. </el-form-item>
  183. <el-form-item label="工艺/Process">
  184. <dict-data-select v-model="modalData.process" clearable @change="handleProcessChange" :disabled="isProcessFieldDisabled()" style="width: 121px" dict-type="rohs_process"></dict-data-select>
  185. </el-form-item>
  186. </el-form>
  187. <el-form :inline="true" label-position="top" :model="modalData">
  188. <el-form-item>
  189. <span slot="label" v-if="!modalData.endCustomerFlag && !isRohsFieldDisabled('endCustomer')" @click="getBaseList(102, 1)"><a herf="#">最终客户/End Customer</a></span>
  190. <span slot="label" v-else>最终客户/End Customer</span>
  191. <el-input :disabled="modalData.endCustomerFlag || isRohsFieldDisabled('endCustomer')" readonly v-model="modalData.endCustomer" @blur="handleQueryCustomer" style="width: 100px"></el-input>
  192. <el-input disabled v-model="modalData.endCustomerName" style="width: 155px"></el-input>
  193. </el-form-item>
  194. <el-form-item>
  195. <span slot="label" v-if="!modalData.projectIdFlag && !isRohsFieldDisabled('projectId')" @click="chooseProjectListFlag = true"><a herf="#">项目编码/Project</a></span>
  196. <span slot="label" v-else>项目编码/Project</span>
  197. <el-input :disabled="modalData.projectIdFlag || isRohsFieldDisabled('projectId')" readonly v-model="modalData.projectId" @blur="handleQueryProjectByCustomer" style="width: 100px"></el-input>
  198. <el-input disabled v-model="modalData.projectName" style="width: 155px"></el-input>
  199. </el-form-item>
  200. <el-form-item label="WM所需求规格/The size that WM need">
  201. <el-input v-model="modalData.wmRequiredSpec" :disabled="isRohsFieldDisabled('wmRequiredSpec')" style="width: 260px"></el-input>
  202. </el-form-item>
  203. </el-form>
  204. <el-form :inline="true" label-position="top" :model="modalData">
  205. <el-form-item label="供应商/Vendor Code">
  206. <el-input v-model="modalData.vendorCode" :disabled="isRohsFieldDisabled('vendorCode')" style="width: 396px"></el-input>
  207. </el-form-item>
  208. <el-form-item label="供应商材料编码/Vendor Material Code">
  209. <el-input v-model="modalData.vendorMaterialCode" :disabled="isRohsFieldDisabled('vendorMaterialCode')" style="width: 396px"></el-input>
  210. </el-form-item>
  211. </el-form>
  212. <el-form :inline="true" label-position="top" :model="modalData">
  213. <el-form-item label="材料分类/Material Classify">
  214. <dict-data-select class="rohs-multiple-two-rows" v-model="modalData.materialClassifyList" multiple :title="getMultipleSelectTitle(modalData.materialClassifyList)" :disabled="isRohsFieldDisabled('materialClassify')" style="width: 532px" dict-type="rohs_material_classify"></dict-data-select>
  215. </el-form-item>
  216. <el-form-item label="其他分类/Other Material Classify" v-if="modalData.materialClassifyList && modalData.materialClassifyList.includes('Other其他')">
  217. <el-input v-model="modalData.otherMaterialClassify" :disabled="isRohsFieldDisabled('otherMaterialClassify')" style="width: 260px"></el-input>
  218. </el-form-item>
  219. </el-form>
  220. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 40px">
  221. <el-form-item label="辅材用途/Assiaccessorial Material Use for">
  222. <el-input v-model="modalData.materialUseFor" :disabled="isRohsFieldDisabled('materialUseFor')" style="width: 259px"></el-input>
  223. </el-form-item>
  224. <el-form-item>
  225. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('technicalPlan')" slot="label" @click="getBaseList(2001, 4)"><a herf="#">技术计划/TP</a></span>
  226. <span v-else slot="label">技术计划/TP</span>
  227. <el-input v-model="modalData.technicalPlan" @blur="technicalPlanBlur(2001)" :disabled="isRohsFieldDisabled('technicalPlan')" style="width: 100px"></el-input>
  228. <el-input v-model="modalData.technicalPlanName" disabled style="width: 155px"></el-input>
  229. </el-form-item>
  230. <el-form-item>
  231. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('pm')" slot="label" @click="getBaseList(2054, 5)"><a herf="#">PM人员/PM</a></span>
  232. <span v-else slot="label">PM人员/PM</span>
  233. <el-input v-model="modalData.pm" @blur="pmBlur(2054)" :disabled="isRohsFieldDisabled('pm')" style="width: 100px"></el-input>
  234. <el-input v-model="modalData.pmName" disabled style="width: 156px"></el-input>
  235. </el-form-item>
  236. </el-form>
  237. <el-form :inline="true" label-position="top" :model="modalData">
  238. <el-form-item label="颜色/Color">
  239. <el-input v-model="modalData.color" :disabled="isRohsFieldDisabled('color')" style="width: 532px"></el-input>
  240. </el-form-item>
  241. <el-form-item label="计划转量产时间/Planned Mass Production Date">
  242. <el-date-picker v-model="modalData.plannedMassProductionDate" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('plannedMassProductionDate')" style="width: 260px" :editable=false></el-date-picker>
  243. </el-form-item>
  244. </el-form>
  245. <el-form :inline="true" label-position="top" :model="modalData">
  246. <el-form-item>
  247. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('commGroup1')" slot="label" @click="getBaseList(110)"><a herf="#">商品组1/Comm Group 1</a></span>
  248. <span v-else slot="label">商品组1/Comm Group 1</span>
  249. <el-input v-model="modalData.commGroup1" @change="commGroup1Blur(110)" :disabled="isRohsFieldDisabled('commGroup1')" style="width: 100px"></el-input>
  250. <el-input v-model="modalData.commGroup1Desc" disabled style="width: 155px"></el-input>
  251. </el-form-item>
  252. <el-form-item>
  253. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('commGroup2')" slot="label" @click="getBaseList(111)"><a herf="#">商品组2/Comm Group 2</a></span>
  254. <span v-else slot="label">商品组2/Comm Group 2</span>
  255. <el-input v-model="modalData.commGroup2" @change="commGroup2Blur(111)" :disabled="isRohsFieldDisabled('commGroup2')" style="width: 100px"></el-input>
  256. <el-input v-model="modalData.commGroup2Desc" disabled style="width: 155px"></el-input>
  257. </el-form-item>
  258. <el-form-item>
  259. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('commGroup3')" slot="label" @click="getBaseList(130)"><a herf="#">商品组3/Comm Group 3</a></span>
  260. <span v-else slot="label">商品组3/Comm Group 3</span>
  261. <el-input v-model="modalData.commGroup3" @change="commGroup3Blur(130)" :disabled="isRohsFieldDisabled('commGroup3')" style="width: 100px"></el-input>
  262. <el-input v-model="modalData.commGroup3Desc" disabled style="width: 156px"></el-input>
  263. </el-form-item>
  264. </el-form>
  265. <el-form :inline="true" label-position="top" :model="modalData">
  266. <el-form-item label="是否是Fiber材料">
  267. <el-radio-group v-model="modalData.isFiberMaterial" :disabled="isRohsFieldDisabled('isFiberMaterial')" style="width: 145px">
  268. <el-radio label="Y" @click.native.prevent="radioClick('isFiberMaterial', 'Y')"></el-radio>
  269. <el-radio label="N" @click.native.prevent="radioClick('isFiberMaterial', 'N')"></el-radio>
  270. </el-radio-group>
  271. </el-form-item>
  272. <el-form-item label="是否需要创建300/700/900号/Dose Need Create 300/700/900 Number">
  273. <el-radio-group v-model="modalData.needCreateNumber" :disabled="isRohsFieldDisabled('needCreateNumber')" style="width: 374px">
  274. <el-radio label="Y" @click.native.prevent="radioClick('needCreateNumber', 'Y')"></el-radio>
  275. <el-radio label="N" @click.native.prevent="radioClick('needCreateNumber', 'N')"></el-radio>
  276. </el-radio-group>
  277. </el-form-item>
  278. <el-form-item label="材料厚度/Material Thickness">
  279. <el-input v-model="modalData.materialThickness" :disabled="isRohsFieldDisabled('materialThickness')" style="width: 260px"></el-input>
  280. </el-form-item>
  281. </el-form>
  282. <el-form :inline="true" label-position="top" :model="modalData">
  283. <el-form-item label="材料有效期/Material Validity Time">
  284. <dict-data-select v-model="modalData.materialValidityTime" clearable :disabled="isRohsFieldDisabled('materialValidityTime')" style="width: 260px" dict-type="rohs_material_validity_time"></dict-data-select>
  285. </el-form-item>
  286. <el-form-item label="是否需要Deviation/If need deviation or not">
  287. <el-radio-group v-model="modalData.needDeviation" :disabled="isRohsFieldDisabled('needDeviation')" style="width: 259px">
  288. <el-radio label="Y" @click.native.prevent="radioClick('needDeviation', 'Y')"></el-radio>
  289. <el-radio label="N" @click.native.prevent="radioClick('needDeviation', 'N')"></el-radio>
  290. </el-radio-group>
  291. </el-form-item>
  292. <el-form-item>
  293. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('npdEngineer')" slot="label" @click="getBaseList(2001, 3)"><a herf="#">NPD工程师/NPD Engineer</a></span>
  294. <span v-else slot="label">NPD工程师/NPD Engineer</span>
  295. <el-input v-model="modalData.npdEngineer" @blur="npdEngineerBlur(2001)" :disabled="isRohsFieldDisabled('npdEngineer')" style="width: 100px"></el-input>
  296. <el-input v-model="modalData.npdEngineerName" disabled style="width: 155px"></el-input>
  297. </el-form-item>
  298. </el-form>
  299. <el-form :inline="true" label-position="top" :model="modalData">
  300. <el-form-item label="材料有效期备注/Material Validity Time Comments">
  301. <el-input v-model="modalData.materialValidityComments" :disabled="isRohsFieldDisabled('materialValidityComments')" style="width: 260px"></el-input>
  302. </el-form-item>
  303. <el-form-item label="预计提供报告时间(一个月内)/Expect Date" style="margin-left: -2px">
  304. <el-date-picker v-model="modalData.expectReportTime" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('expectReportTime')" style="width: 259px" :editable=false></el-date-picker>
  305. </el-form-item>
  306. <el-form-item>
  307. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('buyer')" slot="label" @click="getBaseList(2000, 2)"><a herf="#">采购/Buyer</a></span>
  308. <span v-else slot="label">采购/Buyer</span>
  309. <el-input v-model="modalData.buyer" @blur="buyerBlur(2000)" :disabled="isRohsFieldDisabled('buyer')" style="width: 100px"></el-input>
  310. <el-input v-model="modalData.buyerName" disabled style="width: 156px"></el-input>
  311. </el-form-item>
  312. </el-form>
  313. <el-form :inline="true" label-position="top" :model="modalData">
  314. <el-form-item label="所需审批文件/Qualification Documents needed" >
  315. <dict-data-select
  316. :key="'qualification-default-' + (modalData.referenceNo || '') + '-' + (isEditMode ? 'edit' : 'add')"
  317. class="rohs-multiple-two-rows"
  318. v-model="modalData.qualificationDocumentsNeededList"
  319. multiple
  320. :use-default-value="!isEditMode"
  321. :use-type-multi-default-value="!isEditMode"
  322. :title="getMultipleSelectTitle(modalData.qualificationDocumentsNeededList)"
  323. :disabled="isRohsFieldDisabled('qualificationDocumentsNeeded')"
  324. style="width: 807px"
  325. dict-type="rohs_qualification_docs">
  326. </dict-data-select>
  327. </el-form-item>
  328. </el-form>
  329. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 40px">
  330. <el-form-item label="测试报告必测项/Test Report including items">
  331. <dict-data-select
  332. :key="'test-report-default-' + (modalData.referenceNo || '') + '-' + (isEditMode ? 'edit' : 'add')"
  333. class="rohs-multiple-two-rows"
  334. v-model="modalData.testReportIncludingItemsList"
  335. multiple
  336. :use-default-value="!isEditMode"
  337. :use-type-multi-default-value="!isEditMode"
  338. :title="getMultipleSelectTitle(modalData.testReportIncludingItemsList)"
  339. :disabled="isRohsFieldDisabled('testReportIncludingItems')"
  340. style="width: 807px"
  341. dict-type="rohs_test_report_items">
  342. </dict-data-select>
  343. </el-form-item>
  344. </el-form>
  345. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 40px">
  346. <el-form-item style="display: block;">
  347. <template slot="label">
  348. <span>备注说明/Comments</span>
  349. <el-button
  350. v-if="authDataEntry"
  351. style="margin-left: 2px;width: 83px;line-height: 0.5;font-size: 10px;"
  352. type="primary"
  353. @click="openRohsRemarkDialog">备注</el-button>
  354. </template>
  355. <el-input type="textarea" :rows="3" v-model="modalData.remark" :disabled="isRohsFieldDisabled('remark')" resize="none" style="width: 804px;height: 30px"></el-input>
  356. </el-form-item>
  357. </el-form>
  358. </div>
  359. </el-tab-pane>
  360. <!-- NPD 信息 -->
  361. <el-tab-pane label="NPD 信息" name="npdInfo">
  362. <div style="height: 755px; overflow-y: auto;">
  363. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  364. <el-form-item label="现有材料不同规格/Same Material Diff Size">
  365. <el-radio-group v-model="modalData.isSameMaterialDiffSize" :disabled="isRohsFieldDisabled('isSameMaterialDiffSize')" style="width: 190px">
  366. <el-radio label="Y" @click.native.prevent="radioClick('isSameMaterialDiffSize', 'Y')"></el-radio>
  367. <el-radio label="N" @click.native.prevent="radioClick('isSameMaterialDiffSize', 'N')"></el-radio>
  368. </el-radio-group>
  369. </el-form-item>
  370. </el-form>
  371. <el-form :inline="true" label-position="top" :model="modalData">
  372. <el-form-item label="材料描述/Material Desc." style="display: block;">
  373. <el-input type="textarea" :rows="3" v-model="modalData.materialDesc" :disabled="isRohsFieldDisabled('materialDesc')" resize="none" style="width: 804px;height: 30px"></el-input>
  374. </el-form-item>
  375. </el-form>
  376. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 50px">
  377. <el-form-item label="备注说明/NPD Remark" style="display: block;">
  378. <el-input type="textarea" :rows="3" v-model="modalData.npdRemark" :disabled="isRohsFieldDisabled('npdRemark')" resize="none" style="width: 804px;height: 30px"></el-input>
  379. </el-form-item>
  380. </el-form>
  381. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 50px">
  382. <el-form-item label="内部TDS/Inner TDS" style="display: block;">
  383. <oss-components
  384. ref="modalTdsOss"
  385. :save-visible="authFileSave"
  386. :edit-visible="authFileSave"
  387. :download-visible="authFileDownLoad"
  388. :remove-visible="authFileRemove"
  389. :preview-visible="authFilePreview"
  390. :disabled="showModalFlag || modalData.status === '已完成'"
  391. :enable-upgrade="!showModalFlag && modalData.status !== '已完成'"
  392. :require-file-no-rev="true"
  393. :auto-file-no="true"
  394. :single-upload="true"
  395. :row-click-select="true"
  396. :show-order-ref2="false"
  397. label="序列号"
  398. :height="470"
  399. style="margin-top: 2px"
  400. :columns="tdsFileColumnList"
  401. :order-ref1="modalData.site || ''"
  402. :order-ref2="modalData.referenceNo || ''"
  403. order-ref3="tdsProperty">
  404. </oss-components>
  405. </el-form-item>
  406. </el-form>
  407. </div>
  408. </el-tab-pane>
  409. <!-- HSF 填写信息 -->
  410. <el-tab-pane label="HSF 填写信息" name="hsfInfo">
  411. <div style="height: 755px">
  412. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  413. <el-form-item label="报告日期/Expired Date">
  414. <el-date-picker v-model="modalData.expiredDate" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('expiredDate')" style="width: 150px" :editable=false></el-date-picker>
  415. </el-form-item>
  416. <el-form-item label="有效期数值/Valid Until Value">
  417. <el-input-number
  418. v-model="modalData.validUntilValue"
  419. :controls="false"
  420. :min="0"
  421. :step="1"
  422. :precision="0"
  423. :disabled="isValidUntilValueDisabled()"
  424. style="width: 150px">
  425. </el-input-number>
  426. </el-form-item>
  427. <el-form-item label="有效期单位/Valid Until Unit">
  428. <dict-data-select v-model="modalData.validUntil" clearable :disabled="isValidUntilUnitDisabled()" style="width: 150px" dict-type="rohs_valid_until"></dict-data-select>
  429. </el-form-item>
  430. <el-form-item label="失效日期/Expiry Date">
  431. <el-date-picker v-model="modalData.expiryDate" type="date" value-format="yyyy-MM-dd" disabled style="width: 150px" :editable=false></el-date-picker>
  432. </el-form-item>
  433. <el-form-item label="状态/Status">
  434. <el-select v-model="modalData.rohsStatus" clearable :disabled="isRohsFieldDisabled('rohsStatus')" style="width: 150px">
  435. <el-option label="Active" value="Active"></el-option>
  436. <el-option label="Dead" value="Dead"></el-option>
  437. </el-select>
  438. </el-form-item>
  439. </el-form>
  440. <el-form :inline="true" label-position="top" :model="modalData">
  441. <el-form-item label="是否符合RoHS/Meet RoHS Req">
  442. <el-radio-group v-model="modalData.isMeetRohsRequirement" :disabled="isRohsFieldDisabled('isMeetRohsRequirement')" style="width: 190px">
  443. <el-radio label="Y" @click.native.prevent="radioClick('isMeetRohsRequirement', 'Y')"></el-radio>
  444. <el-radio label="N" @click.native.prevent="radioClick('isMeetRohsRequirement', 'N')"></el-radio>
  445. </el-radio-group>
  446. </el-form-item>
  447. <el-form-item label=" ">
  448. <el-checkbox
  449. v-model="modalData.isAhGrade"
  450. true-label="Y"
  451. false-label="N"
  452. :disabled="isRohsFieldDisabled('isAhGrade')"
  453. style="width: 190px">材料属性是否是AH/Is AH Grade</el-checkbox>
  454. </el-form-item>
  455. <el-form-item label="HSF供应商等级/Supplier Class">
  456. <el-radio-group v-model="modalData.hsfSupplierClassification" :disabled="isRohsFieldDisabled('hsfSupplierClassification')" style="width: 260px">
  457. <el-radio label="高风险" @click.native.prevent="radioClick('hsfSupplierClassification', '高风险')">高风险</el-radio>
  458. <el-radio label="中风险" @click.native.prevent="radioClick('hsfSupplierClassification', '中风险')">中风险</el-radio>
  459. <el-radio label="低风险" @click.native.prevent="radioClick('hsfSupplierClassification', '低风险')">低风险</el-radio>
  460. </el-radio-group>
  461. </el-form-item>
  462. </el-form>
  463. <el-form :inline="true" label-position="top" :model="modalData">
  464. <el-form-item label="Fiber报告信息/Fiber Information" style="display: block;">
  465. <el-input type="textarea" :rows="3" v-model="modalData.fiberInformation" :disabled="isRohsFieldDisabled('fiberInformation')" resize="none" style="width: 804px;height: 30px"></el-input>
  466. </el-form-item>
  467. </el-form>
  468. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 45px">
  469. <el-form-item>
  470. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('hsfApprover')" slot="label" @click="openHsfApproverChooseModal"><a herf="#">HSF审批人/HSF Approver</a></span>
  471. <span v-else slot="label">HSF审批人/HSF Approver</span>
  472. <el-input
  473. v-model="modalData.hsfApproverName"
  474. readonly
  475. :disabled="isRohsFieldDisabled('hsfApprover')"
  476. style="width: 396px"
  477. placeholder="请选择人员"
  478. @focus="openHsfApproverChooseModal">
  479. <span slot="suffix" v-show="modalData.hsfApproverName && !isRohsFieldDisabled('hsfApprover')" @click.stop="clearHsfApproverSelection">
  480. <i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i>
  481. </span>
  482. </el-input>
  483. </el-form-item>
  484. <el-form-item>
  485. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('relatedPeople')" slot="label" @click="openRelatedPeopleChooseModal"><a herf="#">Inform Related people</a></span>
  486. <span v-else slot="label">Inform Related people</span>
  487. <el-input
  488. v-model="modalData.relatedPeopleName"
  489. readonly
  490. :disabled="isRohsFieldDisabled('relatedPeople')"
  491. style="width: 396px"
  492. placeholder="请从HSF审批人中选择"
  493. @focus="openRelatedPeopleChooseModal">
  494. <span slot="suffix" v-show="modalData.relatedPeopleName && !isRohsFieldDisabled('relatedPeople')" @click.stop="clearRelatedPeopleSelection">
  495. <i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i>
  496. </span>
  497. </el-input>
  498. </el-form-item>
  499. </el-form>
  500. <el-form v-if="shouldShowHsfStandard(modalData.endCustomer)" :inline="true" label-position="top" :model="modalData" style="margin-top: 0px">
  501. <el-form-item label="HSF标准/HSF Standard" style="display: block;">
  502. <el-input type="textarea" :rows="3" v-model="modalData.hsfStandard" :disabled="isRohsFieldDisabled('hsfStandard')" resize="none" style="width: 804px;height: 30px"></el-input>
  503. </el-form-item>
  504. </el-form>
  505. </div>
  506. </el-tab-pane>
  507. <!-- 材料信息 -->
  508. <el-tab-pane label="材料信息" name="materialInfo">
  509. <div style="height: 755px">
  510. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -15px;">
  511. <el-form-item label=" ">
  512. <el-button type="primary" v-if="isEditMode && canEditRohsMaterial()" @click="openCreateIfsPartDialog">创建IFS料号</el-button>
  513. <el-button type="primary" v-if="!showModalFlag && canEditRohsMaterial()" @click="openProjectMaterialDialog">关联料号</el-button>
  514. <el-button type="danger" v-if="!showModalFlag && canEditRohsMaterial()" @click="removeSelectedMaterialRows">删除关联</el-button>
  515. </el-form-item>
  516. </el-form>
  517. <el-table
  518. ref="rohsMaterialTable"
  519. class="rohs-material-table"
  520. border
  521. :data="modalData.materialList"
  522. @selection-change="materialSelectionChange"
  523. :header-cell-style="materialDialogHeaderCellStyle"
  524. :height="715"
  525. style="width: 100%">
  526. <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
  527. <el-table-column type="index" label="序号" width="50" header-align="center" align="center"></el-table-column>
  528. <el-table-column prop="finalPartNo" label="IFS物料编码/Final Part No." min-width="150" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  529. <el-table-column prop="partDesc" label="描述/Part Desc." min-width="250" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  530. <el-table-column prop="partStatus" label="状态/Part Status" min-width="100" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  531. </el-table>
  532. </div>
  533. </el-tab-pane>
  534. <el-tab-pane label="附件信息" name="attachmentInfo">
  535. <div style="height: 755px; overflow-y: auto;">
  536. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  537. <el-form-item label="TDS" style="display: block;">
  538. <oss-components
  539. ref="modalAttachmentTdsOss"
  540. :save-visible="authFileSave"
  541. :edit-visible="authFileSave"
  542. :download-visible="authFileDownLoad"
  543. :remove-visible="authFileRemove"
  544. :preview-visible="authFilePreview"
  545. :row-click-select="true"
  546. :disabled="modalData.status === '已完成'"
  547. label="序列号"
  548. :height="145"
  549. style="margin-top: 2px"
  550. :columns="fileColumnList"
  551. :order-ref1="modalData.site || ''"
  552. :order-ref2="modalData.referenceNo || ''"
  553. order-ref3="rohsAttachmentTds">
  554. </oss-components>
  555. </el-form-item>
  556. </el-form>
  557. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 150px;">
  558. <el-form-item label="MSDS" style="display: block;">
  559. <oss-components
  560. ref="modalAttachmentMsdsOss"
  561. :save-visible="authFileSave"
  562. :edit-visible="authFileSave"
  563. :download-visible="authFileDownLoad"
  564. :remove-visible="authFileRemove"
  565. :preview-visible="authFilePreview"
  566. :row-click-select="true"
  567. :disabled="modalData.status === '已完成'"
  568. label="序列号"
  569. :height="145"
  570. style="margin-top: 2px"
  571. :columns="fileColumnList"
  572. :order-ref1="modalData.site || ''"
  573. :order-ref2="modalData.referenceNo || ''"
  574. order-ref3="rohsAttachmentMsds">
  575. </oss-components>
  576. </el-form-item>
  577. </el-form>
  578. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 150px;">
  579. <el-form-item label="测试报告/Test Report" style="display: block;">
  580. <oss-components
  581. ref="modalAttachmentTestReportOss"
  582. :save-visible="authFileSave"
  583. :edit-visible="authFileSave"
  584. :download-visible="authFileDownLoad"
  585. :remove-visible="authFileRemove"
  586. :preview-visible="authFilePreview"
  587. :row-click-select="true"
  588. :disabled="modalData.status === '已完成'"
  589. label="序列号"
  590. :height="145"
  591. style="margin-top: 2px"
  592. :columns="fileColumnList"
  593. :order-ref1="modalData.site || ''"
  594. :order-ref2="modalData.referenceNo || ''"
  595. order-ref3="rohsAttachmentTestReport">
  596. </oss-components>
  597. </el-form-item>
  598. </el-form>
  599. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 150px;">
  600. <el-form-item label="Other" style="display: block;">
  601. <oss-components
  602. ref="modalAttachmentOtherOss"
  603. :save-visible="authFileSave"
  604. :edit-visible="authFileSave"
  605. :download-visible="authFileDownLoad"
  606. :remove-visible="authFileRemove"
  607. :preview-visible="authFilePreview"
  608. :row-click-select="true"
  609. :disabled="modalData.status === '已完成'"
  610. label="序列号"
  611. :height="145"
  612. style="margin-top: 2px"
  613. :columns="fileColumnList"
  614. :order-ref1="modalData.site || ''"
  615. :order-ref2="modalData.referenceNo || ''"
  616. order-ref3="rohsAttachmentOther">
  617. </oss-components>
  618. </el-form-item>
  619. </el-form>
  620. </div>
  621. </el-tab-pane>
  622. </el-tabs>
  623. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  624. <el-button type="primary" v-if="canSaveAction()" @click="dataFormSubmit()">保存</el-button>
  625. <el-button type="primary" @click="handleModalClose">关闭</el-button>
  626. <el-button type="primary" v-if="canAgreeAction()" :loading="submitLoading" @click="agreeSubmit">同意</el-button>
  627. <el-button type="primary" v-if="canRejectAction()" :loading="submitLoading" @click="openRejectModal">驳回</el-button>
  628. </el-footer>
  629. </el-dialog>
  630. <!--选择项目模态框-->
  631. <el-dialog title="选择-项目" :close-on-click-modal="false" @close="closeProjectInfoDialog"
  632. @open="searchProjectInfoList" :visible.sync="chooseProjectListFlag" width="35%">
  633. <el-form label-position="top" :model="searchProjectData" ref="closeProjectInfoForm">
  634. <el-row :gutter="10">
  635. <el-col :span="6">
  636. <el-form-item label="项目号">
  637. <el-input v-model="searchProjectData.projectId"></el-input>
  638. </el-form-item>
  639. </el-col>
  640. <el-col :span="6">
  641. <el-form-item label="项目名称">
  642. <el-input v-model="searchProjectData.projectName"></el-input>
  643. </el-form-item>
  644. </el-col>
  645. <el-col :span="6">
  646. <el-form-item label=" ">
  647. <el-button type="primary" @click="searchProjectInfoList">查询</el-button>
  648. </el-form-item>
  649. </el-col>
  650. </el-row>
  651. <el-table :height="223"
  652. :data="projectList"
  653. border
  654. @row-click="projectClickRow">
  655. <el-table-column label="项目号" prop="projectId"/>
  656. <el-table-column label="项目名称" prop="projectName"/>
  657. </el-table>
  658. </el-form>
  659. <el-footer style="height:35px;margin-top: 10px;text-align:center">
  660. <el-button type="primary" @click="chooseProjectListFlag = false">关闭</el-button>
  661. </el-footer>
  662. </el-dialog>
  663. <el-dialog title="选择物料" top="15vh" width="50%" :close-on-click-modal="false" v-drag :visible.sync="projectMaterialDialogFlag">
  664. <el-form :inline="true" label-position="top" :model="projectMaterialSearchData">
  665. <el-form-item label="IFS物料编码/Final Part No.">
  666. <el-input v-model="projectMaterialSearchData.finalPartNo" clearable style="width: 150px"></el-input>
  667. </el-form-item>
  668. <el-form-item label="描述/Part Desc">
  669. <el-input v-model="projectMaterialSearchData.partDesc" clearable style="width: 200px"></el-input>
  670. </el-form-item>
  671. <el-form-item label="状态/Part Status">
  672. <el-input v-model="projectMaterialSearchData.partStatus" clearable style="width: 100px"></el-input>
  673. </el-form-item>
  674. <el-form-item label=" ">
  675. <el-button type="primary" @click="searchProjectMaterialList">查询</el-button>
  676. </el-form-item>
  677. </el-form>
  678. <el-table
  679. ref="projectMaterialTable"
  680. class="rohs-material-table"
  681. border
  682. v-loading="projectMaterialLoading"
  683. :data="projectMaterialList"
  684. @selection-change="projectMaterialSelectionChange"
  685. :header-cell-style="materialDialogHeaderCellStyle"
  686. :height="320"
  687. style="width: 100%">
  688. <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
  689. <el-table-column prop="finalPartNo" label="IFS物料编码/Final Part No." min-width="120" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  690. <el-table-column prop="partDesc" label="描述/Part Desc." min-width="250" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  691. <el-table-column prop="partStatus" label="状态/Part Status" min-width="80" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  692. </el-table>
  693. <el-pagination
  694. style="margin-top: 10px"
  695. @size-change="projectMaterialSizeChangeHandle"
  696. @current-change="projectMaterialCurrentChangeHandle"
  697. :current-page="projectMaterialPageIndex"
  698. :page-sizes="[20, 50, 100]"
  699. :page-size="projectMaterialPageSize"
  700. :total="projectMaterialTotal"
  701. layout="total, sizes, prev, pager, next, jumper">
  702. </el-pagination>
  703. <el-footer style="height:35px;margin-top: 10px;text-align:center">
  704. <el-button type="primary" @click="confirmProjectMaterialSelection">确定</el-button>
  705. <el-button type="primary" @click="projectMaterialDialogFlag = false">关闭</el-button>
  706. </el-footer>
  707. </el-dialog>
  708. <el-dialog
  709. title="创建IFS料号"
  710. top="7vh"
  711. width="1060px"
  712. v-drag
  713. :close-on-click-modal="false"
  714. :visible.sync="rohsCreatePartDialogFlag"
  715. @close="closeRohsCreatePartDialog">
  716. <el-form :inline="true" label-position="top" :model="rohsCreatePartData" style="margin-top: -5px;">
  717. <el-form-item label="Site">
  718. <el-input v-model="rohsCreatePartData.site" disabled style="width: 80px"></el-input>
  719. </el-form-item>
  720. <el-form-item label="物料编码 / Part No.">
  721. <el-input v-model="rohsCreatePartData.partNo" clearable style="width: 200px"></el-input>
  722. </el-form-item>
  723. <el-form-item label="物料名称 / Part Desc.">
  724. <el-input v-model="rohsCreatePartData.partDesc" clearable style="width: 360px"></el-input>
  725. </el-form-item>
  726. <el-form-item :label="' '">
  727. <el-button type="primary" @click="nextRohsCreatePartNo">Next Part No</el-button>
  728. </el-form-item>
  729. </el-form>
  730. <el-tabs v-model="rohsCreatePartTab" style="width: 100%;height: 465px;" type="border-card">
  731. <el-tab-pane label="General" name="General">
  732. <el-form :inline="true" label-position="top" :model="rohsCreatePartData" style="margin-top: -5px;">
  733. <el-form-item label="零件类型 / Part Type">
  734. <el-select v-model="rohsCreatePartData.partType" style="width: 458px">
  735. <el-option label="Manufactured" value="Manufactured"></el-option>
  736. <el-option label="Manufactured Recipe" value="Manufactured Recipe"></el-option>
  737. <el-option label="Purchased (raw)" value="Purchased (raw)"></el-option>
  738. <el-option label="Purchased" value="Purchased"></el-option>
  739. </el-select>
  740. </el-form-item>
  741. <el-form-item>
  742. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(123)"><a herf="#">安全代码 / Safety Code</a></span>
  743. <el-input v-model="rohsCreatePartData.hazardCode" clearable @blur="rohsCreateHazardCodeBlur(123)" style="width: 128px"></el-input>
  744. <el-input v-model="rohsCreatePartData.hazardDesc" disabled style="width: 327px"></el-input>
  745. </el-form-item>
  746. </el-form>
  747. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  748. <el-form-item>
  749. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(113)"><a herf="#">计划人 / Planner</a></span>
  750. <el-input v-model="rohsCreatePartData.productGroupId4" clearable @blur="rohsCreateProductGroupId4Blur(113)" style="width: 128px"></el-input>
  751. <el-input v-model="rohsCreatePartData.productGroupName4" disabled style="width: 327px"></el-input>
  752. </el-form-item>
  753. <el-form-item>
  754. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(112)"><a herf="#">会计组 / Accounting Group</a></span>
  755. <el-input v-model="rohsCreatePartData.productGroupId3" clearable @blur="rohsCreateProductGroupId3Blur(112)" style="width: 128px"></el-input>
  756. <el-input v-model="rohsCreatePartData.productGroupName3" disabled style="width: 327px"></el-input>
  757. </el-form-item>
  758. </el-form>
  759. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  760. <el-form-item>
  761. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(1007)"><a herf="#">计量单位 / Inventory UoM</a></span>
  762. <el-input v-model="rohsCreatePartData.umId" clearable @blur="rohsCreateUmIdBlur(1007)" style="width: 128px"></el-input>
  763. <el-input v-model="rohsCreatePartData.umName" disabled style="width: 327px"></el-input>
  764. </el-form-item>
  765. <el-form-item>
  766. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(109)"><a herf="#">产品代码 / Product Code</a></span>
  767. <el-input v-model="rohsCreatePartData.groupId" clearable @blur="rohsCreateGroupIdBlur(109)" style="width: 128px"></el-input>
  768. <el-input v-model="rohsCreatePartData.groupName" disabled style="width: 327px"></el-input>
  769. </el-form-item>
  770. </el-form>
  771. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  772. <el-form-item>
  773. <span slot="label">商品组1 / Comm Group 1</span>
  774. <el-input v-model="rohsCreatePartData.productGroupId1" readonly style="width: 128px"></el-input>
  775. <el-input v-model="rohsCreatePartData.productGroupName1" disabled style="width: 327px"></el-input>
  776. </el-form-item>
  777. <el-form-item>
  778. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(108)"><a herf="#">产品大类 / Product Family</a></span>
  779. <el-input v-model="rohsCreatePartData.familyId" clearable @blur="rohsCreateFamilyIdBlur(108)" style="width: 128px"></el-input>
  780. <el-input v-model="rohsCreatePartData.familyName" disabled style="width: 327px"></el-input>
  781. </el-form-item>
  782. </el-form>
  783. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  784. <el-form-item>
  785. <span slot="label">商品组2 / Comm Group 2</span>
  786. <el-input v-model="rohsCreatePartData.productGroupId2" readonly style="width: 128px"></el-input>
  787. <el-input v-model="rohsCreatePartData.productGroupName2" disabled style="width: 327px"></el-input>
  788. </el-form-item>
  789. <el-form-item label="类型指定 / Type Designation">
  790. <el-input v-model="rohsCreatePartData.typeDesignation" clearable style="width: 458px"></el-input>
  791. </el-form-item>
  792. </el-form>
  793. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  794. <el-form-item label="商品组3 / Comm Group 3">
  795. <el-input v-model="rohsCreatePartData.commGroup3" readonly style="width: 128px"></el-input>
  796. <el-input v-model="rohsCreatePartData.commGroup3Desc" disabled style="width: 327px"></el-input>
  797. </el-form-item>
  798. </el-form>
  799. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  800. <el-form-item>
  801. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(124)"><a herf="#">资产等级 / Asset Class</a></span>
  802. <el-input v-model="rohsCreatePartData.assetClass" clearable @blur="rohsCreateAssetClassBlur(124)" style="width: 128px"></el-input>
  803. <el-input v-model="rohsCreatePartData.assetClassDesc" disabled style="width: 327px"></el-input>
  804. </el-form-item>
  805. <el-form-item label="尺寸/材质 / Dimension/Quality">
  806. <el-input v-model="rohsCreatePartData.dimQuality" clearable style="width: 458px"></el-input>
  807. </el-form-item>
  808. </el-form>
  809. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  810. <el-form-item>
  811. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(125)"><a herf="#">零件状态 / Part Status</a></span>
  812. <el-input v-model="rohsCreatePartData.partStatus" clearable @blur="rohsCreatePartStatusBlur(125)" style="width: 128px"></el-input>
  813. <el-input v-model="rohsCreatePartData.partStatusDesc" disabled style="width: 327px"></el-input>
  814. </el-form-item>
  815. <el-form-item label="净重">
  816. <el-input class="inlineNumber numInput" v-model="rohsCreatePartData.weightNet" readonly type="number" style="width: 110px"></el-input>
  817. </el-form-item>
  818. <el-form-item label="净重单位" style="margin-left: -10px">
  819. <el-input v-model="rohsCreatePartData.uomForWeightNet" readonly style="width: 110px"></el-input>
  820. </el-form-item>
  821. <el-form-item label="频率级别 / Frequency Class">
  822. <el-input v-model="rohsCreatePartData.frequencyClass" readonly style="width: 220px"></el-input>
  823. </el-form-item>
  824. </el-form>
  825. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  826. <el-form-item>
  827. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(126)"><a herf="#">ABC类 / ABC Class</a></span>
  828. <el-input v-model="rohsCreatePartData.abcClass" clearable @blur="rohsCreateAbcClassBlur(126)" style="width: 128px"></el-input>
  829. <el-input v-model="rohsCreatePartData.abcClassDesc" disabled style="width: 327px"></el-input>
  830. </el-form-item>
  831. <el-form-item label="净数量">
  832. <el-input class="inlineNumber numInput" v-model="rohsCreatePartData.volumeNet" readonly type="number" style="width: 110px"></el-input>
  833. </el-form-item>
  834. <el-form-item label="数量单位" style="margin-left: -10px">
  835. <el-input v-model="rohsCreatePartData.uomForVolumeNet" readonly style="width: 110px"></el-input>
  836. </el-form-item>
  837. <el-form-item label="生命周期阶段 / Lifecycle Stage">
  838. <el-input v-model="rohsCreatePartData.lifecycleStage" readonly style="width: 220px"></el-input>
  839. </el-form-item>
  840. </el-form>
  841. </el-tab-pane>
  842. <el-tab-pane label="Acquisition" name="Acquisition">
  843. <el-form :inline="true" label-position="top" :model="rohsCreatePartData" style="margin-top: -5px;">
  844. <el-form-item label="制造备货期 / Manufacturing Lead Time">
  845. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.manufacturingLeadTime" @change="rohsChangeExpectedLeadTime" :disabled="!(rohsCreatePartData.partType === 'Manufactured' || rohsCreatePartData.partType === 'Manufactured Recipe')" style="width: 222px"></el-input-number>
  846. </el-form-item>
  847. <el-form-item label="Shelf Life(Weeks)">
  848. <el-input class="inlineNumber numInput" v-model="rohsCreatePartData.durabilityWeek" readonly type="number" style="width: 221px"></el-input>
  849. </el-form-item>
  850. <el-form-item>
  851. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(127)"><a herf="#">来源国家 / Country of Origin</a></span>
  852. <el-input v-model="rohsCreatePartData.countryOfOrigin" clearable @blur="rohsCreateCountryOfOriginBlur(127)" style="width: 128px"></el-input>
  853. <el-input v-model="rohsCreatePartData.countryOfOriginDesc" disabled style="width: 327px"></el-input>
  854. </el-form-item>
  855. </el-form>
  856. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  857. <el-form-item label="预期提前期 / Expected Lead Time">
  858. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.expectedLeadTime" style="width: 222px"></el-input-number>
  859. </el-form-item>
  860. <el-form-item label="Shelf Life(Days)">
  861. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.durabilityDay" @change="rohsChangeDurabilityWeek" style="width: 221px"></el-input-number>
  862. </el-form-item>
  863. <el-form-item>
  864. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(128)"><a herf="#">区域代码 / Region Code</a></span>
  865. <el-input v-model="rohsCreatePartData.regionOfOrigin" clearable @blur="rohsCreateRegionOfOriginBlur(128)" style="width: 128px"></el-input>
  866. <el-input v-model="rohsCreatePartData.regionOfOriginDesc" disabled style="width: 327px"></el-input>
  867. </el-form-item>
  868. </el-form>
  869. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  870. <el-form-item label="州内转换因子 / Intrastat Conv Factor">
  871. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.intrastatConvFactor" style="width: 128px"></el-input-number>
  872. <el-input v-model="rohsCreatePartData.umDesc" disabled style="width: 327px"></el-input>
  873. </el-form-item>
  874. <el-form-item>
  875. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(129)"><a herf="#">海关统计序号 / Customs Stat No</a></span>
  876. <el-input v-model="rohsCreatePartData.customsStatNo" clearable @blur="rohsCreateCustomsStatNoBlur(129)" style="width: 128px"></el-input>
  877. <el-input v-model="rohsCreatePartData.customsStatDesc" disabled style="width: 327px"></el-input>
  878. </el-form-item>
  879. </el-form>
  880. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  881. <el-form-item label="默认物料需求供应 / Default Mtr Req Supply">
  882. <el-select v-model="rohsCreatePartData.supplyCode" style="width: 458px" clearable>
  883. <el-option label="Inventory Order" value="Inventory Order"></el-option>
  884. <el-option label="Purchase Order" value="Purchase Order"></el-option>
  885. </el-select>
  886. </el-form-item>
  887. </el-form>
  888. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  889. <el-form-item label="备注" style="height: 80px">
  890. <el-input type="textarea" v-model="rohsCreatePartData.remark" :rows="3" resize='none' show-word-limit style="width: 931px"></el-input>
  891. </el-form-item>
  892. </el-form>
  893. </el-tab-pane>
  894. <el-tab-pane label="Costs" name="Costs">
  895. <el-form :inline="true" label-position="top" :model="rohsCreatePartData" style="margin-top: -5px;">
  896. <el-form-item label="配置标识 / Configuration ID">
  897. <el-select v-model="rohsCreatePartData.configurationId" style="width: 220px">
  898. <el-option label="*" value="*"></el-option>
  899. </el-select>
  900. </el-form-item>
  901. <el-form-item label="估计物料成本 / Estimated Material Cost">
  902. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.estimatedMaterialCost" style="width: 220px"></el-input-number>
  903. </el-form-item>
  904. </el-form>
  905. </el-tab-pane>
  906. <el-tab-pane label="Misc Part Info" name="MiscPartInfo">
  907. <el-form :inline="true" label-position="top" :model="rohsCreatePartData" style="margin-top: -5px;">
  908. <el-form-item label="库存估价方法 / Inventory Valuation Method">
  909. <el-select v-model="rohsCreatePartData.inventoryValuationMethod" style="width: 458px">
  910. <el-option label="Weighted Average" value="Weighted Average"></el-option>
  911. <el-option label="Standard Cost" value="Standard Cost"></el-option>
  912. <el-option label="First In First Out" value="First In First Out"></el-option>
  913. <el-option label="Last In First Out" value="Last In First Out"></el-option>
  914. </el-select>
  915. </el-form-item>
  916. <el-form-item>
  917. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(131)"><a herf="#">零件成本组 / Part Cost Group</a></span>
  918. <el-input v-model="rohsCreatePartData.partCostGroupId" clearable @blur="rohsCreatePartCostGroupIdBlur(131)" style="width: 128px"></el-input>
  919. <el-input v-model="rohsCreatePartData.partCostGroupDesc" disabled style="width: 327px"></el-input>
  920. </el-form-item>
  921. </el-form>
  922. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  923. <el-form-item label="库存件成本层 / Inventory Part Cost Level">
  924. <el-select v-model="rohsCreatePartData.inventoryPartCostLevel" style="width: 458px">
  925. <el-option label="Cost Per Part" value="Cost Per Part"></el-option>
  926. <el-option label="Cost Per Configuration" value="Cost Per Configuration"></el-option>
  927. <el-option label="Cost Per Condition" value="Cost Per Condition"></el-option>
  928. <el-option label="Cost Per Lot Batch" value="Cost Per Lot Batch"></el-option>
  929. <el-option label="Cost Per Serial" value="Cost Per Serial"></el-option>
  930. </el-select>
  931. </el-form-item>
  932. </el-form>
  933. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  934. <el-form-item label="供应商发票事项 / Supplier Invoice Consideration">
  935. <el-select v-model="rohsCreatePartData.invoiceConsideration" style="width: 458px">
  936. <el-option label="Ignore Invoice Price" value="Ignore Invoice Price"></el-option>
  937. <el-option label="Periodic Weighted Average" value="Periodic Weighted Average"></el-option>
  938. <el-option label="Transaction Based" value="Transaction Based"></el-option>
  939. </el-select>
  940. </el-form-item>
  941. </el-form>
  942. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  943. <el-form-item label="零成本 / Zero Cost">
  944. <el-select v-model="rohsCreatePartData.zeroCostFlag" style="width: 458px">
  945. <el-option label="Zero Cost Allowed" value="Zero Cost Allowed"></el-option>
  946. <el-option label="Zero Cost Forbidden" value="Zero Cost Forbidden"></el-option>
  947. <el-option label="Zero Cost Only" value="Zero Cost Only"></el-option>
  948. </el-select>
  949. </el-form-item>
  950. </el-form>
  951. </el-tab-pane>
  952. <el-tab-pane label="Planning Data" name="PlanningData">
  953. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  954. <el-form-item>
  955. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(132)"><a herf="#">计划方法 / Planning Method</a></span>
  956. <el-input v-model="rohsCreatePartData.planningMethod" clearable @blur="rohsCreatePlanningMethodBlur(132)" style="width: 170px"></el-input>
  957. </el-form-item>
  958. <el-form-item label=" ">
  959. <el-input v-model="rohsCreatePartData.planningMethodDesc" disabled style="width: 510px"></el-input>
  960. </el-form-item>
  961. </el-form>
  962. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  963. <el-form-item label="安全库存 / Safety Stock">
  964. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.safetyStock" style="width: 170px"></el-input-number>
  965. </el-form-item>
  966. <el-form-item label="最小批量 / Min Lot Size">
  967. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.minOrderQty" style="width: 170px"></el-input-number>
  968. </el-form-item>
  969. <el-form-item label="最大批量 / Max Lot Size">
  970. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.maxOrderQty" style="width: 155px"></el-input-number>
  971. </el-form-item>
  972. <el-form-item label="多种批量大小 / Multiple Lot Size">
  973. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.mulOrderQty" style="width: 155px"></el-input-number>
  974. </el-form-item>
  975. </el-form>
  976. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  977. <el-form-item label="安全提前期 / Safety Lead Time">
  978. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.safetyLeadTime" style="width: 170px"></el-input-number>
  979. </el-form-item>
  980. <el-form-item label="报废因子(%) / Scrap Factor(%)">
  981. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.shrinkageFac" style="width: 170px"></el-input-number>
  982. </el-form-item>
  983. <el-form-item label="标准批量大小 / Std Lot Size">
  984. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.stdOrderQty" style="width: 155px"></el-input-number>
  985. </el-form-item>
  986. </el-form>
  987. </el-tab-pane>
  988. <el-tab-pane label="Manufacturing" name="Manufacturing">
  989. <el-form :inline="true" label-position="top" :model="rohsCreatePartData" style="margin-top: -5px;">
  990. <el-form-item label="累计提前期 / Cum Lead Time">
  991. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.cumLeadTime" style="width: 294px"></el-input-number>
  992. </el-form-item>
  993. <el-form-item label="预留/下发来源 / Reserve/Issue from">
  994. <el-select v-model="rohsCreatePartData.backFlushPart" style="width: 248px">
  995. <el-option label="All Locations" value="All Locations"></el-option>
  996. <el-option label="Only Floor Stock" value="Only Floor Stock"></el-option>
  997. <el-option label="Only Specified Location" value="Only Specified Location"></el-option>
  998. </el-select>
  999. </el-form-item>
  1000. <el-form-item style="margin-top: 23px">
  1001. <el-checkbox v-model="rohsCreatePartData.byProdAsSupplyInMrpDb" true-label="Y">将副产品用作MRP中的供应 / Use By-Product as Supply in MRP</el-checkbox>
  1002. </el-form-item>
  1003. </el-form>
  1004. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  1005. <el-form-item label="未受保护提前期 / Unprotected Lead Time">
  1006. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.unprotectedLeadTime" style="width: 294px"></el-input-number>
  1007. </el-form-item>
  1008. <el-form-item label="预留/下发方法 / Reserve/Issue Method">
  1009. <el-select v-model="rohsCreatePartData.issueType" style="width: 248px">
  1010. <el-option label="Reserve" value="Reserve"></el-option>
  1011. <el-option label="Backflush" value="Backflush"></el-option>
  1012. <el-option label="Reserve And Backflush" value="Reserve And Backflush"></el-option>
  1013. <el-option label="Manual" value="Manual"></el-option>
  1014. </el-select>
  1015. </el-form-item>
  1016. <el-form-item style="margin-top: 23px">
  1017. <el-checkbox v-model="rohsCreatePartData.mrpControlFlagDb" true-label="Y">MRP控制 / MRP Control</el-checkbox>
  1018. </el-form-item>
  1019. </el-form>
  1020. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  1021. <el-form-item label="按日固定提前期 / Fixed Lead Time by Day">
  1022. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.fixedLeadTimeDay" style="width: 294px"></el-input-number>
  1023. </el-form-item>
  1024. <el-form-item label="过度报告 / Over Reporting">
  1025. <el-select v-model="rohsCreatePartData.overReporting" style="width: 248px">
  1026. <el-option label="Allowed" value="Allowed"></el-option>
  1027. <el-option label="Allowed with Warning" value="Allowed with Warning"></el-option>
  1028. <el-option label="Not Allowed" value="Not Allowed"></el-option>
  1029. </el-select>
  1030. </el-form-item>
  1031. <el-form-item style="margin-top: 23px">
  1032. <el-checkbox v-model="rohsCreatePartData.useTheoreticalDensityDb" true-label="Y">使用理论 / Use Theoretical</el-checkbox>
  1033. </el-form-item>
  1034. </el-form>
  1035. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  1036. <el-form-item label="按天的可变化提前期 / Variable Lead Time by Day">
  1037. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.variableLeadTimeDay" style="width: 294px"></el-input-number>
  1038. </el-form-item>
  1039. <el-form-item label="报告公差过大 / Over Report Tolerance">
  1040. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.overReportTolerance" style="width: 248px"></el-input-number>
  1041. </el-form-item>
  1042. </el-form>
  1043. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  1044. <el-form-item label="按小时的固定提前期 / Fixed Lead Time by Hour">
  1045. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.fixedLeadTimeHour" style="width: 294px"></el-input-number>
  1046. </el-form-item>
  1047. <el-form-item label="密度 / Density">
  1048. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.density" style="width: 248px"></el-input-number>
  1049. </el-form-item>
  1050. </el-form>
  1051. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  1052. <el-form-item label="按小时计算的可变提前期 / Variable Lead Time by Hour">
  1053. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.variableLeadTimeHour" style="width: 294px"></el-input-number>
  1054. </el-form-item>
  1055. </el-form>
  1056. </el-tab-pane>
  1057. <el-tab-pane label="Characteristics" name="Characteristics">
  1058. <el-form :inline="true" label-position="top" :model="rohsCreatePartData" style="margin-top: -5px;">
  1059. <el-form-item>
  1060. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(20)"><a herf="#">属性模板</a></span>
  1061. <el-input v-model="rohsCreatePartData.codeNo" clearable @blur="rohsCreateCodeNoBlur(20)" style="width: 128px"></el-input>
  1062. <el-input v-model="rohsCreatePartData.codeDesc" disabled style="width: 327px"></el-input>
  1063. </el-form-item>
  1064. <el-form-item :label="' '">
  1065. <el-button type="primary" @click="openRohsCharacteristicDialog">新增</el-button>
  1066. <el-button type="primary" @click="removeRohsPartItemRows">删除</el-button>
  1067. </el-form-item>
  1068. </el-form>
  1069. <div class="rq">
  1070. <el-table
  1071. :data="rohsCreatePartData.partItemList"
  1072. height="355px"
  1073. border
  1074. @selection-change="rohsPartItemSelectionChange"
  1075. style="width: 100%">
  1076. <el-table-column
  1077. type="selection"
  1078. align="center"
  1079. width="50">
  1080. </el-table-column>
  1081. <el-table-column
  1082. v-for="(item,index) in rohsCreatePartColumnItemList" :key="index"
  1083. :sortable="item.columnSortable"
  1084. :prop="item.columnProp"
  1085. :header-align="item.headerAlign"
  1086. :show-overflow-tooltip="item.showOverflowTooltip"
  1087. :align="item.align"
  1088. :fixed="item.fixed===''?false:item.fixed"
  1089. :min-width="item.columnWidth"
  1090. :label="item.columnLabel">
  1091. <template slot-scope="scope">
  1092. <div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
  1093. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  1094. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  1095. </div>
  1096. <div v-else>
  1097. <div v-if="scope.row.valueChooseFlag !== 'Y'">
  1098. <el-input-number v-if="scope.row.valueTypeDb === 'N'" v-model="scope.row.numValue" style="padding: 0;width: 100%" :controls="false"></el-input-number>
  1099. <el-input v-else v-model="scope.row.textValue"></el-input>
  1100. </div>
  1101. <div v-else>
  1102. <el-select style="width: 100%;" v-if="scope.row.valueTypeDb === 'T'" v-model="scope.row.textValue" clearable>
  1103. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  1104. </el-select>
  1105. <el-select style="width: 100%;" v-else v-model="scope.row.numValue" clearable>
  1106. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  1107. </el-select>
  1108. </div>
  1109. </div>
  1110. </template>
  1111. </el-table-column>
  1112. </el-table>
  1113. </div>
  1114. </el-tab-pane>
  1115. </el-tabs>
  1116. <el-footer style="height:35px;margin-top: 10px;text-align:center">
  1117. <el-button type="primary" :loading="rohsCreatePartLoading" @click="saveRohsCreatePart">保存</el-button>
  1118. <el-button type="primary" @click="rohsCreatePartDialogFlag = false">关闭</el-button>
  1119. </el-footer>
  1120. </el-dialog>
  1121. <el-dialog title="物料属性" :close-on-click-modal="false" v-drag :visible.sync="rohsCharacteristicDialogFlag" width="730px">
  1122. <el-form :inline="true" label-position="top" :model="rohsCharacteristicQueryData">
  1123. <el-form-item :label="'属性编码'">
  1124. <el-input v-model="rohsCharacteristicQueryData.propertiesItemNo" clearable style="width: 200px"></el-input>
  1125. </el-form-item>
  1126. <el-form-item :label="'属性名称'">
  1127. <el-input v-model="rohsCharacteristicQueryData.itemDesc" clearable style="width: 200px"></el-input>
  1128. </el-form-item>
  1129. <el-form-item :label="' '">
  1130. <el-button type="primary" @click="queryRohsCharacteristicOptions">查询</el-button>
  1131. </el-form-item>
  1132. </el-form>
  1133. <el-table
  1134. :height="250"
  1135. :data="rohsCharacteristicList"
  1136. border
  1137. ref="rohsCharacteristicTable"
  1138. @row-click="rohsCharacteristicRowClick"
  1139. @selection-change="rohsCharacteristicSelectionChange"
  1140. style="width: 100%;">
  1141. <el-table-column type="selection" align="center" width="50"></el-table-column>
  1142. <el-table-column
  1143. v-for="(item,index) in rohsCharacteristicColumnList" :key="index"
  1144. :sortable="item.columnSortable"
  1145. :prop="item.columnProp"
  1146. :header-align="item.headerAlign"
  1147. :show-overflow-tooltip="item.showOverflowTooltip"
  1148. :align="item.align"
  1149. :fixed="item.fixed===''?false:item.fixed"
  1150. :min-width="item.columnWidth"
  1151. :label="item.columnLabel">
  1152. <template slot-scope="scope">
  1153. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  1154. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  1155. </template>
  1156. </el-table-column>
  1157. </el-table>
  1158. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  1159. <el-button type="primary" @click="saveRohsCharacteristics">保存</el-button>
  1160. <el-button type="primary" @click="rohsCharacteristicDialogFlag = false">关闭</el-button>
  1161. </el-footer>
  1162. </el-dialog>
  1163. <el-dialog title="人员选择" @open="openHsfApproverDialog" @close="closeHsfApproverDialog" v-drag
  1164. :visible.sync="hsfApproverFlag" width="40vw" :close-on-click-modal="false">
  1165. <el-form :inline="true" label-position="top" :model="hsfApproverSearchData">
  1166. <el-form-item label="编码">
  1167. <el-input v-model="hsfApproverSearchData.operatorId" clearable style="width: 120px"></el-input>
  1168. </el-form-item>
  1169. <el-form-item label="名称">
  1170. <el-input v-model="hsfApproverSearchData.operatorName" clearable style="width: 120px"></el-input>
  1171. </el-form-item>
  1172. <el-form-item label=" ">
  1173. <el-button type="primary" @click="filterHsfApproverOptions">查询</el-button>
  1174. </el-form-item>
  1175. </el-form>
  1176. <el-table v-if="hsfApproverFlag"
  1177. :height="300"
  1178. :data="hsfApproverDisplayList"
  1179. @selection-change="handleHsfApproverSelectionChange"
  1180. @row-click="(row,column,event) => handleHsfApproverTableClick(row,column,event,'hsfApproverTable')"
  1181. ref="hsfApproverTable"
  1182. border row-key="operatorId"
  1183. style="width: 100%;">
  1184. <el-table-column
  1185. type="selection"
  1186. header-align="center"
  1187. align="center"
  1188. :reserve-selection="true"
  1189. width="50">
  1190. </el-table-column>
  1191. <el-table-column label="编码" property="operatorId" align="left" header-align="center"/>
  1192. <el-table-column label="名称" property="operatorName" align="left" header-align="center"/>
  1193. </el-table>
  1194. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  1195. <el-button type="primary" @click="saveHsfApproverChooseModal">确定</el-button>
  1196. <el-button type="primary" @click="hsfApproverFlag = false">关闭</el-button>
  1197. </el-footer>
  1198. </el-dialog>
  1199. <el-dialog title="人员选择" @open="openRelatedPeopleDialog" @close="closeRelatedPeopleDialog" v-drag
  1200. :visible.sync="relatedPeopleFlag" width="40vw" :close-on-click-modal="false">
  1201. <el-form :inline="true" label-position="top" :model="relatedPeopleSearchData">
  1202. <el-form-item label="编码">
  1203. <el-input v-model="relatedPeopleSearchData.operatorId" clearable style="width: 120px"></el-input>
  1204. </el-form-item>
  1205. <el-form-item label="名称">
  1206. <el-input v-model="relatedPeopleSearchData.operatorName" clearable style="width: 120px"></el-input>
  1207. </el-form-item>
  1208. <el-form-item label=" ">
  1209. <el-button type="primary" @click="filterRelatedPeopleOptions">查询</el-button>
  1210. </el-form-item>
  1211. </el-form>
  1212. <el-table v-if="relatedPeopleFlag"
  1213. :height="300"
  1214. :data="relatedPeopleDisplayList"
  1215. highlight-current-row
  1216. @current-change="handleRelatedPeopleCurrentChange"
  1217. @row-click="handleRelatedPeopleTableClick"
  1218. ref="relatedPeopleTable"
  1219. border
  1220. style="width: 100%;">
  1221. <el-table-column label="编码" property="operatorId" align="left" header-align="center"/>
  1222. <el-table-column label="名称" property="operatorName" align="left" header-align="center"/>
  1223. </el-table>
  1224. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  1225. <el-button type="primary" @click="saveRelatedPeopleChooseModal">确定</el-button>
  1226. <el-button type="primary" @click="relatedPeopleFlag = false">关闭</el-button>
  1227. </el-footer>
  1228. </el-dialog>
  1229. <el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="submitModalFlag" width="500px">
  1230. <el-form label-position="top">
  1231. <el-form-item label="驳回意见/Reject Opinion">
  1232. <el-input type="textarea" v-model="rejectOpinion" :rows="3" resize="none" show-word-limit style="width: 479px;height: 30px"></el-input>
  1233. </el-form-item>
  1234. </el-form>
  1235. <el-footer style="height:35px;margin-top:50px;text-align:center">
  1236. <el-button type="primary" :loading="submitLoading" @click="rejectSubmit">确定</el-button>
  1237. <el-button type="primary" @click="submitModalFlag = false">取消</el-button>
  1238. </el-footer>
  1239. </el-dialog>
  1240. <el-dialog width="700px" title="备注" :close-on-click-modal="false" :visible.sync="rohsRemarkFlag" v-drag>
  1241. <el-form label-position="top">
  1242. <el-form-item label="备注说明">
  1243. <el-input
  1244. type="textarea"
  1245. v-model="rohsRemarkForm.remark"
  1246. :rows="6"
  1247. maxlength="255"
  1248. show-word-limit
  1249. resize="none">
  1250. </el-input>
  1251. </el-form-item>
  1252. </el-form>
  1253. <el-footer style="height:35px;margin-top:110px;text-align:center">
  1254. <el-button type="primary" @click="refreshRohsRemark">刷新</el-button>
  1255. <el-button type="primary" @click="saveRohsRemark">保存</el-button>
  1256. <el-button type="primary" @click="rohsRemarkFlag = false">取消</el-button>
  1257. </el-footer>
  1258. </el-dialog>
  1259. <!-- 底部附件页签 -->
  1260. <el-tabs v-model="activeTable" style="width: 100%; height: 100%;" type="border-card" @tab-click="refreshCurrentTabTable" class="customer-tab">
  1261. <el-tab-pane label="基本信息" name="basicInfo">
  1262. <div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
  1263. <el-form :inline="true" label-position="top" :model="currentRow">
  1264. <el-form-item>
  1265. <span slot="label">申请人/Reference No.</span>
  1266. <el-input :value="currentRow.applicant || ''" disabled style="width: 100px"></el-input>
  1267. <el-input :value="currentRow.applicantName || ''" disabled style="width: 155px"></el-input>
  1268. </el-form-item>
  1269. <el-form-item label="申请日期/Date">
  1270. <el-date-picker :value="currentRow.applicationDate" disabled type="date" value-format="yyyy-MM-dd" style="width: 150px"></el-date-picker>
  1271. </el-form-item>
  1272. <el-form-item label="Site">
  1273. <el-input :value="currentRow.site || ''" disabled style="width: 95px"></el-input>
  1274. </el-form-item>
  1275. <el-form-item label="工艺/Process">
  1276. <el-input :value="currentRow.process || ''" disabled style="width: 121px"></el-input>
  1277. </el-form-item>
  1278. </el-form>
  1279. <el-form :inline="true" label-position="top" :model="currentRow">
  1280. <el-form-item>
  1281. <span slot="label">最终客户/End Customer</span>
  1282. <el-input :value="currentRow.endCustomer || ''" disabled style="width: 100px"></el-input>
  1283. <el-input :value="currentRow.endCustomerName || ''" disabled style="width: 155px"></el-input>
  1284. </el-form-item>
  1285. <el-form-item>
  1286. <span slot="label">项目编码/Project</span>
  1287. <el-input :value="currentRow.projectId || ''" disabled style="width: 100px"></el-input>
  1288. <el-input :value="currentRow.projectName || ''" disabled style="width: 155px"></el-input>
  1289. </el-form-item>
  1290. <el-form-item label="WM所需求规格/The size that WM need">
  1291. <el-input :value="currentRow.wmRequiredSpec || ''" disabled style="width: 260px"></el-input>
  1292. </el-form-item>
  1293. </el-form>
  1294. <el-form :inline="true" label-position="top" :model="currentRow">
  1295. <el-form-item label="供应商/Vendor Code">
  1296. <el-input :value="currentRow.vendorCode || ''" disabled style="width: 396px"></el-input>
  1297. </el-form-item>
  1298. <el-form-item label="供应商材料编码/Vendor Material Code">
  1299. <el-input :value="currentRow.vendorMaterialCode || ''" disabled style="width: 396px"></el-input>
  1300. </el-form-item>
  1301. </el-form>
  1302. <el-form :inline="true" label-position="top" :model="currentRow">
  1303. <el-form-item label="材料分类/Material Classify">
  1304. <el-input type="textarea" :rows="2" resize="none" :value="currentRow.materialClassify || ''" disabled style="width: 532px"></el-input>
  1305. </el-form-item>
  1306. <el-form-item label="其他分类/Other Material Classify" v-if="currentRow.materialClassify && currentRow.materialClassify.includes('Other其他')">
  1307. <el-input :value="currentRow.otherMaterialClassify || ''" disabled style="width: 260px"></el-input>
  1308. </el-form-item>
  1309. </el-form>
  1310. <el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 30px">
  1311. <el-form-item label="辅材用途/Assiaccessorial Material Use for">
  1312. <el-input :value="currentRow.materialUseFor || ''" disabled style="width: 259px"></el-input>
  1313. </el-form-item>
  1314. <el-form-item>
  1315. <span slot="label">技术计划/TP</span>
  1316. <el-input :value="currentRow.technicalPlan || ''" disabled style="width: 100px"></el-input>
  1317. <el-input :value="currentRow.technicalPlanName || ''" disabled style="width: 155px"></el-input>
  1318. </el-form-item>
  1319. <el-form-item>
  1320. <span slot="label">PM人员/PM</span>
  1321. <el-input :value="currentRow.pm || ''" disabled style="width: 100px"></el-input>
  1322. <el-input :value="currentRow.pmName || ''" disabled style="width: 156px"></el-input>
  1323. </el-form-item>
  1324. </el-form>
  1325. <el-form :inline="true" label-position="top" :model="currentRow">
  1326. <el-form-item label="颜色/Color">
  1327. <el-input :value="currentRow.color || ''" disabled style="width: 532px"></el-input>
  1328. </el-form-item>
  1329. <el-form-item label="计划转量产时间/Planned Mass Production Date">
  1330. <el-date-picker :value="normalizeDateOnly(currentRow.plannedMassProductionDate)" disabled type="date" value-format="yyyy-MM-dd" style="width: 260px"></el-date-picker>
  1331. </el-form-item>
  1332. </el-form>
  1333. <el-form :inline="true" label-position="top" :model="currentRow">
  1334. <el-form-item>
  1335. <span slot="label">商品组1/Comm Group 1</span>
  1336. <el-input :value="currentRow.commGroup1 || ''" disabled style="width: 100px"></el-input>
  1337. <el-input :value="currentRow.commGroup1Desc || ''" disabled style="width: 155px"></el-input>
  1338. </el-form-item>
  1339. <el-form-item>
  1340. <span slot="label">商品组2/Comm Group 2</span>
  1341. <el-input :value="currentRow.commGroup2 || ''" disabled style="width: 100px"></el-input>
  1342. <el-input :value="currentRow.commGroup2Desc || ''" disabled style="width: 155px"></el-input>
  1343. </el-form-item>
  1344. <el-form-item>
  1345. <span slot="label">商品组3/Comm Group 3</span>
  1346. <el-input :value="currentRow.commGroup3 || ''" disabled style="width: 100px"></el-input>
  1347. <el-input :value="currentRow.commGroup3Desc || ''" disabled style="width: 156px"></el-input>
  1348. </el-form-item>
  1349. </el-form>
  1350. <el-form :inline="true" label-position="top" :model="currentRow">
  1351. <el-form-item label="是否是Fiber材料">
  1352. <el-radio-group :value="currentRow.isFiberMaterial" disabled style="width: 145px">
  1353. <el-radio label="Y"></el-radio>
  1354. <el-radio label="N"></el-radio>
  1355. </el-radio-group>
  1356. </el-form-item>
  1357. <el-form-item label="是否需要创建300/700/900号/Dose Need Create 300/700/900 Number">
  1358. <el-radio-group :value="currentRow.needCreateNumber" disabled style="width: 374px">
  1359. <el-radio label="Y"></el-radio>
  1360. <el-radio label="N"></el-radio>
  1361. </el-radio-group>
  1362. </el-form-item>
  1363. <el-form-item label="材料厚度/Material Thickness">
  1364. <el-input :value="currentRow.materialThickness || ''" disabled style="width: 260px"></el-input>
  1365. </el-form-item>
  1366. </el-form>
  1367. <el-form :inline="true" label-position="top" :model="currentRow">
  1368. <el-form-item label="材料有效期/Material Validity Time">
  1369. <dict-data-select :value="currentRow.materialValidityTime || ''" :use-default-value="false" disabled style="width: 260px" dict-type="rohs_material_validity_time"></dict-data-select>
  1370. </el-form-item>
  1371. <el-form-item label="是否需要Deviation/If need deviation or not">
  1372. <el-radio-group :value="currentRow.needDeviation" disabled style="width: 259px">
  1373. <el-radio label="Y"></el-radio>
  1374. <el-radio label="N"></el-radio>
  1375. </el-radio-group>
  1376. </el-form-item>
  1377. <el-form-item>
  1378. <span slot="label">NPD工程师/NPD Engineer</span>
  1379. <el-input :value="currentRow.npdEngineer || ''" disabled style="width: 100px"></el-input>
  1380. <el-input :value="currentRow.npdEngineerName || ''" disabled style="width: 155px"></el-input>
  1381. </el-form-item>
  1382. </el-form>
  1383. <el-form :inline="true" label-position="top" :model="currentRow">
  1384. <el-form-item label="材料有效期备注/Material Validity Time Comments">
  1385. <el-input :value="currentRow.materialValidityComments || ''" disabled style="width: 260px"></el-input>
  1386. </el-form-item>
  1387. <el-form-item label="预计提供报告时间(一个月内)/Expect Date" style="margin-left: -2px">
  1388. <el-date-picker :value="normalizeDateOnly(currentRow.expectReportTime)" disabled type="date" value-format="yyyy-MM-dd" style="width: 259px"></el-date-picker>
  1389. </el-form-item>
  1390. <el-form-item>
  1391. <span slot="label">采购/Buyer</span>
  1392. <el-input :value="currentRow.buyer || ''" disabled style="width: 100px"></el-input>
  1393. <el-input :value="currentRow.buyerName || ''" disabled style="width: 156px"></el-input>
  1394. </el-form-item>
  1395. </el-form>
  1396. <el-form :inline="true" label-position="top" :model="currentRow">
  1397. <el-form-item label="所需审批文件/Qualification Documents needed">
  1398. <el-input type="textarea" :rows="2" resize="none" :value="currentRow.qualificationDocumentsNeeded || ''" disabled style="width: 807px"></el-input>
  1399. </el-form-item>
  1400. </el-form>
  1401. <el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 30px">
  1402. <el-form-item label="测试报告必测项/Test Report including items">
  1403. <el-input type="textarea" :rows="2" resize="none" :value="currentRow.testReportIncludingItems || ''" disabled style="width: 807px"></el-input>
  1404. </el-form-item>
  1405. </el-form>
  1406. <el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 30px">
  1407. <el-form-item label="备注说明/Comments" style="display: block;">
  1408. <el-input type="textarea" :rows="3" :value="currentRow.remark || ''" disabled resize="none" style="width: 804px;height: 30px"></el-input>
  1409. </el-form-item>
  1410. </el-form>
  1411. </div>
  1412. </el-tab-pane>
  1413. <el-tab-pane label="NPD 信息" name="npdInfo">
  1414. <div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
  1415. <el-form :inline="true" label-position="top" :model="currentRow">
  1416. <el-form-item label="现有材料不同规格/Same Material Diff Size">
  1417. <el-radio-group :value="currentRow.isSameMaterialDiffSize" disabled style="width: 190px">
  1418. <el-radio label="Y"></el-radio>
  1419. <el-radio label="N"></el-radio>
  1420. </el-radio-group>
  1421. </el-form-item>
  1422. </el-form>
  1423. <el-form :inline="true" label-position="top" :model="currentRow">
  1424. <el-form-item label="材料描述/Material Desc." style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.materialDesc || ''" disabled resize="none" style="width: 804px;height: 30px"></el-input></el-form-item>
  1425. </el-form>
  1426. <el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 50px">
  1427. <el-form-item label="备注说明/NPD Remark" style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.npdRemark || ''" disabled resize="none" style="width: 804px;height: 30px"></el-input></el-form-item>
  1428. </el-form>
  1429. <el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 50px">
  1430. <el-form-item label="内部TDS/Inner TDS" style="display: block;">
  1431. <oss-components
  1432. ref="bottomTdsOss"
  1433. :save-visible="authFileSave"
  1434. :edit-visible="false"
  1435. :download-visible="authFileDownLoad"
  1436. :remove-visible="authFileRemove"
  1437. :preview-visible="authFilePreview"
  1438. :disabled="true"
  1439. label="序列号"
  1440. :height="180"
  1441. style="margin-top: 2px"
  1442. :columns="tdsFileColumnList"
  1443. :order-ref1="currentRow.site || ''"
  1444. :order-ref2="currentRow.referenceNo || ''"
  1445. order-ref3="tdsProperty">
  1446. </oss-components>
  1447. </el-form-item>
  1448. </el-form>
  1449. </div>
  1450. </el-tab-pane>
  1451. <el-tab-pane label="HSF 填写信息" name="hsfInfo">
  1452. <div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
  1453. <el-form :inline="true" label-position="top" :model="currentRow">
  1454. <el-form-item label="报告日期/Expired Date">
  1455. <el-date-picker :value="currentRow.expiredDate" disabled type="date" value-format="yyyy-MM-dd" style="width: 150px"></el-date-picker>
  1456. </el-form-item>
  1457. <el-form-item label="有效期数值/Valid Until Value">
  1458. <el-input :value="currentRow.validUntilValue || ''" disabled style="width: 150px"></el-input>
  1459. </el-form-item>
  1460. <el-form-item label="有效期单位/Valid Until Unit">
  1461. <el-input :value="currentRow.validUntil || ''" disabled style="width: 150px"></el-input>
  1462. </el-form-item>
  1463. <el-form-item label="失效日期/Expiry Date">
  1464. <el-date-picker :value="currentRow.expiryDate" disabled type="date" value-format="yyyy-MM-dd" style="width: 150px"></el-date-picker>
  1465. </el-form-item>
  1466. <el-form-item label="状态/Status">
  1467. <el-input :value="currentRow.rohsStatus || ''" disabled style="width: 150px"></el-input>
  1468. </el-form-item>
  1469. </el-form>
  1470. <el-form :inline="true" label-position="top" :model="currentRow">
  1471. <el-form-item label="是否符合RoHS/Meet RoHS Req">
  1472. <el-radio-group :value="currentRow.isMeetRohsRequirement" disabled style="width: 190px">
  1473. <el-radio label="Y"></el-radio>
  1474. <el-radio label="N"></el-radio>
  1475. </el-radio-group>
  1476. </el-form-item>
  1477. <el-form-item label=" ">
  1478. <el-checkbox
  1479. :value="currentRow.isAhGrade"
  1480. true-label="Y"
  1481. false-label="N"
  1482. disabled
  1483. style="width: 190px">材料属性是否是AH/Is AH Grade</el-checkbox>
  1484. </el-form-item>
  1485. <el-form-item label="HSF供应商等级/Supplier Class">
  1486. <el-radio-group :value="currentRow.hsfSupplierClassification" disabled style="width: 260px">
  1487. <el-radio label="高风险">高风险</el-radio>
  1488. <el-radio label="中风险">中风险</el-radio>
  1489. <el-radio label="低风险">低风险</el-radio>
  1490. </el-radio-group>
  1491. </el-form-item>
  1492. </el-form>
  1493. <el-form :inline="true" label-position="top" :model="currentRow">
  1494. <el-form-item label="Fiber报告信息/Fiber Information" style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.fiberInformation || ''" disabled resize="none" style="width: 804px;height: 30px"></el-input></el-form-item>
  1495. </el-form>
  1496. <el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 45px">
  1497. <el-form-item label="HSF审批人/HSF Approver"><el-input :value="currentRow.hsfApproverName || currentRow.hsfApprover || ''" disabled style="width: 396px"></el-input></el-form-item>
  1498. <el-form-item label="Inform Related people"><el-input :value="currentRow.relatedPeopleName || currentRow.relatedPeople || ''" disabled style="width: 396px"></el-input></el-form-item>
  1499. </el-form>
  1500. <el-form v-if="shouldShowHsfStandard(currentRow.endCustomer)" :inline="true" label-position="top" :model="currentRow" style="margin-top: 0px">
  1501. <el-form-item label="HSF标准/HSF Standard" style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.hsfStandard || ''" disabled resize="none" style="width: 804px;height: 30px"></el-input></el-form-item>
  1502. </el-form>
  1503. </div>
  1504. </el-tab-pane>
  1505. <el-tab-pane label="材料信息" name="materialInfo">
  1506. <div :style="{height: secondHeight + 'px'}" style="overflow-y: auto;">
  1507. <el-table
  1508. class="rohs-material-table"
  1509. border
  1510. :data="currentRow.materialList || []"
  1511. :height="secondHeight"
  1512. style="width: 100%">
  1513. <el-table-column type="index" label="序号" width="50" header-align="center" align="center"></el-table-column>
  1514. <el-table-column prop="finalPartNo" label="IFS物料编码/Final Part No." min-width="150" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  1515. <el-table-column prop="partDesc" label="描述/Part Desc." min-width="250" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  1516. <el-table-column prop="partStatus" label="状态/Part Status" min-width="100" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  1517. </el-table>
  1518. </div>
  1519. </el-tab-pane>
  1520. <el-tab-pane label="附件信息" name="attachment">
  1521. <oss-components
  1522. ref="bottomAttachmentOss"
  1523. :save-visible="authFileSave"
  1524. :edit-visible="authFileSave"
  1525. :download-visible="authFileDownLoad"
  1526. :remove-visible="authFileRemove"
  1527. :preview-visible="authFilePreview"
  1528. :disabled="currentRow.status === '已完成'"
  1529. :show-order-ref3-filter="true"
  1530. :order-ref3-filter-options="rohsAttachmentTypeOptionList"
  1531. :query-order-ref3-list="rohsAttachmentQueryOrderRef3List"
  1532. :order-ref3-filter-query-map="rohsAttachmentTypeFilterQueryMap"
  1533. :order-ref3-label-map="rohsAttachmentTypeLabelMap"
  1534. label="序列号"
  1535. :height="secondHeight - 25"
  1536. style="margin-top: 2px"
  1537. :columns="rohsAttachmentSummaryColumnList"
  1538. :order-ref1="currentRow.site"
  1539. :order-ref2="currentRow.referenceNo">
  1540. </oss-components>
  1541. </el-tab-pane>
  1542. <el-tab-pane label="审批信息" name="approvalInformation">
  1543. <approval-information v-model:data-list="approvalList" :height="secondHeight"></approval-information>
  1544. </el-tab-pane>
  1545. </el-tabs>
  1546. <ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
  1547. <filter-search :visible.sync="filterVisible" @search="queryByAnyField"></filter-search>
  1548. </div>
  1549. </template>
  1550. <script>
  1551. import * as api from '@/api/rohs/rohs'
  1552. import { checkSuperAdmin } from "@/api/changeManagement/changeManagement"
  1553. import { verifyData } from "@/api/chooselist/chooselist.js"
  1554. import { searchProjectInfoList } from "@/api/quotation/quotationInformation.js"
  1555. import { queryCustomer } from "@/api/customer/customerInformation"
  1556. import { queryProjectByCustomer } from "@/api/project/project"
  1557. import { createOfficialPartForRohs, getNextPartNo as getPartNextPartNo, getItemListByCodeNo as getPartItemListByCodeNo, getItemExclusionAlreadyExists as getPartItemExclusionAlreadyExists } from "@/api/part/partInformation.js"
  1558. import uploadFileList from '../common/uploadFileList'
  1559. import ossComponents from '../oss/ossComponents.vue'
  1560. import ChooseList from '@/views/modules/common/Chooselist'
  1561. import DictDataSelect from "../sys/dict-data-select.vue"
  1562. import ApprovalInformation from "../changeManagement/approvalInformation.vue"
  1563. import FilterSearch from "../../common/filterSearch.vue"
  1564. export default {
  1565. components: {
  1566. uploadFileList,
  1567. ossComponents,
  1568. ChooseList,
  1569. DictDataSelect,
  1570. ApprovalInformation,
  1571. FilterSearch
  1572. },
  1573. data () {
  1574. return {
  1575. searchData: {
  1576. site: this.$store.state.user.site,
  1577. referenceNo: '',
  1578. status: '',
  1579. rohsStatus: '',
  1580. currentApprover: '',
  1581. nodeId: ''
  1582. },
  1583. exportLoading: false,
  1584. exportData: [],
  1585. exportFieldMap: {},
  1586. exportName: '',
  1587. exportHeader: ['RoHs记录'],
  1588. exportFooter: [],
  1589. resultList: [],
  1590. dataList: [],
  1591. pageIndex: 1,
  1592. pageSize: 20,
  1593. totalPage: 0,
  1594. dataListLoading: false,
  1595. activeTable: 'basicInfo',
  1596. menuId: '112001',
  1597. authSearch: false,
  1598. authUpdate: false,
  1599. authIssue: false,
  1600. authSubmit: false,
  1601. authReject: false,
  1602. authFileSave: false,
  1603. authFileDownLoad: false,
  1604. authFileRemove: false,
  1605. authFilePreview: false,
  1606. authDataEntry: false,
  1607. authDelete: false,
  1608. superAdmin: false,
  1609. createBy2: this.$store.state.user.name,
  1610. height: 400,
  1611. secondHeight: 200,
  1612. currentRow: {},
  1613. fileColumnList: [
  1614. {
  1615. columnProp: 'fileName',
  1616. headerAlign: 'center',
  1617. align: 'center',
  1618. columnLabel: '文件名称',
  1619. columnHidden: false,
  1620. columnImage: false,
  1621. columnSortable: false,
  1622. status: true,
  1623. fixed: '',
  1624. columnWidth: 140
  1625. },
  1626. {
  1627. columnProp: 'fileRemark',
  1628. headerAlign: 'center',
  1629. align: 'center',
  1630. columnLabel: '备注',
  1631. columnHidden: false,
  1632. columnImage: false,
  1633. columnSortable: false,
  1634. status: true,
  1635. fixed: '',
  1636. columnWidth: 200
  1637. },
  1638. {
  1639. columnProp: 'createDate',
  1640. headerAlign: 'center',
  1641. align: 'center',
  1642. columnLabel: '上传时间',
  1643. columnHidden: false,
  1644. columnImage: false,
  1645. columnSortable: false,
  1646. status: true,
  1647. fixed: '',
  1648. columnWidth: 150
  1649. },
  1650. {
  1651. columnProp: 'createBy',
  1652. headerAlign: 'center',
  1653. align: 'center',
  1654. columnLabel: '上传人',
  1655. columnHidden: false,
  1656. columnImage: false,
  1657. columnSortable: false,
  1658. status: true,
  1659. fixed: '',
  1660. columnWidth: 120
  1661. }
  1662. ],
  1663. rohsAttachmentTypeOptionList: [
  1664. { value: 'rohsAttachmentTds', label: 'TDS' },
  1665. { value: 'rohsAttachmentMsds', label: 'MSDS' },
  1666. { value: 'rohsAttachmentTestReport', label: '测试报告' },
  1667. { value: 'rohsAttachmentOther', label: 'Other' }
  1668. ],
  1669. rohsAttachmentTypeLabelMap: {
  1670. rohsAttachmentTds: 'TDS',
  1671. rohsAttachmentMsds: 'MSDS',
  1672. rohsAttachmentTestReport: '测试报告',
  1673. rohsAttachmentOther: 'Other',
  1674. rohsAttachment: 'Other'
  1675. },
  1676. rohsAttachmentQueryOrderRef3List: [
  1677. 'rohsAttachmentTds',
  1678. 'rohsAttachmentMsds',
  1679. 'rohsAttachmentTestReport',
  1680. 'rohsAttachmentOther',
  1681. 'rohsAttachment'
  1682. ],
  1683. rohsAttachmentTypeFilterQueryMap: {
  1684. rohsAttachmentTds: ['rohsAttachmentTds'],
  1685. rohsAttachmentMsds: ['rohsAttachmentMsds'],
  1686. rohsAttachmentTestReport: ['rohsAttachmentTestReport'],
  1687. rohsAttachmentOther: ['rohsAttachmentOther', 'rohsAttachment']
  1688. },
  1689. rohsAttachmentSummaryColumnList: [
  1690. {
  1691. columnProp: 'orderRef3Label',
  1692. headerAlign: 'center',
  1693. align: 'center',
  1694. columnLabel: '类型',
  1695. columnHidden: false,
  1696. columnImage: false,
  1697. columnSortable: false,
  1698. status: true,
  1699. fixed: '',
  1700. columnWidth: 120
  1701. },
  1702. {
  1703. columnProp: 'fileName',
  1704. headerAlign: 'center',
  1705. align: 'center',
  1706. columnLabel: '文件名称',
  1707. columnHidden: false,
  1708. columnImage: false,
  1709. columnSortable: false,
  1710. status: true,
  1711. fixed: '',
  1712. columnWidth: 160
  1713. },
  1714. {
  1715. columnProp: 'fileRemark',
  1716. headerAlign: 'center',
  1717. align: 'center',
  1718. columnLabel: '备注',
  1719. columnHidden: false,
  1720. columnImage: false,
  1721. columnSortable: false,
  1722. status: true,
  1723. fixed: '',
  1724. columnWidth: 220
  1725. },
  1726. {
  1727. columnProp: 'createDate',
  1728. headerAlign: 'center',
  1729. align: 'center',
  1730. columnLabel: '上传时间',
  1731. columnHidden: false,
  1732. columnImage: false,
  1733. columnSortable: false,
  1734. status: true,
  1735. fixed: '',
  1736. columnWidth: 160
  1737. },
  1738. {
  1739. columnProp: 'createBy',
  1740. headerAlign: 'center',
  1741. align: 'center',
  1742. columnLabel: '上传人',
  1743. columnHidden: false,
  1744. columnImage: false,
  1745. columnSortable: false,
  1746. status: true,
  1747. fixed: '',
  1748. columnWidth: 120
  1749. }
  1750. ],
  1751. tdsFileColumnList: [
  1752. {
  1753. columnProp: 'fileNo',
  1754. headerAlign: 'center',
  1755. align: 'center',
  1756. columnLabel: '文件编码',
  1757. columnHidden: false,
  1758. columnImage: false,
  1759. columnSortable: false,
  1760. status: true,
  1761. fixed: '',
  1762. columnWidth: 130
  1763. },
  1764. {
  1765. columnProp: 'rev',
  1766. headerAlign: 'center',
  1767. align: 'center',
  1768. columnLabel: '版本号',
  1769. columnHidden: false,
  1770. columnImage: false,
  1771. columnSortable: false,
  1772. status: true,
  1773. fixed: '',
  1774. columnWidth: 90
  1775. },
  1776. {
  1777. columnProp: 'fileName',
  1778. headerAlign: 'center',
  1779. align: 'center',
  1780. columnLabel: '文件名称',
  1781. columnHidden: false,
  1782. columnImage: false,
  1783. columnSortable: false,
  1784. status: true,
  1785. fixed: '',
  1786. columnWidth: 160
  1787. },
  1788. {
  1789. columnProp: 'fileRemark',
  1790. headerAlign: 'center',
  1791. align: 'center',
  1792. columnLabel: '备注',
  1793. columnHidden: false,
  1794. columnImage: false,
  1795. columnSortable: false,
  1796. status: true,
  1797. fixed: '',
  1798. columnWidth: 180
  1799. },
  1800. {
  1801. columnProp: 'createDate',
  1802. headerAlign: 'center',
  1803. align: 'center',
  1804. columnLabel: '上传时间',
  1805. columnHidden: false,
  1806. columnImage: false,
  1807. columnSortable: false,
  1808. status: true,
  1809. fixed: '',
  1810. columnWidth: 150
  1811. },
  1812. {
  1813. columnProp: 'invalidationTime',
  1814. headerAlign: 'center',
  1815. align: 'center',
  1816. columnLabel: '失效时间',
  1817. columnHidden: false,
  1818. columnImage: false,
  1819. columnSortable: false,
  1820. status: true,
  1821. fixed: '',
  1822. columnWidth: 150
  1823. },
  1824. {
  1825. columnProp: 'createBy',
  1826. headerAlign: 'center',
  1827. align: 'center',
  1828. columnLabel: '上传人',
  1829. columnHidden: false,
  1830. columnImage: false,
  1831. columnSortable: false,
  1832. status: true,
  1833. fixed: '',
  1834. columnWidth: 120
  1835. }
  1836. ],
  1837. modalFlag: false,
  1838. chooseProjectListFlag: false,
  1839. projectMaterialDialogFlag: false,
  1840. rohsCreatePartDialogFlag: false,
  1841. rohsCreatePartLoading: false,
  1842. rohsCreatePartTab: 'General',
  1843. rohsCreatePartTagNo: 0,
  1844. rohsCharacteristicDialogFlag: false,
  1845. rohsCharacteristicQueryData: {
  1846. propertiesItemNo: '',
  1847. itemDesc: ''
  1848. },
  1849. rohsCharacteristicList: [],
  1850. rohsCharacteristicSelections: [],
  1851. rohsPartItemSelections: [],
  1852. rohsCreatePartColumnItemList: [
  1853. {
  1854. columnProp: 'propertiesItemNo',
  1855. headerAlign: 'center',
  1856. align: 'left',
  1857. columnLabel: '属性编码',
  1858. columnHidden: false,
  1859. columnImage: false,
  1860. status: true,
  1861. fixed: '',
  1862. columnWidth: 100
  1863. },
  1864. {
  1865. columnProp: 'itemDesc',
  1866. headerAlign: 'center',
  1867. align: 'left',
  1868. columnLabel: '属性名称',
  1869. columnHidden: false,
  1870. columnImage: false,
  1871. status: true,
  1872. fixed: '',
  1873. columnWidth: 150
  1874. },
  1875. {
  1876. columnProp: 'valueType',
  1877. headerAlign: 'center',
  1878. align: 'center',
  1879. columnLabel: '属性类型',
  1880. columnHidden: false,
  1881. columnImage: false,
  1882. status: true,
  1883. fixed: '',
  1884. columnWidth: 60
  1885. },
  1886. {
  1887. columnProp: 'textValue',
  1888. headerAlign: 'center',
  1889. align: 'left',
  1890. columnLabel: '属性值',
  1891. columnHidden: false,
  1892. columnImage: false,
  1893. status: true,
  1894. fixed: '',
  1895. columnWidth: 140
  1896. }
  1897. ],
  1898. rohsCharacteristicColumnList: [
  1899. {
  1900. columnProp: 'propertiesItemNo',
  1901. headerAlign: 'center',
  1902. align: 'left',
  1903. columnLabel: '属性编码',
  1904. columnHidden: false,
  1905. columnImage: false,
  1906. status: true,
  1907. fixed: '',
  1908. columnWidth: 100
  1909. },
  1910. {
  1911. columnProp: 'itemDesc',
  1912. headerAlign: 'center',
  1913. align: 'left',
  1914. columnLabel: '属性名称',
  1915. columnHidden: false,
  1916. columnImage: false,
  1917. status: true,
  1918. fixed: '',
  1919. columnWidth: 200
  1920. },
  1921. {
  1922. columnProp: 'valueType',
  1923. headerAlign: 'center',
  1924. align: 'center',
  1925. columnLabel: '属性类型',
  1926. columnHidden: false,
  1927. columnImage: false,
  1928. status: true,
  1929. fixed: '',
  1930. columnWidth: 60
  1931. }
  1932. ],
  1933. rohsCreatePartData: {
  1934. site: '',
  1935. partNo: '',
  1936. partDesc: '',
  1937. partType: 'Purchased',
  1938. hazardCode: '',
  1939. hazardDesc: '',
  1940. familyId: '',
  1941. familyName: '',
  1942. groupId: '',
  1943. groupName: '',
  1944. umId: '',
  1945. umName: '',
  1946. weightNet: '',
  1947. uomForWeightNet: 'kg',
  1948. volumeNet: '',
  1949. uomForVolumeNet: 'm3',
  1950. lotTrackingCode: 'Order Based',
  1951. remark: '',
  1952. productGroupId1: '',
  1953. productGroupName1: '',
  1954. productGroupId2: '',
  1955. productGroupName2: '',
  1956. productGroupId3: '',
  1957. productGroupName3: '',
  1958. productGroupId4: '*',
  1959. productGroupName4: 'NorthSky Application owner',
  1960. commGroup3: '',
  1961. commGroup3Desc: '',
  1962. codeNo: '',
  1963. codeDesc: '',
  1964. typeDesignation: '',
  1965. assetClass: 'S',
  1966. assetClassDesc: '标准',
  1967. dimQuality: '',
  1968. abcClass: 'C',
  1969. abcClassDesc: '',
  1970. frequencyClass: 'Very Slow Mover',
  1971. lifecycleStage: 'Development',
  1972. countryOfOrigin: '',
  1973. countryOfOriginDesc: '',
  1974. regionOfOrigin: '',
  1975. regionOfOriginDesc: '',
  1976. manufacturingLeadTime: 0,
  1977. expectedLeadTime: 0,
  1978. durabilityWeek: '',
  1979. durabilityDay: '',
  1980. intrastatConvFactor: undefined,
  1981. customsStatNo: '',
  1982. customsStatDesc: '',
  1983. umDesc: '',
  1984. planningMethod: 'A',
  1985. planningMethodDesc: '',
  1986. partStatus: 'A',
  1987. partStatusDesc: '活动',
  1988. active: 'Y',
  1989. status: 'Y',
  1990. supplyCode: 'Inventory Order',
  1991. configurationId: '*',
  1992. partCostGroupId: '',
  1993. partCostGroupDesc: '',
  1994. inventoryValuationMethod: 'Standard Cost',
  1995. inventoryPartCostLevel: 'Cost Per Part',
  1996. invoiceConsideration: 'Ignore Invoice Price',
  1997. zeroCostFlag: 'Zero Cost Forbidden',
  1998. estimatedMaterialCost: 0,
  1999. safetyStock: 0,
  2000. minOrderQty: 0,
  2001. maxOrderQty: 0,
  2002. mulOrderQty: 0,
  2003. safetyLeadTime: 0,
  2004. shrinkageFac: 0,
  2005. stdOrderQty: 0,
  2006. cumLeadTime: 0,
  2007. byProdAsSupplyInMrpDb: '',
  2008. unprotectedLeadTime: 0,
  2009. backFlushPart: 'All Locations',
  2010. issueType: 'Reserve And Backflush',
  2011. mrpControlFlagDb: 'Y',
  2012. fixedLeadTimeDay: 0,
  2013. overReporting: 'Allowed',
  2014. useTheoreticalDensityDb: '',
  2015. variableLeadTimeDay: 0,
  2016. overReportTolerance: 0,
  2017. fixedLeadTimeHour: 0,
  2018. density: undefined,
  2019. variableLeadTimeHour: 0,
  2020. showInQueryFlag: 'Y',
  2021. temporaryPartFlag: 'N',
  2022. partItemList: []
  2023. },
  2024. searchProjectData: {
  2025. site: '',
  2026. projectId: undefined,
  2027. projectName: undefined,
  2028. customerId: undefined,
  2029. },
  2030. projectMaterialSearchData: {
  2031. finalPartNo: '',
  2032. partDesc: '',
  2033. partStatus: ''
  2034. },
  2035. projectMaterialList: [],
  2036. projectMaterialSelections: [],
  2037. dataListSelections: [],
  2038. materialSelections: [],
  2039. projectMaterialPageIndex: 1,
  2040. projectMaterialPageSize: 20,
  2041. projectMaterialTotal: 0,
  2042. projectMaterialLoading: false,
  2043. nodeOptions: [],
  2044. projectList: [],
  2045. hsfApproverOptionList: [],
  2046. hsfApproverDisplayList: [],
  2047. hsfApproverSelectionCache: [],
  2048. hsfApproverFlag: false,
  2049. hsfApproverSearchData: {
  2050. operatorId: '',
  2051. operatorName: ''
  2052. },
  2053. relatedPeopleOptionList: [],
  2054. relatedPeopleDisplayList: [],
  2055. relatedPeopleSelection: null,
  2056. relatedPeopleFlag: false,
  2057. relatedPeopleSearchData: {
  2058. operatorId: '',
  2059. operatorName: ''
  2060. },
  2061. filterVisible: false,
  2062. isFilterSearch: false,
  2063. filterSearchData: {},
  2064. approvalList: [],
  2065. plmRohsAuthorityArr: [],
  2066. nodeAuthorityLoaded: false,
  2067. isEditMode: false,
  2068. modalTitle: 'RoHS 新增',
  2069. activeName: 'basicInfo',
  2070. showModalFlag: false,
  2071. submitModalFlag: false,
  2072. rohsRemarkFlag: false,
  2073. rejectOpinion: '',
  2074. submitLoading: false,
  2075. rohsRemarkForm: {
  2076. remark: ''
  2077. },
  2078. hsfStandardDefaultText: 'With the follow environmental specification: Macallan regulated Substances specification(069-0135) /Macallan sustainable fiber specification(099-00532)',
  2079. modalData: {
  2080. site: 'DEFAULT',
  2081. referenceNo: '',
  2082. applicant: '',
  2083. pm: '',
  2084. pmName: '',
  2085. applicationDate: '',
  2086. process: '',
  2087. plannedMassProductionDate: '',
  2088. color: '',
  2089. vendorCode: '',
  2090. vendorMaterialCode: '',
  2091. materialClassify: '',
  2092. otherMaterialClassify: '',
  2093. materialUseFor: '',
  2094. endCustomer: '',
  2095. projectId: '',
  2096. commGroup1: '',
  2097. commGroup1Desc: '',
  2098. commGroup2: '',
  2099. commGroup2Desc: '',
  2100. commGroup3: '',
  2101. commGroup3Desc: '',
  2102. needCreateNumber: '',
  2103. npdEngineer: '',
  2104. materialValidityTime: '',
  2105. materialValidityComments: '',
  2106. needDeviation: '',
  2107. technicalPlan: '',
  2108. wmRequiredSpec: '',
  2109. isFiberMaterial: '',
  2110. materialThickness: '',
  2111. buyer: '',
  2112. expectReportTime: '',
  2113. qualificationDocumentsNeeded: '',
  2114. qualificationDocumentsNeededList: [],
  2115. testReportIncludingItems: '',
  2116. testReportIncludingItemsList: [],
  2117. remark: '',
  2118. status: '',
  2119. sgsReportNumber: '',
  2120. rohsStatus: 'Active',
  2121. expiredDate: '',
  2122. expiryDate: '',
  2123. fiberInformation: '',
  2124. hsfStandard: '',
  2125. hsfApprover: '',
  2126. hsfApproverName: '',
  2127. hsfApproverCodeList: [],
  2128. relatedPeople: '',
  2129. relatedPeopleName: '',
  2130. buNo: '',
  2131. validUntilValue: 0,
  2132. validUntil: '',
  2133. isMeetRohsRequirement: '',
  2134. isAhGrade: 'N',
  2135. hsfSupplierClassification: '',
  2136. materialDesc: '',
  2137. npdRemark: '',
  2138. isSameMaterialDiffSize: '',
  2139. ifsPartNo: '',
  2140. materialList: [],
  2141. stepId: null,
  2142. rejectFlag: '',
  2143. rejectStepId: null,
  2144. createBy2: '',
  2145. isReject: 'Y',
  2146. tpProcessControl: 'N',
  2147. csProcessControl: 'N'
  2148. }
  2149. }
  2150. },
  2151. created () {
  2152. this.menuId = (this.$route.meta && this.$route.meta.menuId) || this.menuId || '112001'
  2153. this.getButtonAuthData()
  2154. this.checkSuperAdmin()
  2155. },
  2156. mounted () {
  2157. this.fetchNodeOptions()
  2158. if (this.authSearch) {
  2159. this.getDataList()
  2160. }
  2161. this.$nextTick(() => {
  2162. this.height = window.innerHeight / 2 - 30
  2163. /*第二个表格高度的动态调整*/
  2164. this.secondHeight = window.innerHeight / 2 - 186
  2165. })
  2166. },
  2167. watch: {
  2168. activeName (val) {
  2169. if (val === 'attachmentInfo' || val === 'npdInfo') {
  2170. this.$nextTick(() => {
  2171. if (val === 'attachmentInfo') {
  2172. this.refreshOssRef('modalAttachmentTdsOss')
  2173. this.refreshOssRef('modalAttachmentMsdsOss')
  2174. this.refreshOssRef('modalAttachmentTestReportOss')
  2175. this.refreshOssRef('modalAttachmentOtherOss')
  2176. }
  2177. if (val === 'npdInfo') {
  2178. this.refreshOssRef('modalTdsOss')
  2179. }
  2180. })
  2181. }
  2182. },
  2183. 'modalData.expiredDate' () {
  2184. this.syncExpiryDateByRule()
  2185. },
  2186. 'modalData.validUntilValue' () {
  2187. this.syncExpiryDateByRule()
  2188. },
  2189. 'modalData.validUntil' () {
  2190. this.syncExpiryDateByRule()
  2191. },
  2192. 'modalData.endCustomer' () {
  2193. this.applyHsfStandardDefaultByCustomer(this.modalData)
  2194. }
  2195. },
  2196. methods: {
  2197. fetchNodeOptions () {
  2198. if (!this.searchData.site || !this.menuId) {
  2199. this.nodeOptions = []
  2200. return
  2201. }
  2202. let params = {
  2203. site: this.searchData.site,
  2204. menuId: this.menuId
  2205. }
  2206. api.getNodeList(params).then(({data}) => {
  2207. if (data && data.code === 0 && Array.isArray(data.rows)) {
  2208. this.nodeOptions = data.rows
  2209. .filter(item => item && item.nodeId)
  2210. .map(item => ({
  2211. id: item.nodeId,
  2212. name: item.nodeName
  2213. }))
  2214. } else {
  2215. this.nodeOptions = []
  2216. }
  2217. }).catch(() => {
  2218. this.nodeOptions = []
  2219. })
  2220. },
  2221. loadNodeAuthority (site, stepId) {
  2222. if (!site || stepId === null || stepId === undefined || !this.menuId) {
  2223. this.plmRohsAuthorityArr = []
  2224. this.nodeAuthorityLoaded = true
  2225. return Promise.resolve()
  2226. }
  2227. this.nodeAuthorityLoaded = false
  2228. let params = {
  2229. site: site,
  2230. stepId: stepId,
  2231. menuId: this.menuId
  2232. }
  2233. return api.getRohsNodeAuthority(params).then(({data}) => {
  2234. if (data && data.code === 0 && data.rows) {
  2235. this.plmRohsAuthorityArr = data.rows.plm_rohs || []
  2236. } else {
  2237. this.plmRohsAuthorityArr = []
  2238. }
  2239. this.nodeAuthorityLoaded = true
  2240. }).catch(() => {
  2241. this.plmRohsAuthorityArr = []
  2242. this.nodeAuthorityLoaded = true
  2243. })
  2244. },
  2245. rohsFieldFlag (fieldId) {
  2246. if (!this.plmRohsAuthorityArr || this.plmRohsAuthorityArr.length === 0) {
  2247. return 'N'
  2248. }
  2249. let target = this.plmRohsAuthorityArr.find(item => item.fieldId === fieldId)
  2250. return target ? target.updateFlag : 'N'
  2251. },
  2252. isRohsFieldDisabled (fieldId) {
  2253. if (this.showModalFlag) {
  2254. return true
  2255. }
  2256. if (!this.isEditMode) {
  2257. return false
  2258. }
  2259. return this.rohsFieldFlag(fieldId) === 'N'
  2260. },
  2261. isProcessFieldDisabled () {
  2262. if (this.isEditMode) {
  2263. return true
  2264. }
  2265. return this.isRohsFieldDisabled('process')
  2266. },
  2267. handleProcessChange (value) {
  2268. const processValue = String(value || '').trim()
  2269. this.$set(this.modalData, 'process', processValue)
  2270. this.$set(this.modalData, 'buNo', processValue)
  2271. if (this.isEditMode) {
  2272. return
  2273. }
  2274. this.clearHsfApproverFields(false)
  2275. if (!processValue) {
  2276. return
  2277. }
  2278. this.loadHsfApproverByCurrentProcess(true)
  2279. },
  2280. isRohsFieldDisabledWithFallback (primaryFieldId, fallbackFieldId) {
  2281. if (this.showModalFlag) {
  2282. return true
  2283. }
  2284. if (!this.isEditMode) {
  2285. return false
  2286. }
  2287. const primaryDisabled = this.rohsFieldFlag(primaryFieldId) === 'N'
  2288. if (!primaryDisabled) {
  2289. return false
  2290. }
  2291. return this.rohsFieldFlag(fallbackFieldId) === 'N'
  2292. },
  2293. isValidUntilValueDisabled () {
  2294. return this.isRohsFieldDisabledWithFallback('validUntilValue', 'validUntil')
  2295. },
  2296. isValidUntilUnitDisabled () {
  2297. return this.isRohsFieldDisabledWithFallback('validUntil', 'validUntilValue')
  2298. },
  2299. canEditRohsMaterial () {
  2300. return !this.showModalFlag
  2301. },
  2302. normalizeDateOnly (value) {
  2303. if (value === null || value === undefined || value === '') {
  2304. return ''
  2305. }
  2306. if (value instanceof Date && !Number.isNaN(value.getTime())) {
  2307. const year = value.getFullYear()
  2308. const month = String(value.getMonth() + 1).padStart(2, '0')
  2309. const day = String(value.getDate()).padStart(2, '0')
  2310. return year + '-' + month + '-' + day
  2311. }
  2312. const text = String(value).trim()
  2313. if (!text) {
  2314. return ''
  2315. }
  2316. if (text.includes('T')) {
  2317. return text.split('T')[0]
  2318. }
  2319. return text.length >= 10 ? text.substring(0, 10) : text
  2320. },
  2321. parseDateOnly (value) {
  2322. const text = this.normalizeDateOnly(value)
  2323. if (!text) {
  2324. return null
  2325. }
  2326. const parts = text.split('-')
  2327. if (parts.length !== 3) {
  2328. return null
  2329. }
  2330. const year = Number.parseInt(parts[0], 10)
  2331. const month = Number.parseInt(parts[1], 10)
  2332. const day = Number.parseInt(parts[2], 10)
  2333. if (Number.isNaN(year) || Number.isNaN(month) || Number.isNaN(day)) {
  2334. return null
  2335. }
  2336. const date = new Date(year, month - 1, day)
  2337. if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {
  2338. return null
  2339. }
  2340. return date
  2341. },
  2342. normalizeValidUntilUnitType (unitValue) {
  2343. const text = String(unitValue || '').trim().toLowerCase()
  2344. if (!text) {
  2345. return ''
  2346. }
  2347. if (text === 'd' || text === 'day' || text === 'days' || text.includes('日')) {
  2348. return 'day'
  2349. }
  2350. if (text === 'w' || text === 'week' || text === 'weeks' || text.includes('周')) {
  2351. return 'week'
  2352. }
  2353. if (text === 'm' || text === 'month' || text === 'months' || text.includes('月')) {
  2354. return 'month'
  2355. }
  2356. if (text === 'y' || text === 'year' || text === 'years' || text.includes('年')) {
  2357. return 'year'
  2358. }
  2359. return ''
  2360. },
  2361. addMonthsKeepDay (baseDate, monthDelta) {
  2362. const year = baseDate.getFullYear()
  2363. const month = baseDate.getMonth()
  2364. const day = baseDate.getDate()
  2365. const targetFirstDay = new Date(year, month + monthDelta, 1)
  2366. const targetYear = targetFirstDay.getFullYear()
  2367. const targetMonth = targetFirstDay.getMonth()
  2368. const lastDay = new Date(targetYear, targetMonth + 1, 0).getDate()
  2369. return new Date(targetYear, targetMonth, Math.min(day, lastDay))
  2370. },
  2371. addYearsKeepDay (baseDate, yearDelta) {
  2372. const targetYear = baseDate.getFullYear() + yearDelta
  2373. const month = baseDate.getMonth()
  2374. const day = baseDate.getDate()
  2375. const lastDay = new Date(targetYear, month + 1, 0).getDate()
  2376. return new Date(targetYear, month, Math.min(day, lastDay))
  2377. },
  2378. calculateExpiryDateByRule (reportDate, validUntilValue, validUntilUnit) {
  2379. const baseDate = this.parseDateOnly(reportDate)
  2380. const durationValue = this.normalizeValidUntilValue(validUntilValue)
  2381. const unitType = this.normalizeValidUntilUnitType(validUntilUnit)
  2382. if (!baseDate || !durationValue || !unitType) {
  2383. return ''
  2384. }
  2385. let resultDate = new Date(baseDate.getTime())
  2386. if (unitType === 'day') {
  2387. resultDate.setDate(resultDate.getDate() + durationValue)
  2388. } else if (unitType === 'week') {
  2389. resultDate.setDate(resultDate.getDate() + durationValue * 7)
  2390. } else if (unitType === 'month') {
  2391. resultDate = this.addMonthsKeepDay(baseDate, durationValue)
  2392. } else if (unitType === 'year') {
  2393. resultDate = this.addYearsKeepDay(baseDate, durationValue)
  2394. } else {
  2395. return ''
  2396. }
  2397. return this.normalizeDateOnly(resultDate)
  2398. },
  2399. syncExpiryDateByRule () {
  2400. if (!this.modalData) {
  2401. return ''
  2402. }
  2403. const expiryDate = this.calculateExpiryDateByRule(this.modalData.expiredDate, this.modalData.validUntilValue, this.modalData.validUntil)
  2404. this.$set(this.modalData, 'expiryDate', expiryDate)
  2405. return expiryDate
  2406. },
  2407. getCurrentDateString () {
  2408. return this.normalizeDateOnly(new Date())
  2409. },
  2410. normalizeCheckboxFlag (value) {
  2411. return String(value || '').trim().toUpperCase() === 'Y' ? 'Y' : 'N'
  2412. },
  2413. normalizeValidUntilValue (value) {
  2414. if (value === null || value === undefined || value === '') {
  2415. return null
  2416. }
  2417. const parsed = Number.parseInt(value, 10)
  2418. if (Number.isNaN(parsed) || parsed <= 0) {
  2419. return null
  2420. }
  2421. return parsed
  2422. },
  2423. getValidUntilDisplay (value, unit) {
  2424. const normalizedValue = this.normalizeValidUntilValue(value)
  2425. const normalizedUnit = String(unit || '').trim()
  2426. if (normalizedValue && normalizedUnit) {
  2427. return normalizedValue + normalizedUnit
  2428. }
  2429. if (normalizedValue) {
  2430. return String(normalizedValue)
  2431. }
  2432. return normalizedUnit
  2433. },
  2434. getRohsSubmitFieldValue (fieldId) {
  2435. const fieldMapping = {
  2436. materialClassify: 'materialClassifyList',
  2437. qualificationDocumentsNeeded: 'qualificationDocumentsNeededList',
  2438. testReportIncludingItems: 'testReportIncludingItemsList',
  2439. hsfApprover: 'hsfApproverCodeList'
  2440. }
  2441. const mappedField = fieldMapping[fieldId]
  2442. if (mappedField) {
  2443. return this.modalData[mappedField]
  2444. }
  2445. return this.modalData[fieldId]
  2446. },
  2447. isSubmitFieldEmpty (value) {
  2448. if (Array.isArray(value)) {
  2449. return value.length === 0
  2450. }
  2451. if (typeof value === 'string') {
  2452. return value.trim() === ''
  2453. }
  2454. return !value
  2455. },
  2456. validateSubmitRequiredFields () {
  2457. if (this.plmRohsAuthorityArr && this.plmRohsAuthorityArr.length > 0) {
  2458. let validUntilPairRequiredChecked = false
  2459. for (let i = 0; i < this.plmRohsAuthorityArr.length; i++) {
  2460. const fieldConfig = this.plmRohsAuthorityArr[i]
  2461. if (fieldConfig.required !== 'Y') {
  2462. continue
  2463. }
  2464. if (fieldConfig.fieldId === 'hsfStandard' && !this.shouldShowHsfStandard(this.modalData.endCustomer)) {
  2465. continue
  2466. }
  2467. if (fieldConfig.fieldId === 'validUntil' || fieldConfig.fieldId === 'validUntilValue') {
  2468. if (validUntilPairRequiredChecked) {
  2469. continue
  2470. }
  2471. const validUntilValue = this.normalizeValidUntilValue(this.modalData.validUntilValue)
  2472. this.$set(this.modalData, 'validUntilValue', validUntilValue)
  2473. if (this.isSubmitFieldEmpty(validUntilValue) || this.isSubmitFieldEmpty(this.modalData.validUntil)) {
  2474. this.$message.warning('有效期数值/单位不能为空!')
  2475. return false
  2476. }
  2477. validUntilPairRequiredChecked = true
  2478. continue
  2479. }
  2480. const value = this.getRohsSubmitFieldValue(fieldConfig.fieldId)
  2481. if (this.isSubmitFieldEmpty(value)) {
  2482. this.$message.warning((fieldConfig.fieldName || fieldConfig.fieldId) + '不能为空!')
  2483. return false
  2484. }
  2485. }
  2486. }
  2487. return true
  2488. },
  2489. validateValidUntilPair () {
  2490. const validUntilValue = this.normalizeValidUntilValue(this.modalData.validUntilValue)
  2491. const validUntilUnit = String(this.modalData.validUntil || '').trim()
  2492. this.$set(this.modalData, 'validUntilValue', validUntilValue)
  2493. this.$set(this.modalData, 'validUntil', validUntilUnit)
  2494. if (!validUntilValue && !validUntilUnit) {
  2495. return true
  2496. }
  2497. if (!validUntilValue) {
  2498. this.$message.warning('请填写有效期数值')
  2499. return false
  2500. }
  2501. if (!validUntilUnit) {
  2502. this.$message.warning('请选择有效期单位')
  2503. return false
  2504. }
  2505. return true
  2506. },
  2507. materialDialogHeaderCellStyle () {
  2508. return {
  2509. whiteSpace: 'nowrap',
  2510. wordBreak: 'keep-all'
  2511. }
  2512. },
  2513. displayYesNo (value) {
  2514. if (value === 'Y') {
  2515. return '是'
  2516. }
  2517. if (value === 'N') {
  2518. return '否'
  2519. }
  2520. return value || ''
  2521. },
  2522. getMultipleSelectTitle (value) {
  2523. if (!Array.isArray(value)) {
  2524. return ''
  2525. }
  2526. return value
  2527. .filter(item => item !== null && item !== undefined && String(item).trim() !== '')
  2528. .map(item => String(item).trim())
  2529. .join(';')
  2530. },
  2531. shouldShowHsfStandard (customerCode) {
  2532. return String(customerCode || '').trim().toUpperCase() === 'C00052'
  2533. },
  2534. applyHsfStandardDefaultByCustomer (formData) {
  2535. if (!formData || !this.shouldShowHsfStandard(formData.endCustomer)) {
  2536. return
  2537. }
  2538. const currentValue = String(formData.hsfStandard || '').trim()
  2539. if (!currentValue) {
  2540. this.$set(formData, 'hsfStandard', this.hsfStandardDefaultText)
  2541. }
  2542. },
  2543. normalizeHsfStandardByCustomer (formData) {
  2544. if (!formData) {
  2545. return
  2546. }
  2547. if (!this.shouldShowHsfStandard(formData.endCustomer)) {
  2548. this.$set(formData, 'hsfStandard', '')
  2549. return
  2550. }
  2551. this.applyHsfStandardDefaultByCustomer(formData)
  2552. },
  2553. resolveOperatorNameById (operatorId) {
  2554. const normalizedId = String(operatorId || '').trim()
  2555. if (!normalizedId) {
  2556. return ''
  2557. }
  2558. const option = (this.hsfApproverOptionList || []).find(item => String(item.operatorId || '').trim() === normalizedId) ||
  2559. (this.relatedPeopleOptionList || []).find(item => String(item.operatorId || '').trim() === normalizedId)
  2560. return option ? String(option.operatorName || '').trim() : normalizedId
  2561. },
  2562. resolveOperatorIdByCodeOrName (operatorValue) {
  2563. const normalizedValue = String(operatorValue || '').trim()
  2564. if (!normalizedValue) {
  2565. return ''
  2566. }
  2567. const option = (this.hsfApproverOptionList || []).find(item => String(item.operatorId || '').trim() === normalizedValue) ||
  2568. (this.hsfApproverOptionList || []).find(item => String(item.operatorName || '').trim() === normalizedValue) ||
  2569. (this.relatedPeopleOptionList || []).find(item => String(item.operatorId || '').trim() === normalizedValue) ||
  2570. (this.relatedPeopleOptionList || []).find(item => String(item.operatorName || '').trim() === normalizedValue)
  2571. return option ? String(option.operatorId || '').trim() : normalizedValue
  2572. },
  2573. syncHsfApproverFields () {
  2574. const sourceList = Array.isArray(this.modalData.hsfApproverCodeList)
  2575. ? this.modalData.hsfApproverCodeList
  2576. : []
  2577. const uniqueCodeList = []
  2578. const seen = new Set()
  2579. sourceList.forEach(item => {
  2580. const value = this.resolveOperatorIdByCodeOrName(item)
  2581. if (!value || seen.has(value)) {
  2582. return
  2583. }
  2584. seen.add(value)
  2585. uniqueCodeList.push(value)
  2586. })
  2587. this.$set(this.modalData, 'hsfApproverCodeList', uniqueCodeList)
  2588. this.$set(this.modalData, 'hsfApprover', uniqueCodeList.join(';'))
  2589. this.$set(this.modalData, 'hsfApproverName', uniqueCodeList.map(item => this.resolveOperatorNameById(item)).join(';'))
  2590. this.buildRelatedPeopleOptions(uniqueCodeList)
  2591. const relatedPeopleCode = this.resolveOperatorIdByCodeOrName(this.modalData.relatedPeople)
  2592. if (relatedPeopleCode && !uniqueCodeList.includes(relatedPeopleCode)) {
  2593. this.$set(this.modalData, 'relatedPeople', '')
  2594. this.$set(this.modalData, 'relatedPeopleName', '')
  2595. return
  2596. }
  2597. if (relatedPeopleCode) {
  2598. this.$set(this.modalData, 'relatedPeople', relatedPeopleCode)
  2599. this.$set(this.modalData, 'relatedPeopleName', this.resolveOperatorNameById(relatedPeopleCode))
  2600. }
  2601. },
  2602. buildRelatedPeopleOptions (selectedOperatorIds) {
  2603. const normalizedIds = (Array.isArray(selectedOperatorIds) ? selectedOperatorIds : (this.modalData.hsfApproverCodeList || []))
  2604. .map(item => this.resolveOperatorIdByCodeOrName(item))
  2605. .filter(item => !!item)
  2606. const selectedSet = new Set(normalizedIds)
  2607. let optionList = (this.hsfApproverOptionList || [])
  2608. .filter(item => selectedSet.has(String(item.operatorId || '').trim()))
  2609. .map(item => ({
  2610. operatorId: item.operatorId,
  2611. operatorName: item.operatorName
  2612. }))
  2613. const existingIdSet = new Set(optionList.map(item => String(item.operatorId || '').trim()))
  2614. normalizedIds.forEach(operatorId => {
  2615. if (existingIdSet.has(operatorId)) {
  2616. return
  2617. }
  2618. optionList.push({
  2619. operatorId: operatorId,
  2620. operatorName: this.resolveOperatorNameById(operatorId)
  2621. })
  2622. existingIdSet.add(operatorId)
  2623. })
  2624. this.relatedPeopleOptionList = optionList
  2625. this.filterRelatedPeopleOptions()
  2626. const selectedRelatedPeopleCode = this.resolveOperatorIdByCodeOrName(this.modalData.relatedPeople)
  2627. const selectedRelatedPeopleRow = optionList.find(item => String(item.operatorId || '').trim() === selectedRelatedPeopleCode)
  2628. if (!selectedRelatedPeopleRow) {
  2629. this.$set(this.modalData, 'relatedPeople', '')
  2630. this.$set(this.modalData, 'relatedPeopleName', '')
  2631. } else {
  2632. this.$set(this.modalData, 'relatedPeople', selectedRelatedPeopleCode)
  2633. this.$set(this.modalData, 'relatedPeopleName', String(selectedRelatedPeopleRow.operatorName || '').trim())
  2634. }
  2635. },
  2636. normalizeHsfApproverOptionList (rows) {
  2637. if (!Array.isArray(rows)) {
  2638. return []
  2639. }
  2640. return rows
  2641. .map(item => {
  2642. const operatorId = String(item.operatorId || item.operator_id || item.username || item.userName || '').trim()
  2643. const operatorName = String(item.operatorName || item.operator_name || item.userDisplay || item.user_display || '').trim()
  2644. if (!operatorId || !operatorName) {
  2645. return null
  2646. }
  2647. return {
  2648. operatorId,
  2649. operatorName
  2650. }
  2651. })
  2652. .filter(item => !!item)
  2653. },
  2654. filterHsfApproverOptions () {
  2655. const operatorIdKeyword = String(this.hsfApproverSearchData.operatorId || '').trim().toUpperCase()
  2656. const operatorNameKeyword = String(this.hsfApproverSearchData.operatorName || '').trim().toUpperCase()
  2657. this.hsfApproverDisplayList = (this.hsfApproverOptionList || []).filter(item => {
  2658. const operatorId = String(item.operatorId || '').toUpperCase()
  2659. const operatorName = String(item.operatorName || '').toUpperCase()
  2660. const matchOperatorId = !operatorIdKeyword || operatorId.includes(operatorIdKeyword)
  2661. const matchOperatorName = !operatorNameKeyword || operatorName.includes(operatorNameKeyword)
  2662. return matchOperatorId && matchOperatorName
  2663. })
  2664. },
  2665. filterRelatedPeopleOptions () {
  2666. const operatorIdKeyword = String(this.relatedPeopleSearchData.operatorId || '').trim().toUpperCase()
  2667. const operatorNameKeyword = String(this.relatedPeopleSearchData.operatorName || '').trim().toUpperCase()
  2668. this.relatedPeopleDisplayList = (this.relatedPeopleOptionList || []).filter(item => {
  2669. const operatorId = String(item.operatorId || '').toUpperCase()
  2670. const operatorName = String(item.operatorName || '').toUpperCase()
  2671. const matchOperatorId = !operatorIdKeyword || operatorId.includes(operatorIdKeyword)
  2672. const matchOperatorName = !operatorNameKeyword || operatorName.includes(operatorNameKeyword)
  2673. return matchOperatorId && matchOperatorName
  2674. })
  2675. },
  2676. openHsfApproverChooseModal () {
  2677. if (this.isRohsFieldDisabled('hsfApprover')) {
  2678. return
  2679. }
  2680. if (!this.modalData || !String(this.modalData.process || '').trim()) {
  2681. this.$message.warning('请先选择工艺')
  2682. return
  2683. }
  2684. this.loadHsfApproverByCurrentProcess(false).then(() => {
  2685. if (!this.hsfApproverOptionList || this.hsfApproverOptionList.length === 0) {
  2686. this.$message.warning('未查询到可选HSF审批人')
  2687. return
  2688. }
  2689. this.hsfApproverFlag = true
  2690. })
  2691. },
  2692. openHsfApproverDialog () {
  2693. this.hsfApproverSearchData = {
  2694. operatorId: '',
  2695. operatorName: ''
  2696. }
  2697. this.filterHsfApproverOptions()
  2698. const selectedOperatorSet = new Set(
  2699. (this.modalData.hsfApproverCodeList || [])
  2700. .map(item => String(item || '').trim())
  2701. .filter(item => !!item)
  2702. )
  2703. const selectedRows = (this.hsfApproverOptionList || []).filter(item => selectedOperatorSet.has(String(item.operatorId || '').trim()))
  2704. this.hsfApproverSelectionCache = JSON.parse(JSON.stringify(selectedRows))
  2705. this.$nextTick(() => {
  2706. if (!this.$refs.hsfApproverTable) {
  2707. return
  2708. }
  2709. this.$refs.hsfApproverTable.clearSelection()
  2710. selectedRows.forEach(item => {
  2711. this.$refs.hsfApproverTable.toggleRowSelection(item, true)
  2712. })
  2713. })
  2714. },
  2715. closeHsfApproverDialog () {
  2716. this.hsfApproverSelectionCache = []
  2717. },
  2718. handleHsfApproverSelectionChange (rows) {
  2719. this.hsfApproverSelectionCache = rows || []
  2720. },
  2721. handleHsfApproverTableClick (row, column, event, tableRef) {
  2722. if (this.$refs[tableRef]) {
  2723. this.$refs[tableRef].toggleRowSelection(row)
  2724. }
  2725. },
  2726. saveHsfApproverChooseModal () {
  2727. const selectedCodes = (this.hsfApproverSelectionCache || [])
  2728. .map(item => String(item.operatorId || '').trim())
  2729. .filter(item => !!item)
  2730. this.$set(this.modalData, 'hsfApproverCodeList', selectedCodes)
  2731. this.syncHsfApproverFields()
  2732. this.hsfApproverFlag = false
  2733. },
  2734. clearHsfApproverSelection () {
  2735. this.$set(this.modalData, 'hsfApproverCodeList', [])
  2736. this.syncHsfApproverFields()
  2737. },
  2738. openRelatedPeopleChooseModal () {
  2739. if (this.isRohsFieldDisabled('relatedPeople')) {
  2740. return
  2741. }
  2742. if (!this.modalData || !Array.isArray(this.modalData.hsfApproverCodeList) || this.modalData.hsfApproverCodeList.length === 0) {
  2743. this.$message.warning('请先选择HSF审批人')
  2744. return
  2745. }
  2746. this.buildRelatedPeopleOptions(this.modalData.hsfApproverCodeList)
  2747. if (!this.relatedPeopleOptionList || this.relatedPeopleOptionList.length === 0) {
  2748. this.$message.warning('未查询到可选Inform Related people')
  2749. return
  2750. }
  2751. this.relatedPeopleFlag = true
  2752. },
  2753. openRelatedPeopleDialog () {
  2754. this.relatedPeopleSearchData = {
  2755. operatorId: '',
  2756. operatorName: ''
  2757. }
  2758. this.filterRelatedPeopleOptions()
  2759. const relatedPeopleCode = String(this.modalData.relatedPeople || '').trim()
  2760. const selectedRow = (this.relatedPeopleOptionList || []).find(item => String(item.operatorId || '').trim() === relatedPeopleCode) || null
  2761. this.relatedPeopleSelection = selectedRow
  2762. this.$nextTick(() => {
  2763. if (!this.$refs.relatedPeopleTable) {
  2764. return
  2765. }
  2766. this.$refs.relatedPeopleTable.setCurrentRow(selectedRow || null)
  2767. })
  2768. },
  2769. closeRelatedPeopleDialog () {
  2770. this.relatedPeopleSelection = null
  2771. },
  2772. handleRelatedPeopleCurrentChange (row) {
  2773. this.relatedPeopleSelection = row || null
  2774. },
  2775. handleRelatedPeopleTableClick (row) {
  2776. this.relatedPeopleSelection = row || null
  2777. if (this.$refs.relatedPeopleTable) {
  2778. this.$refs.relatedPeopleTable.setCurrentRow(row)
  2779. }
  2780. },
  2781. saveRelatedPeopleChooseModal () {
  2782. const selectedCode = this.relatedPeopleSelection ? String(this.relatedPeopleSelection.operatorId || '').trim() : ''
  2783. const selectedName = this.relatedPeopleSelection ? String(this.relatedPeopleSelection.operatorName || '').trim() : ''
  2784. this.$set(this.modalData, 'relatedPeople', selectedCode)
  2785. this.$set(this.modalData, 'relatedPeopleName', selectedName)
  2786. this.relatedPeopleFlag = false
  2787. },
  2788. clearRelatedPeopleSelection () {
  2789. this.$set(this.modalData, 'relatedPeople', '')
  2790. this.$set(this.modalData, 'relatedPeopleName', '')
  2791. this.relatedPeopleSelection = null
  2792. if (this.$refs.relatedPeopleTable) {
  2793. this.$refs.relatedPeopleTable.setCurrentRow(null)
  2794. }
  2795. },
  2796. clearHsfApproverFields (clearBuNo = false) {
  2797. if (clearBuNo) {
  2798. this.$set(this.modalData, 'buNo', '')
  2799. }
  2800. this.hsfApproverOptionList = []
  2801. this.hsfApproverDisplayList = []
  2802. this.hsfApproverSelectionCache = []
  2803. this.relatedPeopleOptionList = []
  2804. this.relatedPeopleDisplayList = []
  2805. this.relatedPeopleSelection = null
  2806. this.relatedPeopleFlag = false
  2807. this.hsfApproverSearchData = {
  2808. operatorId: '',
  2809. operatorName: ''
  2810. }
  2811. this.relatedPeopleSearchData = {
  2812. operatorId: '',
  2813. operatorName: ''
  2814. }
  2815. this.$set(this.modalData, 'hsfApproverCodeList', [])
  2816. this.$set(this.modalData, 'hsfApprover', '')
  2817. this.$set(this.modalData, 'hsfApproverName', '')
  2818. this.$set(this.modalData, 'relatedPeople', '')
  2819. this.$set(this.modalData, 'relatedPeopleName', '')
  2820. },
  2821. loadHsfApproverByCurrentProcess (forceSelectAll = false) {
  2822. if (!this.modalData || !this.modalData.site) {
  2823. this.hsfApproverOptionList = []
  2824. this.hsfApproverDisplayList = []
  2825. this.hsfApproverSelectionCache = []
  2826. if (forceSelectAll) {
  2827. this.clearHsfApproverFields(false)
  2828. }
  2829. return Promise.resolve()
  2830. }
  2831. const buNo = String(this.modalData.process || '').trim()
  2832. if (!buNo) {
  2833. if (forceSelectAll) {
  2834. this.$message.warning('请先选择工艺')
  2835. this.clearHsfApproverFields(false)
  2836. }
  2837. this.hsfApproverOptionList = []
  2838. this.hsfApproverDisplayList = []
  2839. this.hsfApproverSelectionCache = []
  2840. return Promise.resolve()
  2841. }
  2842. const params = {
  2843. site: this.modalData.site,
  2844. buNo: buNo,
  2845. roleNo: 'R015'
  2846. }
  2847. return api.searchBmUser(params).then(({data}) => {
  2848. if (data && data.code === 0 && Array.isArray(data.rows)) {
  2849. this.hsfApproverOptionList = this.normalizeHsfApproverOptionList(data.rows)
  2850. this.filterHsfApproverOptions()
  2851. this.hsfApproverSelectionCache = []
  2852. if (forceSelectAll) {
  2853. const defaultSelectedCodes = this.hsfApproverOptionList.map(item => item.operatorId).filter(item => item)
  2854. this.$set(this.modalData, 'hsfApproverCodeList', defaultSelectedCodes)
  2855. }
  2856. this.syncHsfApproverFields()
  2857. } else {
  2858. this.hsfApproverOptionList = []
  2859. this.hsfApproverDisplayList = []
  2860. this.hsfApproverSelectionCache = []
  2861. if (forceSelectAll) {
  2862. this.clearHsfApproverFields(false)
  2863. }
  2864. }
  2865. }).catch(() => {
  2866. this.hsfApproverOptionList = []
  2867. this.hsfApproverDisplayList = []
  2868. this.hsfApproverSelectionCache = []
  2869. if (forceSelectAll) {
  2870. this.clearHsfApproverFields(false)
  2871. }
  2872. })
  2873. },
  2874. isCurrentApprover () {
  2875. return this.superAdmin || (this.modalData.createBy2 && this.modalData.createBy2.split(';').includes(this.createBy2))
  2876. },
  2877. canSaveAction () {
  2878. return !this.showModalFlag && (this.modalData.status === '草稿' || (this.modalData.status === '审批中' && this.isCurrentApprover()))
  2879. },
  2880. canAgreeAction () {
  2881. return this.authSubmit && this.isCurrentApprover() && this.modalData.status === '审批中' && this.modalData.tpProcessControl !== 'Y' && this.modalData.csProcessControl !== 'Y'
  2882. },
  2883. canRejectAction () {
  2884. return this.authReject && this.isCurrentApprover() && this.modalData.status === '审批中' && this.modalData.isReject === 'Y'
  2885. },
  2886. hasPersistedRohsRecord () {
  2887. return !!(this.modalData && this.modalData.site && this.modalData.referenceNo && !String(this.modalData.referenceNo).startsWith('TEMP-'))
  2888. },
  2889. openRohsRemarkDialog () {
  2890. this.$set(this.rohsRemarkForm, 'remark', this.modalData.remark || '')
  2891. this.rohsRemarkFlag = true
  2892. },
  2893. refreshRohsRemark () {
  2894. if (!this.hasPersistedRohsRecord()) {
  2895. this.$set(this.rohsRemarkForm, 'remark', this.modalData.remark || '')
  2896. return
  2897. }
  2898. api.getRohsDetail(this.modalData.site, this.modalData.referenceNo).then(({data}) => {
  2899. if (data && data.code === 0 && data.data) {
  2900. this.$set(this.rohsRemarkForm, 'remark', data.data.remark || '')
  2901. } else {
  2902. this.$message.error((data && data.msg) || '刷新失败')
  2903. }
  2904. }).catch(() => {
  2905. this.$message.error('刷新失败')
  2906. })
  2907. },
  2908. saveRohsRemark () {
  2909. const remark = this.rohsRemarkForm.remark || ''
  2910. if (!this.hasPersistedRohsRecord()) {
  2911. this.$set(this.modalData, 'remark', remark)
  2912. this.rohsRemarkFlag = false
  2913. this.$message.success('暂存成功,保存单据后写入数据库')
  2914. return
  2915. }
  2916. const params = {
  2917. site: this.modalData.site,
  2918. referenceNo: this.modalData.referenceNo,
  2919. remark: remark
  2920. }
  2921. api.updateRohsRemark(params).then(({data}) => {
  2922. if (data && data.code === 0) {
  2923. this.$set(this.modalData, 'remark', remark)
  2924. if (this.currentRow && this.currentRow.site === this.modalData.site && this.currentRow.referenceNo === this.modalData.referenceNo) {
  2925. this.$set(this.currentRow, 'remark', remark)
  2926. }
  2927. const target = (this.dataList || []).find(item => item.site === this.modalData.site && item.referenceNo === this.modalData.referenceNo)
  2928. if (target) {
  2929. this.$set(target, 'remark', remark)
  2930. }
  2931. this.rohsRemarkFlag = false
  2932. this.$message.success('操作成功')
  2933. } else {
  2934. this.$message.error((data && data.msg) || '保存失败')
  2935. }
  2936. }).catch(() => {
  2937. this.$message.error('保存失败')
  2938. })
  2939. },
  2940. loadModalButtonCondition () {
  2941. if (!this.modalData.site || !this.modalData.referenceNo || this.modalData.status !== '审批中') {
  2942. this.$set(this.modalData, 'createBy2', '')
  2943. this.$set(this.modalData, 'isReject', 'Y')
  2944. this.$set(this.modalData, 'tpProcessControl', 'N')
  2945. this.$set(this.modalData, 'csProcessControl', 'N')
  2946. return
  2947. }
  2948. let params = {
  2949. site: this.modalData.site,
  2950. referenceNo: this.modalData.referenceNo
  2951. }
  2952. api.getRohsButtonCondition(params).then(({data}) => {
  2953. if (data && data.code === 0 && data.data) {
  2954. this.$set(this.modalData, 'createBy2', data.data.createBy2 || '')
  2955. this.$set(this.modalData, 'isReject', data.data.isReject || 'Y')
  2956. this.$set(this.modalData, 'tpProcessControl', data.data.tpProcessControl || 'N')
  2957. this.$set(this.modalData, 'csProcessControl', data.data.csProcessControl || 'N')
  2958. } else {
  2959. this.$set(this.modalData, 'createBy2', '')
  2960. this.$set(this.modalData, 'isReject', 'Y')
  2961. this.$set(this.modalData, 'tpProcessControl', 'N')
  2962. this.$set(this.modalData, 'csProcessControl', 'N')
  2963. }
  2964. }).catch(() => {
  2965. this.$set(this.modalData, 'createBy2', '')
  2966. this.$set(this.modalData, 'isReject', 'Y')
  2967. this.$set(this.modalData, 'tpProcessControl', 'N')
  2968. this.$set(this.modalData, 'csProcessControl', 'N')
  2969. })
  2970. },
  2971. // 列表行选中变色
  2972. rowStyle ({row}) {
  2973. if (this.currentRow && this.currentRow.referenceNo === row.referenceNo) {
  2974. return { 'background-color': '#E8F7F6', cursor: 'pointer' }
  2975. }
  2976. },
  2977. // 获取按钮的权限数据
  2978. getButtonAuthData () {
  2979. this.authSearch = this.isAuth(this.menuId+":search")
  2980. this.authUpdate = this.isAuth(this.menuId+":update")
  2981. this.authIssue = this.isAuth(this.menuId+":issue")
  2982. this.authSubmit = this.isAuth(this.menuId+":submit")
  2983. this.authReject = this.isAuth(this.menuId+":reject")
  2984. this.authFileSave = this.isAuth(this.menuId+":fileSave")
  2985. this.authFileDownLoad = this.isAuth(this.menuId+":fileDownLoad")
  2986. this.authFileRemove = this.isAuth(this.menuId+":fileRemove")
  2987. this.authFilePreview = this.isAuth(this.menuId+":filePreview")
  2988. this.authDataEntry = this.isAuth(this.menuId+":dataEntry")
  2989. this.authDelete = this.isAuth(this.menuId+":delete")
  2990. },
  2991. // 校验是否为超级管理员
  2992. checkSuperAdmin () {
  2993. checkSuperAdmin().then(({data}) => {
  2994. this.superAdmin = data.superAdmin
  2995. })
  2996. },
  2997. changeClickRow (row, column, event) {
  2998. this.loadCurrentRowFromServer(row, row || {})
  2999. },
  3000. currentChange (val) {
  3001. if (val) {
  3002. this.loadCurrentRowFromServer(val, val || {})
  3003. } else {
  3004. this.currentRow = {}
  3005. this.approvalList = []
  3006. }
  3007. },
  3008. dataListSelectionChange (rows) {
  3009. this.dataListSelections = rows || []
  3010. },
  3011. applyCurrentRowData (detailData, fallbackData = {}) {
  3012. this.currentRow = detailData || {}
  3013. if (!Array.isArray(this.currentRow.materialList)) {
  3014. this.$set(this.currentRow, 'materialList', [])
  3015. }
  3016. this.fillDisplayFields(this.currentRow, fallbackData || {})
  3017. this.syncDataListRow(this.currentRow)
  3018. this.refreshCurrentTabTable()
  3019. },
  3020. syncDataListRow (rowData) {
  3021. if (!rowData || !rowData.site || !rowData.referenceNo || !Array.isArray(this.dataList)) {
  3022. return
  3023. }
  3024. const targetIndex = this.dataList.findIndex(item => item.site === rowData.site && item.referenceNo === rowData.referenceNo)
  3025. if (targetIndex < 0) {
  3026. return
  3027. }
  3028. const mergedRow = {
  3029. ...this.dataList[targetIndex],
  3030. ...rowData
  3031. }
  3032. this.fillDisplayFields(mergedRow, this.dataList[targetIndex] || {})
  3033. this.$set(this.dataList, targetIndex, mergedRow)
  3034. },
  3035. loadCurrentRowFromServer (row, fallbackData = {}) {
  3036. if (!row || !row.site || !row.referenceNo) {
  3037. this.applyCurrentRowData(row || {}, fallbackData || {})
  3038. return Promise.resolve()
  3039. }
  3040. return api.getRohsDetail(row.site, row.referenceNo).then(({data}) => {
  3041. if (data && data.code === 0 && data.data) {
  3042. this.applyCurrentRowData(data.data, fallbackData || row)
  3043. } else {
  3044. this.applyCurrentRowData(row || {}, fallbackData || {})
  3045. }
  3046. }).catch(() => {
  3047. this.applyCurrentRowData(row || {}, fallbackData || {})
  3048. })
  3049. },
  3050. refreshCurrentRowFromServer (site, referenceNo) {
  3051. const querySite = site || (this.currentRow && this.currentRow.site)
  3052. const queryReferenceNo = referenceNo || (this.currentRow && this.currentRow.referenceNo)
  3053. if (!querySite || !queryReferenceNo || String(queryReferenceNo).startsWith('TEMP-')) {
  3054. return Promise.resolve()
  3055. }
  3056. return this.loadCurrentRowFromServer({
  3057. site: querySite,
  3058. referenceNo: queryReferenceNo
  3059. }, this.currentRow || {})
  3060. },
  3061. refreshOssRef (refName) {
  3062. const ref = this.$refs[refName]
  3063. if (!ref) {
  3064. return
  3065. }
  3066. const refList = Array.isArray(ref) ? ref : [ref]
  3067. refList.forEach(item => {
  3068. if (item && typeof item.handleQuery === 'function') {
  3069. item.handleQuery()
  3070. }
  3071. })
  3072. },
  3073. refreshAttachmentPanels () {
  3074. this.refreshOssRef('modalAttachmentTdsOss')
  3075. this.refreshOssRef('modalAttachmentMsdsOss')
  3076. this.refreshOssRef('modalAttachmentTestReportOss')
  3077. this.refreshOssRef('modalAttachmentOtherOss')
  3078. this.refreshOssRef('modalTdsOss')
  3079. this.refreshOssRef('bottomAttachmentOss')
  3080. this.refreshOssRef('bottomTdsOss')
  3081. },
  3082. handleModalClose () {
  3083. const site = this.modalData.site
  3084. const referenceNo = this.modalData.referenceNo
  3085. this.modalFlag = false
  3086. this.rohsCreatePartDialogFlag = false
  3087. this.rohsCharacteristicDialogFlag = false
  3088. this.rohsCreatePartTab = 'General'
  3089. this.$nextTick(() => {
  3090. this.refreshAttachmentPanels()
  3091. })
  3092. this.refreshCurrentRowFromServer(site, referenceNo)
  3093. },
  3094. fillDisplayFields (target, fallbackData = {}) {
  3095. if (!target) {
  3096. return
  3097. }
  3098. const fields = ['nodeId', 'nodeName', 'currentApprover', 'applicantName', 'pmName', 'npdEngineerName', 'technicalPlanName', 'buyerName', 'endCustomerName', 'projectName', 'commGroup1Desc', 'commGroup2Desc', 'commGroup3Desc', 'hsfApproverName', 'relatedPeopleName']
  3099. fields.forEach(field => {
  3100. const value = target[field] || fallbackData[field] || ''
  3101. this.$set(target, field, value)
  3102. })
  3103. this.$set(target, 'endCustomerFlag', !!target.endCustomerFlag)
  3104. this.$set(target, 'projectIdFlag', !!target.projectIdFlag)
  3105. const validUntilValue = target.validUntilValue !== undefined && target.validUntilValue !== null && target.validUntilValue !== ''
  3106. ? target.validUntilValue
  3107. : fallbackData.validUntilValue
  3108. this.$set(target, 'validUntilValue', this.normalizeValidUntilValue(validUntilValue))
  3109. const applicationDate = target.applicationDate || fallbackData.applicationDate || ''
  3110. const plannedMassProductionDate = target.plannedMassProductionDate || fallbackData.plannedMassProductionDate || ''
  3111. const expiredDate = target.expiredDate || fallbackData.expiredDate || ''
  3112. const normalizedExpiredDate = this.normalizeDateOnly(expiredDate)
  3113. this.$set(target, 'applicationDate', this.normalizeDateOnly(applicationDate))
  3114. this.$set(target, 'plannedMassProductionDate', this.normalizeDateOnly(plannedMassProductionDate))
  3115. this.$set(target, 'expiredDate', normalizedExpiredDate)
  3116. this.$set(target, 'expiryDate', this.calculateExpiryDateByRule(normalizedExpiredDate, target.validUntilValue, target.validUntil))
  3117. },
  3118. refreshCurrentTabTable () {
  3119. if (this.activeTable === 'approvalInformation') {
  3120. this.getApprovalList()
  3121. return
  3122. }
  3123. if (this.activeTable === 'attachment') {
  3124. this.refreshOssRef('bottomAttachmentOss')
  3125. return
  3126. }
  3127. if (this.activeTable === 'npdInfo') {
  3128. this.refreshOssRef('bottomTdsOss')
  3129. }
  3130. },
  3131. getApprovalList () {
  3132. if (!this.currentRow || !this.currentRow.site || !this.currentRow.referenceNo) {
  3133. this.approvalList = []
  3134. return
  3135. }
  3136. let params = {
  3137. site: this.currentRow.site,
  3138. menuId: this.menuId,
  3139. documentNo: this.currentRow.referenceNo
  3140. }
  3141. api.getRohsApprovalList(params).then(({data}) => {
  3142. if (data && data.code === 0) {
  3143. this.approvalList = data.rows || []
  3144. } else {
  3145. this.approvalList = []
  3146. }
  3147. }).catch(() => {
  3148. this.approvalList = []
  3149. })
  3150. },
  3151. // 获取列表
  3152. getDataList () {
  3153. if (!this.authSearch) {
  3154. this.dataList = []
  3155. this.dataListSelections = []
  3156. this.totalPage = 0
  3157. this.currentRow = {}
  3158. this.approvalList = []
  3159. this.isFilterSearch = false
  3160. return
  3161. }
  3162. this.dataListLoading = true
  3163. let params = {
  3164. page: this.pageIndex,
  3165. limit: this.pageSize,
  3166. site: this.$store.state.user.site,
  3167. menuId: this.menuId,
  3168. referenceNo: this.searchData.referenceNo,
  3169. status: this.searchData.status,
  3170. rohsStatus: this.searchData.rohsStatus,
  3171. currentApprover: this.searchData.currentApprover,
  3172. nodeId: this.searchData.nodeId
  3173. }
  3174. api.getRohsList(params).then(({data}) => {
  3175. if (data && data.code === 0) {
  3176. const list = data.page.list || []
  3177. this.dataList = list.map(item => {
  3178. return {
  3179. applicantName: '',
  3180. pmName: '',
  3181. npdEngineerName: '',
  3182. technicalPlanName: '',
  3183. buyerName: '',
  3184. endCustomerName: '',
  3185. projectName: '',
  3186. nodeId: '',
  3187. nodeName: '',
  3188. currentApprover: '',
  3189. commGroup1Desc: '',
  3190. commGroup2Desc: '',
  3191. commGroup3Desc: '',
  3192. hsfApproverName: '',
  3193. relatedPeopleName: '',
  3194. ...item
  3195. }
  3196. })
  3197. this.dataListSelections = []
  3198. this.totalPage = data.page.totalCount
  3199. this.$nextTick(() => {
  3200. if (this.$refs.rohsTable) {
  3201. this.$refs.rohsTable.clearSelection()
  3202. }
  3203. if (this.$refs.rohsTable && this.dataList.length > 0) {
  3204. this.$refs.rohsTable.setCurrentRow(this.dataList[0])
  3205. } else if (this.$refs.rohsTable) {
  3206. this.$refs.rohsTable.setCurrentRow()
  3207. }
  3208. })
  3209. } else {
  3210. this.dataList = []
  3211. this.dataListSelections = []
  3212. this.totalPage = 0
  3213. this.currentRow = {}
  3214. this.approvalList = []
  3215. }
  3216. this.dataListLoading = false
  3217. }).catch(() => {
  3218. this.dataListSelections = []
  3219. this.currentRow = {}
  3220. this.approvalList = []
  3221. this.dataListLoading = false
  3222. })
  3223. this.isFilterSearch = false
  3224. },
  3225. // 分页
  3226. sizeChangeHandle (val) {
  3227. this.pageSize = val
  3228. this.pageIndex = 1
  3229. if (this.isFilterSearch === false) {
  3230. this.getDataList()
  3231. } else {
  3232. this.queryByAnyField(this.filterSearchData)
  3233. }
  3234. },
  3235. currentChangeHandle (val) {
  3236. this.pageIndex = val
  3237. if (this.isFilterSearch === false) {
  3238. this.getDataList()
  3239. } else {
  3240. this.queryByAnyField(this.filterSearchData)
  3241. }
  3242. },
  3243. // 搜索条件点击
  3244. searchHandle () {
  3245. if (!this.authSearch) {
  3246. return
  3247. }
  3248. this.filterVisible = true
  3249. },
  3250. queryByAnyField (params) {
  3251. const queryParams = {
  3252. ...(params || {})
  3253. }
  3254. queryParams.no = this.pageIndex
  3255. queryParams.size = this.pageSize
  3256. queryParams.userId = this.$store.state.user.id.toString()
  3257. queryParams.site = this.$store.state.user.site
  3258. queryParams.menuId = this.menuId
  3259. this.dataListLoading = true
  3260. api.getRohsListAny(queryParams).then(({data}) => {
  3261. if (data && data.code === 0) {
  3262. const list = (data.page && data.page.list) || []
  3263. this.dataList = list.map(item => {
  3264. return {
  3265. applicantName: '',
  3266. pmName: '',
  3267. npdEngineerName: '',
  3268. technicalPlanName: '',
  3269. buyerName: '',
  3270. endCustomerName: '',
  3271. projectName: '',
  3272. nodeId: '',
  3273. nodeName: '',
  3274. currentApprover: '',
  3275. commGroup1Desc: '',
  3276. commGroup2Desc: '',
  3277. commGroup3Desc: '',
  3278. hsfApproverName: '',
  3279. relatedPeopleName: '',
  3280. ...item
  3281. }
  3282. })
  3283. this.dataListSelections = []
  3284. this.totalPage = data.page.totalCount
  3285. this.$nextTick(() => {
  3286. if (this.$refs.rohsTable) {
  3287. this.$refs.rohsTable.clearSelection()
  3288. }
  3289. if (this.$refs.rohsTable && this.dataList.length > 0) {
  3290. this.$refs.rohsTable.setCurrentRow(this.dataList[0])
  3291. } else if (this.$refs.rohsTable) {
  3292. this.$refs.rohsTable.setCurrentRow()
  3293. }
  3294. })
  3295. } else {
  3296. this.$message.warning((data && data.msg) || '搜索失败')
  3297. this.dataList = []
  3298. this.dataListSelections = []
  3299. this.totalPage = 0
  3300. this.currentRow = {}
  3301. this.approvalList = []
  3302. }
  3303. this.dataListLoading = false
  3304. }).catch(() => {
  3305. this.dataList = []
  3306. this.dataListSelections = []
  3307. this.currentRow = {}
  3308. this.approvalList = []
  3309. this.dataListLoading = false
  3310. })
  3311. this.filterSearchData = JSON.parse(JSON.stringify(queryParams))
  3312. this.isFilterSearch = true
  3313. this.filterVisible = false
  3314. },
  3315. buildExportName () {
  3316. const now = new Date()
  3317. const year = String(now.getFullYear())
  3318. const month = String(now.getMonth() + 1).padStart(2, '0')
  3319. const day = String(now.getDate()).padStart(2, '0')
  3320. const hour = String(now.getHours()).padStart(2, '0')
  3321. const minute = String(now.getMinutes()).padStart(2, '0')
  3322. const second = String(now.getSeconds()).padStart(2, '0')
  3323. return 'RoHs记录' + year + month + day + hour + minute + second
  3324. },
  3325. async createExportData () {
  3326. const params = {
  3327. ...this.searchData,
  3328. site: this.$store.state.user.site,
  3329. menuId: this.menuId,
  3330. page: 1,
  3331. limit: -1
  3332. }
  3333. this.resultList = []
  3334. await api.getRohsList(params).then(({data}) => {
  3335. if (data && data.code === 0 && data.page && Array.isArray(data.page.list)) {
  3336. this.resultList = (data.page.list || []).map(item => {
  3337. const row = {
  3338. ...item
  3339. }
  3340. row.applicationDate = this.normalizeDateOnly(row.applicationDate)
  3341. row.plannedMassProductionDate = this.normalizeDateOnly(row.plannedMassProductionDate)
  3342. row.expectReportTime = this.normalizeDateOnly(row.expectReportTime)
  3343. row.expiredDate = this.normalizeDateOnly(row.expiredDate)
  3344. row.expiryDate = this.normalizeDateOnly(row.expiryDate)
  3345. row.validUntilDisplay = this.getValidUntilDisplay(row.validUntilValue, row.validUntil)
  3346. row.hsfApproverName = row.hsfApproverName || row.hsfApprover || ''
  3347. row.relatedPeopleName = row.relatedPeopleName || row.relatedPeople || ''
  3348. return row
  3349. })
  3350. } else {
  3351. this.$message.warning((data && data.msg) || '导出数据获取失败')
  3352. }
  3353. }).catch(() => {
  3354. this.$message.error('导出数据获取失败')
  3355. })
  3356. return this.resultList
  3357. },
  3358. startDownload () {
  3359. this.exportName = this.buildExportName()
  3360. this.exportFieldMap = this.buildExportFields()
  3361. if (!this.exportFieldMap || Object.keys(this.exportFieldMap).length === 0) {
  3362. this.$message.warning('未获取到可导出的列,请稍后重试')
  3363. }
  3364. this.exportLoading = true
  3365. },
  3366. finishDownload () {
  3367. this.exportLoading = false
  3368. },
  3369. buildExportFields () {
  3370. const tableRef = this.$refs.rohsTable
  3371. if (!tableRef || !Array.isArray(tableRef.columns)) {
  3372. return {}
  3373. }
  3374. const fields = {}
  3375. tableRef.columns.forEach(column => {
  3376. const label = column && column.label ? String(column.label).trim() : ''
  3377. const property = column && column.property ? String(column.property).trim() : ''
  3378. if (!label || !property || label === '操作') {
  3379. return
  3380. }
  3381. fields[label] = property
  3382. })
  3383. return fields
  3384. },
  3385. // 单选可取消
  3386. radioClick (field, value) {
  3387. if (this.modalData[field] === value) {
  3388. this.modalData[field] = ''
  3389. } else {
  3390. this.modalData[field] = value
  3391. }
  3392. },
  3393. // 新增 / 修改
  3394. addOrUpdateHandle (row) {
  3395. if (!row && !this.authUpdate) {
  3396. this.$message.warning('没有新增权限')
  3397. return
  3398. }
  3399. if (row && !this.authUpdate && !this.authDataEntry) {
  3400. this.$message.warning('没有编辑权限')
  3401. return
  3402. }
  3403. this.modalFlag = true
  3404. this.activeName = 'basicInfo'
  3405. this.submitModalFlag = false
  3406. this.rohsRemarkFlag = false
  3407. this.rejectOpinion = ''
  3408. this.rohsRemarkForm = {
  3409. remark: ''
  3410. }
  3411. this.projectMaterialDialogFlag = false
  3412. this.rohsCreatePartDialogFlag = false
  3413. this.rohsCreatePartLoading = false
  3414. this.rohsCreatePartTab = 'General'
  3415. this.rohsCreatePartTagNo = 0
  3416. this.rohsCharacteristicDialogFlag = false
  3417. this.rohsCharacteristicQueryData = {
  3418. propertiesItemNo: '',
  3419. itemDesc: ''
  3420. }
  3421. this.rohsCharacteristicList = []
  3422. this.rohsCharacteristicSelections = []
  3423. this.rohsPartItemSelections = []
  3424. this.projectMaterialSelections = []
  3425. this.materialSelections = []
  3426. this.hsfApproverOptionList = []
  3427. this.hsfApproverDisplayList = []
  3428. this.hsfApproverSelectionCache = []
  3429. this.hsfApproverSearchData = {
  3430. operatorId: '',
  3431. operatorName: ''
  3432. }
  3433. this.hsfApproverFlag = false
  3434. this.relatedPeopleOptionList = []
  3435. this.relatedPeopleDisplayList = []
  3436. this.relatedPeopleSelection = null
  3437. this.relatedPeopleSearchData = {
  3438. operatorId: '',
  3439. operatorName: ''
  3440. }
  3441. this.relatedPeopleFlag = false
  3442. this.plmRohsAuthorityArr = []
  3443. this.nodeAuthorityLoaded = !row
  3444. this.isEditMode = !!row
  3445. this.projectMaterialPageIndex = 1
  3446. this.projectMaterialTotal = 0
  3447. this.projectMaterialList = []
  3448. this.projectMaterialSearchData = {
  3449. finalPartNo: '',
  3450. partDesc: '',
  3451. partStatus: ''
  3452. }
  3453. this.showModalFlag = !!(row && (row.status === '已完成' || !this.authUpdate))
  3454. if (row) {
  3455. this.modalTitle = 'RoHS 编辑'
  3456. api.getRohsDetail(row.site, row.referenceNo).then(({data}) => {
  3457. if (data && data.code === 0) {
  3458. this.modalData = data.data || {}
  3459. this.$set(this.modalData, 'qualificationDocumentsNeededList', this.modalData.qualificationDocumentsNeeded ? this.modalData.qualificationDocumentsNeeded.split(';').filter(item => item) : [])
  3460. this.$set(this.modalData, 'testReportIncludingItemsList', this.modalData.testReportIncludingItems ? this.modalData.testReportIncludingItems.split(';').filter(item => item) : [])
  3461. this.$set(this.modalData, 'materialClassifyList', this.modalData.materialClassify ? this.modalData.materialClassify.split(';').filter(item => item) : [])
  3462. this.$set(this.modalData, 'materialList', Array.isArray(this.modalData.materialList) ? this.modalData.materialList : [])
  3463. this.$set(this.modalData, 'hsfApproverCodeList', this.modalData.hsfApprover ? this.modalData.hsfApprover.split(';').filter(item => item) : [])
  3464. this.$set(this.modalData, 'buNo', this.modalData.process || '')
  3465. this.$set(this.modalData, 'isAhGrade', this.normalizeCheckboxFlag(this.modalData.isAhGrade))
  3466. this.$set(this.modalData, 'validUntilValue', this.normalizeValidUntilValue(this.modalData.validUntilValue))
  3467. this.syncHsfApproverFields()
  3468. this.fillDisplayFields(this.modalData, row || {})
  3469. this.applyHsfStandardDefaultByCustomer(this.modalData)
  3470. // 编辑时不允许修改最终客户和项目编码
  3471. this.$set(this.modalData, 'endCustomerFlag', true)
  3472. this.$set(this.modalData, 'projectIdFlag', true)
  3473. this.$set(this.modalData, 'createBy2', '')
  3474. this.$set(this.modalData, 'isReject', 'Y')
  3475. this.$set(this.modalData, 'tpProcessControl', 'N')
  3476. this.$set(this.modalData, 'csProcessControl', 'N')
  3477. this.loadModalButtonCondition()
  3478. this.loadHsfApproverByCurrentProcess(false)
  3479. this.loadNodeAuthority(this.modalData.site || row.site, this.modalData.stepId !== null && this.modalData.stepId !== undefined ? this.modalData.stepId : (row.stepId !== null && row.stepId !== undefined ? row.stepId : 10))
  3480. }
  3481. }).catch(() => {
  3482. this.loadNodeAuthority(row.site, row.stepId !== null && row.stepId !== undefined ? row.stepId : 10)
  3483. })
  3484. } else {
  3485. this.modalTitle = 'RoHS 新增'
  3486. this.showModalFlag = false
  3487. // 生成一个临时ID用于附件上传绑定
  3488. const tempReferenceNo = 'TEMP-' + new Date().getTime() + '-' + Math.floor(Math.random() * 1000)
  3489. this.modalData = {
  3490. site: this.$store.state.user.site,
  3491. referenceNo: tempReferenceNo,
  3492. applicant: this.$store.state.user.name || '',
  3493. applicantName: this.$store.state.user.userDisplay || this.$store.state.user.user_display || '',
  3494. pm: '',
  3495. pmName: '',
  3496. applicationDate: this.getCurrentDateString(),
  3497. process: '',
  3498. plannedMassProductionDate: '',
  3499. color: '',
  3500. vendorCode: '',
  3501. vendorMaterialCode: '',
  3502. materialClassify: '',
  3503. materialClassifyList: [],
  3504. otherMaterialClassify: '',
  3505. materialUseFor: '',
  3506. endCustomer: '',
  3507. endCustomerName: '',
  3508. endCustomerFlag: false,
  3509. projectId: '',
  3510. projectName: '',
  3511. projectIdFlag: true,
  3512. commGroup1: '',
  3513. commGroup1Desc: '',
  3514. commGroup2: '',
  3515. commGroup2Desc: '',
  3516. commGroup3: '',
  3517. commGroup3Desc: '',
  3518. needCreateNumber: '',
  3519. npdEngineer: '',
  3520. npdEngineerName: '',
  3521. materialValidityTime: '',
  3522. materialValidityComments: '',
  3523. needDeviation: '',
  3524. technicalPlan: '',
  3525. wmRequiredSpec: '',
  3526. isFiberMaterial: '',
  3527. materialThickness: '',
  3528. buyer: '',
  3529. buyerName: '',
  3530. expectReportTime: '',
  3531. qualificationDocumentsNeeded: '',
  3532. qualificationDocumentsNeededList: [],
  3533. testReportIncludingItems: '',
  3534. testReportIncludingItemsList: [],
  3535. remark: '',
  3536. status: '草稿',
  3537. sgsReportNumber: '',
  3538. rohsStatus: 'Active',
  3539. expiredDate: '',
  3540. expiryDate: '',
  3541. fiberInformation: '',
  3542. hsfStandard: '',
  3543. hsfApprover: '',
  3544. hsfApproverName: '',
  3545. hsfApproverCodeList: [],
  3546. relatedPeople: '',
  3547. relatedPeopleName: '',
  3548. buNo: '',
  3549. validUntilValue: 0,
  3550. validUntil: '',
  3551. isMeetRohsRequirement: '',
  3552. isAhGrade: 'N',
  3553. hsfSupplierClassification: '',
  3554. materialDesc: '',
  3555. npdRemark: '',
  3556. isSameMaterialDiffSize: '',
  3557. ifsPartNo: '',
  3558. materialList: [],
  3559. stepId: 10,
  3560. rejectFlag: 'N',
  3561. rejectStepId: null,
  3562. createBy2: '',
  3563. isReject: 'Y',
  3564. tpProcessControl: 'N',
  3565. csProcessControl: 'N'
  3566. }
  3567. this.nodeAuthorityLoaded = true
  3568. }
  3569. },
  3570. // 表单提交
  3571. dataFormSubmit () {
  3572. if (!this.canSaveAction()) {
  3573. this.$message.warning('当前状态不允许保存')
  3574. return
  3575. }
  3576. this.$set(this.modalData, 'isAhGrade', this.normalizeCheckboxFlag(this.modalData.isAhGrade))
  3577. this.normalizeHsfStandardByCustomer(this.modalData)
  3578. this.syncHsfApproverFields()
  3579. if (!this.validateValidUntilPair()) {
  3580. return
  3581. }
  3582. this.syncExpiryDateByRule()
  3583. this.modalData.qualificationDocumentsNeeded = this.modalData.qualificationDocumentsNeededList.join(';')
  3584. this.modalData.testReportIncludingItems = this.modalData.testReportIncludingItemsList.join(';')
  3585. this.modalData.materialClassify = this.modalData.materialClassifyList.join(';')
  3586. this.modalData.materialList = (this.modalData.materialList || []).map((item, index) => {
  3587. return {
  3588. ...item,
  3589. lineNo: index + 1,
  3590. projectId: this.modalData.projectId
  3591. }
  3592. })
  3593. const submitMethod = this.modalTitle === 'RoHS 新增' ? api.saveRohs : api.updateRohs
  3594. submitMethod(this.modalData).then(({data}) => {
  3595. if (data && data.code === 0) {
  3596. this.$message.success('操作成功')
  3597. this.modalFlag = false
  3598. this.getDataList()
  3599. } else {
  3600. this.$message.error(data.msg || '操作失败')
  3601. }
  3602. })
  3603. },
  3604. // 同意
  3605. agreeSubmit () {
  3606. if (!this.canAgreeAction()) {
  3607. this.$message.warning('当前状态不允许同意')
  3608. return
  3609. }
  3610. this.$confirm('确认同意该申请单?', '提示', {
  3611. confirmButtonText: '确定',
  3612. cancelButtonText: '取消',
  3613. type: 'warning'
  3614. }).then(() => {
  3615. this.submitRohs('Y')
  3616. })
  3617. },
  3618. openRejectModal () {
  3619. if (!this.canRejectAction()) {
  3620. this.$message.warning('当前状态不允许驳回')
  3621. return
  3622. }
  3623. this.rejectOpinion = ''
  3624. this.submitModalFlag = true
  3625. },
  3626. // 驳回
  3627. rejectSubmit () {
  3628. if (!this.rejectOpinion || !this.rejectOpinion.trim()) {
  3629. this.$message.warning('请填写驳回意见')
  3630. return
  3631. }
  3632. this.submitRohs('N')
  3633. },
  3634. submitRohs (nodeConclusion) {
  3635. if (nodeConclusion === 'Y' && !this.canAgreeAction()) {
  3636. this.$message.warning('当前状态不允许同意')
  3637. return
  3638. }
  3639. if (nodeConclusion === 'N' && !this.canRejectAction()) {
  3640. this.$message.warning('当前状态不允许驳回')
  3641. return
  3642. }
  3643. if (!this.modalData.site || !this.modalData.referenceNo) {
  3644. this.$message.warning('单据主键信息缺失,无法提交审批')
  3645. return
  3646. }
  3647. this.$set(this.modalData, 'isAhGrade', this.normalizeCheckboxFlag(this.modalData.isAhGrade))
  3648. this.normalizeHsfStandardByCustomer(this.modalData)
  3649. this.syncHsfApproverFields()
  3650. if (!this.validateValidUntilPair()) {
  3651. return
  3652. }
  3653. this.syncExpiryDateByRule()
  3654. if (!this.nodeAuthorityLoaded) {
  3655. this.$message.warning('节点权限加载中,请稍后重试')
  3656. return
  3657. }
  3658. if (!this.validateSubmitRequiredFields()) {
  3659. return
  3660. }
  3661. const submitMaterialList = this.normalizeMaterialListForSave(this.modalData.materialList || [])
  3662. this.submitLoading = true
  3663. let params = {
  3664. ...this.modalData,
  3665. site: this.modalData.site,
  3666. referenceNo: this.modalData.referenceNo,
  3667. materialClassify: (this.modalData.materialClassifyList || []).join(';'),
  3668. qualificationDocumentsNeeded: (this.modalData.qualificationDocumentsNeededList || []).join(';'),
  3669. testReportIncludingItems: (this.modalData.testReportIncludingItemsList || []).join(';'),
  3670. materialList: submitMaterialList,
  3671. nodeConclusion: nodeConclusion,
  3672. rejectOpinion: nodeConclusion === 'N' ? this.rejectOpinion : '',
  3673. menuId: this.menuId,
  3674. documentNo: this.modalData.referenceNo
  3675. }
  3676. api.submitRohs(params).then(({data}) => {
  3677. if (data && data.code === 0) {
  3678. this.$message.success(nodeConclusion === 'Y' ? '同意成功' : '驳回成功')
  3679. this.submitModalFlag = false
  3680. this.modalFlag = false
  3681. this.getDataList()
  3682. } else {
  3683. this.$message.error(data.msg || '提交失败')
  3684. }
  3685. this.submitLoading = false
  3686. }).catch(() => {
  3687. this.submitLoading = false
  3688. })
  3689. },
  3690. // 下达
  3691. issueModal (row) {
  3692. if (!this.authIssue) {
  3693. this.$message.warning('没有下达权限')
  3694. return
  3695. }
  3696. this.$confirm('确认下达该申请单?', '提示', {
  3697. confirmButtonText: '确定',
  3698. cancelButtonText: '取消',
  3699. type: 'warning'
  3700. }).then(() => {
  3701. let params = {
  3702. site: row.site,
  3703. referenceNo: row.referenceNo,
  3704. menuId: this.menuId
  3705. }
  3706. api.issueRohs(params).then(({data}) => {
  3707. if (data && data.code === 0) {
  3708. this.$message.success('下达成功')
  3709. if (this.modalFlag && this.modalData.referenceNo === row.referenceNo) {
  3710. this.modalData.status = '审批中'
  3711. }
  3712. this.getDataList()
  3713. } else {
  3714. this.$message.error(data.msg || '下达失败')
  3715. }
  3716. })
  3717. })
  3718. },
  3719. deleteHandle () {
  3720. if (!this.authDelete) {
  3721. this.$message.warning('没有删除权限')
  3722. return
  3723. }
  3724. const selectedRows = (this.dataListSelections || []).filter(item => item && item.site && item.referenceNo)
  3725. if (!selectedRows.length) {
  3726. this.$message.warning('请先勾选要删除的单据')
  3727. return
  3728. }
  3729. const nonDraftRows = selectedRows.filter(item => item.status !== '草稿')
  3730. if (nonDraftRows.length) {
  3731. const previewText = nonDraftRows.slice(0, 3).map(item => item.referenceNo).join('、')
  3732. const suffix = nonDraftRows.length > 3 ? (' 等' + nonDraftRows.length + '条') : ''
  3733. this.$message.warning('仅草稿状态的单据允许删除,当前勾选包含非草稿单据:' + previewText + suffix)
  3734. return
  3735. }
  3736. this.$confirm('确认删除选中的' + selectedRows.length + '条RoHS单据?删除后会同步删除材料和附件数据。', '提示', {
  3737. confirmButtonText: '确定',
  3738. cancelButtonText: '取消',
  3739. type: 'warning'
  3740. }).then(() => {
  3741. const deleteTasks = selectedRows.map(item => {
  3742. return api.deleteRohs({
  3743. site: item.site,
  3744. referenceNo: item.referenceNo
  3745. }).then(({data}) => {
  3746. if (data && data.code === 0) {
  3747. return {
  3748. success: true,
  3749. referenceNo: item.referenceNo
  3750. }
  3751. }
  3752. return {
  3753. success: false,
  3754. referenceNo: item.referenceNo,
  3755. msg: (data && data.msg) || '删除失败'
  3756. }
  3757. }).catch(() => {
  3758. return {
  3759. success: false,
  3760. referenceNo: item.referenceNo,
  3761. msg: '删除失败'
  3762. }
  3763. })
  3764. })
  3765. Promise.all(deleteTasks).then(results => {
  3766. const successRows = results.filter(item => item.success)
  3767. const failRows = results.filter(item => !item.success)
  3768. if (this.modalFlag && successRows.some(item => item.referenceNo === this.modalData.referenceNo)) {
  3769. this.modalFlag = false
  3770. }
  3771. if (!failRows.length) {
  3772. this.$message.success('删除成功,共' + successRows.length + '条')
  3773. } else if (!successRows.length) {
  3774. this.$message.error(failRows[0].msg || '删除失败')
  3775. } else {
  3776. this.$message.warning('已删除' + successRows.length + '条,失败' + failRows.length + '条')
  3777. }
  3778. this.getDataList()
  3779. })
  3780. }).catch(() => {})
  3781. },
  3782. buildRohsCreatePartData () {
  3783. const user = this.$store.state.user || {}
  3784. return {
  3785. site: this.modalData.site || user.site || '',
  3786. partNo: '',
  3787. partDesc: this.modalData.materialDesc || '',
  3788. partType: 'Purchased',
  3789. hazardCode: '',
  3790. hazardDesc: '',
  3791. familyId: '',
  3792. familyName: '',
  3793. groupId: '',
  3794. groupName: '',
  3795. umId: '',
  3796. umName: '',
  3797. weightNet: '',
  3798. uomForWeightNet: 'kg',
  3799. volumeNet: '',
  3800. uomForVolumeNet: 'm3',
  3801. lotTrackingCode: 'Order Based',
  3802. remark: '',
  3803. productGroupId1: this.modalData.commGroup1 || '',
  3804. productGroupName1: this.modalData.commGroup1Desc || '',
  3805. productGroupId2: this.modalData.commGroup2 || '',
  3806. productGroupName2: this.modalData.commGroup2Desc || '',
  3807. productGroupId3: '',
  3808. productGroupName3: '',
  3809. productGroupId4: '*',
  3810. productGroupName4: 'NorthSky Application owner',
  3811. commGroup3: this.modalData.commGroup3 || '',
  3812. commGroup3Desc: this.modalData.commGroup3Desc || '',
  3813. codeNo: '',
  3814. codeDesc: '',
  3815. typeDesignation: '',
  3816. assetClass: 'S',
  3817. assetClassDesc: '标准',
  3818. dimQuality: '',
  3819. abcClass: 'C',
  3820. abcClassDesc: '',
  3821. frequencyClass: 'Very Slow Mover',
  3822. lifecycleStage: 'Development',
  3823. countryOfOrigin: '',
  3824. countryOfOriginDesc: '',
  3825. regionOfOrigin: '',
  3826. regionOfOriginDesc: '',
  3827. manufacturingLeadTime: 0,
  3828. expectedLeadTime: 0,
  3829. durabilityWeek: '',
  3830. durabilityDay: '',
  3831. intrastatConvFactor: undefined,
  3832. customsStatNo: '',
  3833. customsStatDesc: '',
  3834. umDesc: '',
  3835. planningMethod: 'A',
  3836. planningMethodDesc: '',
  3837. partStatus: 'A',
  3838. partStatusDesc: '活动',
  3839. active: 'Y',
  3840. status: 'Y',
  3841. supplyCode: 'Inventory Order',
  3842. configurationId: '*',
  3843. partCostGroupId: '',
  3844. partCostGroupDesc: '',
  3845. inventoryValuationMethod: 'Standard Cost',
  3846. inventoryPartCostLevel: 'Cost Per Part',
  3847. invoiceConsideration: 'Ignore Invoice Price',
  3848. zeroCostFlag: 'Zero Cost Forbidden',
  3849. estimatedMaterialCost: 0,
  3850. safetyStock: 0,
  3851. minOrderQty: 0,
  3852. maxOrderQty: 0,
  3853. mulOrderQty: 0,
  3854. safetyLeadTime: 0,
  3855. shrinkageFac: 0,
  3856. stdOrderQty: 0,
  3857. cumLeadTime: 0,
  3858. byProdAsSupplyInMrpDb: '',
  3859. unprotectedLeadTime: 0,
  3860. backFlushPart: 'All Locations',
  3861. issueType: 'Reserve And Backflush',
  3862. mrpControlFlagDb: 'Y',
  3863. fixedLeadTimeDay: 0,
  3864. overReporting: 'Allowed',
  3865. useTheoreticalDensityDb: '',
  3866. variableLeadTimeDay: 0,
  3867. overReportTolerance: 0,
  3868. fixedLeadTimeHour: 0,
  3869. density: undefined,
  3870. variableLeadTimeHour: 0,
  3871. showInQueryFlag: 'Y',
  3872. temporaryPartFlag: 'N',
  3873. partItemList: [],
  3874. createBy: user.name || '',
  3875. updateBy: user.name || ''
  3876. }
  3877. },
  3878. openCreateIfsPartDialog () {
  3879. if (!this.isEditMode || !this.canEditRohsMaterial()) {
  3880. this.$message.warning('当前状态不允许创建IFS料号')
  3881. return
  3882. }
  3883. this.rohsCreatePartData = this.buildRohsCreatePartData()
  3884. this.rohsCreatePartTab = 'General'
  3885. this.rohsCreatePartTagNo = 0
  3886. this.rohsCharacteristicDialogFlag = false
  3887. this.rohsCharacteristicQueryData = {
  3888. propertiesItemNo: '',
  3889. itemDesc: ''
  3890. }
  3891. this.rohsCharacteristicList = []
  3892. this.rohsCharacteristicSelections = []
  3893. this.rohsPartItemSelections = []
  3894. this.rohsCreatePartDialogFlag = true
  3895. },
  3896. closeRohsCreatePartDialog () {
  3897. this.rohsCreatePartTab = 'General'
  3898. this.rohsCreatePartTagNo = 0
  3899. this.rohsCreatePartLoading = false
  3900. this.rohsCharacteristicDialogFlag = false
  3901. this.rohsCharacteristicQueryData = {
  3902. propertiesItemNo: '',
  3903. itemDesc: ''
  3904. }
  3905. this.rohsCharacteristicList = []
  3906. this.rohsCharacteristicSelections = []
  3907. this.rohsPartItemSelections = []
  3908. this.rohsCreatePartData = this.buildRohsCreatePartData()
  3909. },
  3910. rohsChangeExpectedLeadTime () {
  3911. this.rohsCreatePartData.expectedLeadTime = this.rohsCreatePartData.manufacturingLeadTime
  3912. },
  3913. rohsChangeDurabilityWeek () {
  3914. const day = Number(this.rohsCreatePartData.durabilityDay || 0)
  3915. this.rohsCreatePartData.durabilityWeek = day / 7
  3916. },
  3917. nextRohsCreatePartNo (silent = false) {
  3918. this.rohsCreatePartData.ifsPartNo = this.rohsCreatePartData.partNo
  3919. const params = {
  3920. ...this.rohsCreatePartData,
  3921. ifsPartNo: this.rohsCreatePartData.ifsPartNo,
  3922. site: this.rohsCreatePartData.site || this.$store.state.user.site,
  3923. createBy: this.$store.state.user.name || '',
  3924. updateBy: this.$store.state.user.name || ''
  3925. }
  3926. getPartNextPartNo(params).then(({data}) => {
  3927. if (data && data.code === 0) {
  3928. this.$set(this.rohsCreatePartData, 'partNo', data.rows || '')
  3929. this.$set(this.rohsCreatePartData, 'ifsPartNo', data.rows || '')
  3930. } else if (!silent) {
  3931. this.$message.error((data && data.msg) || '获取料号失败')
  3932. }
  3933. }).catch(() => {
  3934. if (!silent) {
  3935. this.$message.error('获取料号失败')
  3936. }
  3937. })
  3938. },
  3939. openRohsCreatePartBaseList (tagNo) {
  3940. if (!this.rohsCreatePartDialogFlag) {
  3941. return
  3942. }
  3943. this.rohsCreatePartTagNo = tagNo
  3944. this.$nextTick(() => {
  3945. let strVal = ''
  3946. if (tagNo === 1007) {
  3947. strVal = this.rohsCreatePartData.umId
  3948. } else if (tagNo === 108) {
  3949. strVal = this.rohsCreatePartData.familyId
  3950. } else if (tagNo === 109) {
  3951. strVal = this.rohsCreatePartData.groupId
  3952. } else if (tagNo === 112) {
  3953. strVal = this.rohsCreatePartData.productGroupId3
  3954. } else if (tagNo === 113) {
  3955. strVal = this.rohsCreatePartData.productGroupId4
  3956. } else if (tagNo === 123) {
  3957. strVal = this.rohsCreatePartData.hazardCode
  3958. } else if (tagNo === 124) {
  3959. strVal = this.rohsCreatePartData.assetClass
  3960. } else if (tagNo === 125) {
  3961. strVal = this.rohsCreatePartData.partStatus
  3962. } else if (tagNo === 126) {
  3963. strVal = this.rohsCreatePartData.abcClass
  3964. } else if (tagNo === 127) {
  3965. strVal = this.rohsCreatePartData.countryOfOrigin
  3966. } else if (tagNo === 128) {
  3967. strVal = this.rohsCreatePartData.regionOfOrigin
  3968. } else if (tagNo === 129) {
  3969. strVal = this.rohsCreatePartData.customsStatNo
  3970. } else if (tagNo === 131) {
  3971. strVal = this.rohsCreatePartData.partCostGroupId
  3972. } else if (tagNo === 20) {
  3973. strVal = this.rohsCreatePartData.codeNo
  3974. } else if (tagNo === 132) {
  3975. strVal = this.rohsCreatePartData.planningMethod
  3976. }
  3977. this.$refs.baseList.init(tagNo, strVal)
  3978. })
  3979. },
  3980. applyRohsCreatePartBaseData (val) {
  3981. if (this.rohsCreatePartTagNo === 1007) {
  3982. this.rohsCreatePartData.umId = val.um_id
  3983. this.rohsCreatePartData.umName = val.um_name
  3984. } else if (this.rohsCreatePartTagNo === 108) {
  3985. this.rohsCreatePartData.familyId = val.family_id
  3986. this.rohsCreatePartData.familyName = val.family_name
  3987. } else if (this.rohsCreatePartTagNo === 109) {
  3988. this.rohsCreatePartData.groupId = val.group_id
  3989. this.rohsCreatePartData.groupName = val.group_name
  3990. } else if (this.rohsCreatePartTagNo === 112) {
  3991. this.rohsCreatePartData.productGroupId3 = val.product_group_id
  3992. this.rohsCreatePartData.productGroupName3 = val.product_group_name
  3993. } else if (this.rohsCreatePartTagNo === 113) {
  3994. this.rohsCreatePartData.productGroupId4 = val.product_group_id
  3995. this.rohsCreatePartData.productGroupName4 = val.product_group_name
  3996. } else if (this.rohsCreatePartTagNo === 123) {
  3997. this.rohsCreatePartData.hazardCode = val.hazard_code
  3998. this.rohsCreatePartData.hazardDesc = val.hazard_desc
  3999. } else if (this.rohsCreatePartTagNo === 124) {
  4000. this.rohsCreatePartData.assetClass = val.asset_class
  4001. this.rohsCreatePartData.assetClassDesc = val.asset_class_desc
  4002. } else if (this.rohsCreatePartTagNo === 125) {
  4003. this.rohsCreatePartData.partStatus = val.part_status
  4004. this.rohsCreatePartData.partStatusDesc = val.part_status_desc
  4005. } else if (this.rohsCreatePartTagNo === 126) {
  4006. this.rohsCreatePartData.abcClass = val.abc_class
  4007. this.rohsCreatePartData.abcClassDesc = val.abc_class_desc
  4008. } else if (this.rohsCreatePartTagNo === 127) {
  4009. this.rohsCreatePartData.countryOfOrigin = val.country_of_origin
  4010. this.rohsCreatePartData.countryOfOriginDesc = val.country_of_origin_desc
  4011. } else if (this.rohsCreatePartTagNo === 128) {
  4012. this.rohsCreatePartData.regionOfOrigin = val.region_of_origin
  4013. this.rohsCreatePartData.regionOfOriginDesc = val.region_of_origin_desc
  4014. } else if (this.rohsCreatePartTagNo === 129) {
  4015. this.rohsCreatePartData.customsStatNo = val.customs_stat_no
  4016. this.rohsCreatePartData.customsStatDesc = val.customs_stat_desc
  4017. } else if (this.rohsCreatePartTagNo === 131) {
  4018. this.rohsCreatePartData.partCostGroupId = val.part_cost_group_id
  4019. this.rohsCreatePartData.partCostGroupDesc = val.part_cost_group_desc
  4020. } else if (this.rohsCreatePartTagNo === 20) {
  4021. this.rohsCreatePartData.codeNo = val.Code_no
  4022. this.rohsCreatePartData.codeDesc = val.Code_desc
  4023. this.loadRohsPartItemListByCodeNo()
  4024. } else if (this.rohsCreatePartTagNo === 132) {
  4025. this.rohsCreatePartData.planningMethod = val.planning_method
  4026. this.rohsCreatePartData.planningMethodDesc = val.planning_method_desc
  4027. }
  4028. this.rohsCreatePartTagNo = 0
  4029. },
  4030. rohsCreateBaseFieldBlur (tagNo, codeKey, descKey, queryField, resultCodeField, resultDescField, withSite = true) {
  4031. this.rohsCreatePartData[codeKey] = (this.rohsCreatePartData[codeKey] || '').replace(/[\s\u00A0\u3000\u200B]/g, '')
  4032. if (!this.rohsCreatePartData[codeKey]) {
  4033. this.rohsCreatePartData[descKey] = ''
  4034. return
  4035. }
  4036. const site = this.rohsCreatePartData.site || this.modalData.site || this.$store.state.user.site
  4037. let conditionSql = " and " + queryField + " = '" + this.rohsCreatePartData[codeKey] + "'"
  4038. if (withSite) {
  4039. conditionSql += " and site = '" + site + "'"
  4040. }
  4041. const tempData = {
  4042. tagno: tagNo,
  4043. conditionSql: conditionSql
  4044. }
  4045. verifyData(tempData).then(({data}) => {
  4046. if (data && data.code === 0 && data.baseListData.length > 0) {
  4047. this.rohsCreatePartData[codeKey] = data.baseListData[0][resultCodeField]
  4048. this.rohsCreatePartData[descKey] = data.baseListData[0][resultDescField]
  4049. } else {
  4050. this.rohsCreatePartData[descKey] = ''
  4051. }
  4052. }).catch(() => {
  4053. this.rohsCreatePartData[descKey] = ''
  4054. })
  4055. },
  4056. rohsCreateHazardCodeBlur (tagNo) {
  4057. this.rohsCreateBaseFieldBlur(tagNo, 'hazardCode', 'hazardDesc', 'hazard_code', 'hazard_code', 'hazard_desc')
  4058. },
  4059. rohsCreateProductGroupId4Blur (tagNo) {
  4060. this.rohsCreateBaseFieldBlur(tagNo, 'productGroupId4', 'productGroupName4', 'product_group_id', 'product_group_id', 'product_group_name')
  4061. },
  4062. rohsCreateProductGroupId3Blur (tagNo) {
  4063. this.rohsCreateBaseFieldBlur(tagNo, 'productGroupId3', 'productGroupName3', 'product_group_id', 'product_group_id', 'product_group_name')
  4064. },
  4065. rohsCreateUmIdBlur (tagNo) {
  4066. this.rohsCreateBaseFieldBlur(tagNo, 'umId', 'umName', 'um_id', 'um_id', 'um_name', false)
  4067. },
  4068. rohsCreateGroupIdBlur (tagNo) {
  4069. this.rohsCreateBaseFieldBlur(tagNo, 'groupId', 'groupName', 'group_id', 'group_id', 'group_name')
  4070. },
  4071. rohsCreateFamilyIdBlur (tagNo) {
  4072. this.rohsCreateBaseFieldBlur(tagNo, 'familyId', 'familyName', 'family_id', 'family_id', 'family_name')
  4073. },
  4074. rohsCreateAssetClassBlur (tagNo) {
  4075. this.rohsCreateBaseFieldBlur(tagNo, 'assetClass', 'assetClassDesc', 'asset_class', 'asset_class', 'asset_class_desc')
  4076. },
  4077. rohsCreatePartStatusBlur (tagNo) {
  4078. this.rohsCreateBaseFieldBlur(tagNo, 'partStatus', 'partStatusDesc', 'part_status', 'part_status', 'part_status_desc')
  4079. },
  4080. rohsCreateAbcClassBlur (tagNo) {
  4081. this.rohsCreateBaseFieldBlur(tagNo, 'abcClass', 'abcClassDesc', 'abc_class', 'abc_class', 'abc_class_desc')
  4082. },
  4083. rohsCreateCountryOfOriginBlur (tagNo) {
  4084. this.rohsCreateBaseFieldBlur(tagNo, 'countryOfOrigin', 'countryOfOriginDesc', 'country_of_origin', 'country_of_origin', 'country_of_origin_desc')
  4085. },
  4086. rohsCreateRegionOfOriginBlur (tagNo) {
  4087. this.rohsCreateBaseFieldBlur(tagNo, 'regionOfOrigin', 'regionOfOriginDesc', 'region_of_origin', 'region_of_origin', 'region_of_origin_desc')
  4088. },
  4089. rohsCreateCustomsStatNoBlur (tagNo) {
  4090. this.rohsCreateBaseFieldBlur(tagNo, 'customsStatNo', 'customsStatDesc', 'customs_stat_no', 'customs_stat_no', 'customs_stat_desc')
  4091. },
  4092. rohsCreatePartCostGroupIdBlur (tagNo) {
  4093. this.rohsCreateBaseFieldBlur(tagNo, 'partCostGroupId', 'partCostGroupDesc', 'part_cost_group_id', 'part_cost_group_id', 'part_cost_group_desc')
  4094. },
  4095. rohsCreatePlanningMethodBlur (tagNo) {
  4096. this.rohsCreateBaseFieldBlur(tagNo, 'planningMethod', 'planningMethodDesc', 'planning_method', 'planning_method', 'planning_method_desc')
  4097. },
  4098. rohsCreateCodeNoBlur (tagNo) {
  4099. this.rohsCreatePartData.codeNo = (this.rohsCreatePartData.codeNo || '').replace(/[\s\u00A0\u3000\u200B]/g, '')
  4100. if (!this.rohsCreatePartData.codeNo) {
  4101. this.rohsCreatePartData.codeDesc = ''
  4102. this.$set(this.rohsCreatePartData, 'partItemList', [])
  4103. this.rohsPartItemSelections = []
  4104. return
  4105. }
  4106. const site = this.rohsCreatePartData.site || this.modalData.site || this.$store.state.user.site
  4107. const tempData = {
  4108. tagno: tagNo,
  4109. conditionSql: " and Code_no = '" + this.rohsCreatePartData.codeNo + "'" + " and site = '" + site + "'"
  4110. }
  4111. verifyData(tempData).then(({data}) => {
  4112. if (data && data.code === 0 && data.baseListData.length > 0) {
  4113. this.rohsCreatePartData.codeNo = data.baseListData[0].Code_no
  4114. this.rohsCreatePartData.codeDesc = data.baseListData[0].Code_desc
  4115. this.loadRohsPartItemListByCodeNo()
  4116. } else {
  4117. this.rohsCreatePartData.codeDesc = ''
  4118. this.$set(this.rohsCreatePartData, 'partItemList', [])
  4119. this.rohsPartItemSelections = []
  4120. }
  4121. }).catch(() => {
  4122. this.rohsCreatePartData.codeDesc = ''
  4123. })
  4124. },
  4125. loadRohsPartItemListByCodeNo () {
  4126. if (!this.rohsCreatePartData.codeNo) {
  4127. this.$set(this.rohsCreatePartData, 'partItemList', [])
  4128. this.rohsPartItemSelections = []
  4129. return
  4130. }
  4131. const params = {
  4132. site: this.rohsCreatePartData.site || this.modalData.site || this.$store.state.user.site,
  4133. codeNo: this.rohsCreatePartData.codeNo,
  4134. recordType: 'IP'
  4135. }
  4136. getPartItemListByCodeNo(params).then(({data}) => {
  4137. if (data && data.code === 0) {
  4138. this.$set(this.rohsCreatePartData, 'partItemList', (data.rows || []).map(item => ({
  4139. ...item,
  4140. numValue: item.numValue === null ? undefined : item.numValue
  4141. })))
  4142. } else {
  4143. this.$set(this.rohsCreatePartData, 'partItemList', [])
  4144. }
  4145. this.rohsPartItemSelections = []
  4146. }).catch(() => {
  4147. this.$set(this.rohsCreatePartData, 'partItemList', [])
  4148. this.rohsPartItemSelections = []
  4149. })
  4150. },
  4151. rohsPartItemSelectionChange (selection) {
  4152. this.rohsPartItemSelections = selection || []
  4153. },
  4154. openRohsCharacteristicDialog () {
  4155. this.rohsCharacteristicSelections = []
  4156. this.rohsCharacteristicQueryData = {
  4157. propertiesItemNo: '',
  4158. itemDesc: ''
  4159. }
  4160. this.queryRohsCharacteristicOptions()
  4161. this.rohsCharacteristicDialogFlag = true
  4162. },
  4163. removeRohsPartItemRows () {
  4164. if (!this.rohsPartItemSelections || this.rohsPartItemSelections.length === 0) {
  4165. this.$message.warning('请选择要删除的属性!')
  4166. return
  4167. }
  4168. this.$confirm('请是否确认删除该属性记录?', '提示', {
  4169. confirmButtonText: '确定',
  4170. cancelButtonText: '取消',
  4171. type: 'warning'
  4172. }).then(() => {
  4173. const removeSet = new Set(this.rohsPartItemSelections.map(item => item.propertiesItemNo))
  4174. this.$set(this.rohsCreatePartData, 'partItemList', (this.rohsCreatePartData.partItemList || []).filter(item => !removeSet.has(item.propertiesItemNo)))
  4175. this.rohsPartItemSelections = []
  4176. }).catch(() => {})
  4177. },
  4178. queryRohsCharacteristicOptions () {
  4179. const itemNos = (this.rohsCreatePartData.partItemList || []).map(item => item.propertiesItemNo).filter(item => item).join(',')
  4180. const params = {
  4181. site: this.rohsCreatePartData.site || this.modalData.site || this.$store.state.user.site,
  4182. recordType: 'IP',
  4183. propertiesItemNo: this.rohsCharacteristicQueryData.propertiesItemNo,
  4184. itemDesc: this.rohsCharacteristicQueryData.itemDesc,
  4185. itemNos: itemNos
  4186. }
  4187. getPartItemExclusionAlreadyExists(params).then(({data}) => {
  4188. if (data && data.code === 0) {
  4189. this.rohsCharacteristicList = data.rows || []
  4190. } else {
  4191. this.rohsCharacteristicList = []
  4192. }
  4193. }).catch(() => {
  4194. this.rohsCharacteristicList = []
  4195. })
  4196. },
  4197. rohsCharacteristicRowClick (row) {
  4198. if (this.$refs.rohsCharacteristicTable) {
  4199. this.$refs.rohsCharacteristicTable.toggleRowSelection(row)
  4200. }
  4201. },
  4202. rohsCharacteristicSelectionChange (selection) {
  4203. this.rohsCharacteristicSelections = selection || []
  4204. },
  4205. saveRohsCharacteristics () {
  4206. if (!this.rohsCharacteristicSelections || this.rohsCharacteristicSelections.length === 0) {
  4207. this.$message.warning('请选择属性!')
  4208. return
  4209. }
  4210. const currentList = Array.isArray(this.rohsCreatePartData.partItemList) ? this.rohsCreatePartData.partItemList : []
  4211. const existSet = new Set(currentList.map(item => item.propertiesItemNo))
  4212. const appendList = this.rohsCharacteristicSelections.filter(item => item && item.propertiesItemNo && !existSet.has(item.propertiesItemNo)).map(item => ({
  4213. ...item,
  4214. numValue: item.numValue === null ? undefined : item.numValue
  4215. }))
  4216. if (appendList.length === 0) {
  4217. this.$message.warning('所选属性已存在')
  4218. return
  4219. }
  4220. this.$set(this.rohsCreatePartData, 'partItemList', [...currentList, ...appendList])
  4221. this.rohsCharacteristicDialogFlag = false
  4222. this.rohsCharacteristicSelections = []
  4223. },
  4224. validateRohsCreatePart () {
  4225. this.rohsCreatePartData.partNo = (this.rohsCreatePartData.partNo || '').replace(/[\s\u00A0\u3000\u200B]/g, '')
  4226. if (!this.rohsCreatePartData.partNo) {
  4227. this.$message.warning('请填写物料编码')
  4228. return false
  4229. }
  4230. if (!/^[A-Za-z0-9._-]+$/.test(this.rohsCreatePartData.partNo)) {
  4231. this.$message.warning('物料编码只能包含字母、数字、-、_、.')
  4232. return false
  4233. }
  4234. if (!this.rohsCreatePartData.partDesc || !String(this.rohsCreatePartData.partDesc).trim()) {
  4235. this.$message.warning('请填写物料名称')
  4236. return false
  4237. }
  4238. if (!this.rohsCreatePartData.partType) {
  4239. this.$message.warning('请选择零件类型')
  4240. return false
  4241. }
  4242. if (!this.rohsCreatePartData.umId) {
  4243. this.$message.warning('请选择计量单位')
  4244. return false
  4245. }
  4246. if (!this.rohsCreatePartData.productGroupId1 || !this.rohsCreatePartData.productGroupId2) {
  4247. this.$message.warning('请先在RoHS单据中维护商品组1/2')
  4248. return false
  4249. }
  4250. if (!this.rohsCreatePartData.productGroupId3) {
  4251. this.$message.warning('请选择会计组')
  4252. return false
  4253. }
  4254. if (!this.rohsCreatePartData.productGroupId4) {
  4255. this.$message.warning('请选择计划人')
  4256. return false
  4257. }
  4258. return true
  4259. },
  4260. appendCreatedPartToRohsMaterial (createdPart) {
  4261. const appendResult = this.appendMaterialRows([{
  4262. site: this.modalData.site,
  4263. referenceNo: this.modalData.referenceNo,
  4264. projectId: this.modalData.projectId,
  4265. testPartNo: createdPart.partNo,
  4266. finalPartNo: createdPart.partNo,
  4267. partDesc: createdPart.partDesc,
  4268. partStatus: createdPart.partStatus || 'A'
  4269. }])
  4270. if (!appendResult.appendedCount) {
  4271. this.$message.warning('IFS料号创建成功,但该料号已存在于材料列表')
  4272. return Promise.resolve()
  4273. }
  4274. if (!this.shouldPersistMaterialsImmediately()) {
  4275. this.$set(this.modalData, 'materialList', appendResult.materialList)
  4276. this.$message.success('IFS料号创建成功,已加入材料列表')
  4277. return Promise.resolve()
  4278. }
  4279. return this.persistMaterialList(appendResult.materialList, 'IFS料号创建成功并已关联到RoHS材料')
  4280. },
  4281. saveRohsCreatePart () {
  4282. if (!this.validateRohsCreatePart()) {
  4283. return
  4284. }
  4285. const payload = {
  4286. ...this.rohsCreatePartData,
  4287. site: this.modalData.site || this.$store.state.user.site,
  4288. buNo: this.modalData.process || '',
  4289. createBy: this.$store.state.user.name || '',
  4290. updateBy: this.$store.state.user.name || '',
  4291. partDesc: (this.rohsCreatePartData.partDesc || '').trim(),
  4292. productGroupId1: this.modalData.commGroup1 || this.rohsCreatePartData.productGroupId1,
  4293. productGroupName1: this.modalData.commGroup1Desc || this.rohsCreatePartData.productGroupName1,
  4294. productGroupId2: this.modalData.commGroup2 || this.rohsCreatePartData.productGroupId2,
  4295. productGroupName2: this.modalData.commGroup2Desc || this.rohsCreatePartData.productGroupName2,
  4296. productGroupId3: this.rohsCreatePartData.productGroupId3,
  4297. productGroupName3: this.rohsCreatePartData.productGroupName3,
  4298. commGroup3: this.modalData.commGroup3 || this.rohsCreatePartData.commGroup3,
  4299. commGroup3Desc: this.modalData.commGroup3Desc || this.rohsCreatePartData.commGroup3Desc,
  4300. status: 'Y',
  4301. showInQueryFlag: 'Y',
  4302. temporaryPartFlag: 'N',
  4303. ifsPartNo: this.rohsCreatePartData.partNo,
  4304. plmPartNo: this.rohsCreatePartData.partNo,
  4305. partItemList: Array.isArray(this.rohsCreatePartData.partItemList) ? this.rohsCreatePartData.partItemList : []
  4306. }
  4307. this.rohsCreatePartLoading = true
  4308. createOfficialPartForRohs(payload).then(({data}) => {
  4309. if (data && data.code === 0) {
  4310. this.appendCreatedPartToRohsMaterial(payload).then(() => {
  4311. this.rohsCreatePartDialogFlag = false
  4312. })
  4313. } else {
  4314. this.$message.error((data && data.msg) || '创建IFS料号失败')
  4315. }
  4316. }).catch(() => {
  4317. this.$message.error('创建IFS料号失败')
  4318. }).finally(() => {
  4319. this.rohsCreatePartLoading = false
  4320. })
  4321. },
  4322. openProjectMaterialDialog () {
  4323. if (!this.canEditRohsMaterial()) {
  4324. this.$message.warning('当前状态不允许编辑材料')
  4325. return
  4326. }
  4327. this.projectMaterialDialogFlag = true
  4328. this.projectMaterialPageIndex = 1
  4329. this.searchProjectMaterialList()
  4330. },
  4331. searchProjectMaterialList () {
  4332. this.projectMaterialLoading = true
  4333. const params = {
  4334. page: this.projectMaterialPageIndex,
  4335. limit: this.projectMaterialPageSize,
  4336. site: this.$store.state.user.site,
  4337. partDesc: this.projectMaterialSearchData.partDesc,
  4338. finalPartNo: this.projectMaterialSearchData.finalPartNo,
  4339. partStatus: this.projectMaterialSearchData.partStatus
  4340. }
  4341. api.getRohsProjectMaterialList(params).then(({data}) => {
  4342. if (data && data.code === 0 && data.page) {
  4343. this.projectMaterialList = data.page.list || []
  4344. this.projectMaterialTotal = data.page.totalCount || 0
  4345. this.$nextTick(() => {
  4346. if (this.$refs.projectMaterialTable) {
  4347. this.$refs.projectMaterialTable.clearSelection()
  4348. }
  4349. })
  4350. } else {
  4351. this.projectMaterialList = []
  4352. this.projectMaterialTotal = 0
  4353. this.$message.error(data.msg || '物料查询失败')
  4354. }
  4355. this.projectMaterialLoading = false
  4356. }).catch(() => {
  4357. this.projectMaterialList = []
  4358. this.projectMaterialTotal = 0
  4359. this.projectMaterialLoading = false
  4360. })
  4361. },
  4362. projectMaterialSelectionChange (rows) {
  4363. this.projectMaterialSelections = rows || []
  4364. },
  4365. projectMaterialSizeChangeHandle (val) {
  4366. this.projectMaterialPageSize = val
  4367. this.projectMaterialPageIndex = 1
  4368. this.searchProjectMaterialList()
  4369. },
  4370. projectMaterialCurrentChangeHandle (val) {
  4371. this.projectMaterialPageIndex = val
  4372. this.searchProjectMaterialList()
  4373. },
  4374. confirmProjectMaterialSelection () {
  4375. if (!this.canEditRohsMaterial()) {
  4376. this.$message.warning('当前状态不允许编辑材料')
  4377. return
  4378. }
  4379. if (!this.projectMaterialSelections || this.projectMaterialSelections.length === 0) {
  4380. this.$message.warning('请至少选择一条物料')
  4381. return
  4382. }
  4383. const appendResult = this.appendMaterialRows(this.projectMaterialSelections)
  4384. if (!appendResult.appendedCount) {
  4385. this.$message.warning('所选物料已存在,未新增数据')
  4386. return
  4387. }
  4388. if (!this.shouldPersistMaterialsImmediately()) {
  4389. this.$set(this.modalData, 'materialList', appendResult.materialList)
  4390. this.projectMaterialDialogFlag = false
  4391. this.$message.success('已加入材料列表,保存单据后写入数据库')
  4392. return
  4393. }
  4394. this.$confirm('确认新增选中材料?', '提示', {
  4395. confirmButtonText: '确定',
  4396. cancelButtonText: '取消',
  4397. type: 'warning'
  4398. }).then(() => {
  4399. this.persistMaterialList(appendResult.materialList, '新增材料成功', () => {
  4400. this.projectMaterialDialogFlag = false
  4401. this.projectMaterialSelections = []
  4402. if (this.$refs.projectMaterialTable) {
  4403. this.$refs.projectMaterialTable.clearSelection()
  4404. }
  4405. })
  4406. }).catch(() => {})
  4407. },
  4408. appendMaterialRows (rows) {
  4409. const materialList = Array.isArray(this.modalData.materialList) ? [...this.modalData.materialList] : []
  4410. const exists = new Set(materialList.map(item => item.testPartNo))
  4411. let appendedCount = 0
  4412. rows.forEach(row => {
  4413. const testPartNo = row.testPartNo || row.test_part_no
  4414. if (!testPartNo || exists.has(testPartNo)) {
  4415. return
  4416. }
  4417. exists.add(testPartNo)
  4418. appendedCount++
  4419. materialList.push({
  4420. site: this.modalData.site,
  4421. referenceNo: this.modalData.referenceNo,
  4422. projectId: this.modalData.projectId,
  4423. testPartNo: testPartNo,
  4424. finalPartNo: row.finalPartNo || row.final_part_no || '',
  4425. partDesc: row.partDesc || row.part_desc || '',
  4426. partStatus: row.partStatus || row.part_status || ''
  4427. })
  4428. })
  4429. return {
  4430. materialList,
  4431. appendedCount
  4432. }
  4433. },
  4434. materialSelectionChange (rows) {
  4435. this.materialSelections = rows || []
  4436. },
  4437. shouldPersistMaterialsImmediately () {
  4438. return this.modalTitle === 'RoHS 编辑' && this.modalData && this.modalData.referenceNo && !String(this.modalData.referenceNo).startsWith('TEMP-')
  4439. },
  4440. normalizeMaterialListForSave (materialList) {
  4441. return (materialList || []).map((item, index) => {
  4442. return {
  4443. site: item.site || this.modalData.site || '',
  4444. referenceNo: item.referenceNo || this.modalData.referenceNo || '',
  4445. projectId: item.projectId || this.modalData.projectId || '',
  4446. testPartNo: item.testPartNo || item.test_part_no || '',
  4447. finalPartNo: item.finalPartNo || item.final_part_no || '',
  4448. partDesc: item.partDesc || item.part_desc || '',
  4449. partStatus: item.partStatus || item.part_status || '',
  4450. lineNo: index + 1
  4451. }
  4452. }).filter(item => item.testPartNo)
  4453. },
  4454. persistMaterialList (materialList, successMsg, successCallback) {
  4455. const normalizedList = this.normalizeMaterialListForSave(materialList)
  4456. const payload = {
  4457. site: this.modalData.site,
  4458. referenceNo: this.modalData.referenceNo,
  4459. projectId: this.modalData.projectId,
  4460. materialList: normalizedList
  4461. }
  4462. return api.updateRohsMaterials(payload).then(({data}) => {
  4463. if (data && data.code === 0) {
  4464. this.$set(this.modalData, 'materialList', normalizedList)
  4465. this.materialSelections = []
  4466. if (this.currentRow && this.currentRow.referenceNo === this.modalData.referenceNo) {
  4467. this.$set(this.currentRow, 'materialList', normalizedList)
  4468. }
  4469. this.$message.success(successMsg || '保存成功')
  4470. if (typeof successCallback === 'function') {
  4471. successCallback()
  4472. }
  4473. } else {
  4474. this.$message.error((data && data.msg) || '保存失败')
  4475. }
  4476. }).catch(() => {
  4477. this.$message.error('保存失败')
  4478. })
  4479. },
  4480. removeSelectedMaterialRows () {
  4481. if (!this.canEditRohsMaterial()) {
  4482. this.$message.warning('当前状态不允许编辑材料')
  4483. return
  4484. }
  4485. if (!this.materialSelections || this.materialSelections.length === 0) {
  4486. this.$message.warning('请先选择要删除的材料')
  4487. return
  4488. }
  4489. const removeSet = new Set(this.materialSelections.map(item => item.testPartNo))
  4490. const materialList = (this.modalData.materialList || []).filter(item => !removeSet.has(item.testPartNo))
  4491. if (!this.shouldPersistMaterialsImmediately()) {
  4492. this.$set(this.modalData, 'materialList', materialList)
  4493. this.materialSelections = []
  4494. this.$message.success('已删除材料,保存单据后写入数据库')
  4495. return
  4496. }
  4497. this.$confirm('确认删除选中材料?', '提示', {
  4498. confirmButtonText: '确定',
  4499. cancelButtonText: '取消',
  4500. type: 'warning'
  4501. }).then(() => {
  4502. this.persistMaterialList(materialList, '删除材料成功')
  4503. }).catch(() => {})
  4504. },
  4505. // ======== chooseList相关方法 ========
  4506. // 获取基础数据列表
  4507. getBaseList (val, type) {
  4508. this.tagNo = val
  4509. this.tagNo1 = type
  4510. this.$nextTick(() => {
  4511. let strVal = ''
  4512. let conSql = ''
  4513. if (val === 102) {
  4514. if (type === 1) {
  4515. strVal = this.modalData.endCustomer
  4516. conSql = " order by Customer_no "
  4517. }
  4518. }
  4519. if (val === 103 || val === 2001 || val === 2054) {
  4520. if (type === 1) {
  4521. strVal = this.modalData.applicant
  4522. } else if (type === 3) {
  4523. strVal = this.modalData.npdEngineer
  4524. } else if (type === 4) {
  4525. strVal = this.modalData.technicalPlan
  4526. } else if (type === 5) {
  4527. strVal = this.modalData.pm
  4528. }
  4529. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  4530. }
  4531. if (val === 2000) {
  4532. strVal = this.modalData.buyer
  4533. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  4534. }
  4535. if (val === 110) {
  4536. strVal = this.modalData.commGroup1
  4537. }
  4538. if (val === 111) {
  4539. strVal = this.modalData.commGroup2
  4540. }
  4541. if (val === 130) {
  4542. strVal = this.modalData.commGroup3
  4543. }
  4544. this.$refs.baseList.init(val, strVal, conSql)
  4545. })
  4546. },
  4547. // 列表方法的回调
  4548. getBaseData (val) {
  4549. if (this.rohsCreatePartDialogFlag && this.rohsCreatePartTagNo) {
  4550. this.applyRohsCreatePartBaseData(val)
  4551. return
  4552. }
  4553. if (this.tagNo === 102) {
  4554. if (this.tagNo1 === 1) {
  4555. if (val.Customer_no === this.modalData.endCustomer) {
  4556. return
  4557. }
  4558. if (this.modalData.projectIdFlag) {
  4559. this.modalData.projectIdFlag = false
  4560. }
  4561. this.modalData.endCustomer = val.Customer_no
  4562. this.modalData.endCustomerName = val.Customer_desc
  4563. this.modalData.projectId = ''
  4564. this.modalData.projectName = ''
  4565. this.$set(this.modalData, 'materialList', [])
  4566. }
  4567. }
  4568. if (this.tagNo === 103 || this.tagNo === 2001 || this.tagNo === 2054) {
  4569. if (this.tagNo1 === 1) {
  4570. this.modalData.applicant = val.username
  4571. this.modalData.applicantName = val.user_display
  4572. } else if (this.tagNo1 === 3) {
  4573. this.modalData.npdEngineer = val.username
  4574. this.modalData.npdEngineerName = val.user_display
  4575. } else if (this.tagNo1 === 4) {
  4576. this.modalData.technicalPlan = val.username
  4577. this.modalData.technicalPlanName = val.user_display
  4578. } else if (this.tagNo1 === 5) {
  4579. this.modalData.pm = val.username
  4580. this.modalData.pmName = val.user_display
  4581. }
  4582. }
  4583. if (this.tagNo === 110) {
  4584. this.modalData.commGroup1 = val.product_group_id
  4585. this.modalData.commGroup1Desc = val.product_group_name
  4586. }
  4587. if (this.tagNo === 111) {
  4588. this.modalData.commGroup2 = val.product_group_id
  4589. this.modalData.commGroup2Desc = val.product_group_name
  4590. }
  4591. if (this.tagNo === 130) {
  4592. this.modalData.commGroup3 = val.product_group_id
  4593. this.modalData.commGroup3Desc = val.product_group_name
  4594. }
  4595. if (this.tagNo === 2000) {
  4596. this.modalData.buyer = val.username
  4597. this.modalData.buyerName = val.user_display
  4598. }
  4599. },
  4600. handleQueryCustomer() {
  4601. if (!this.modalData.endCustomer) {
  4602. this.modalData.endCustomerName = ''
  4603. this.modalData.projectId = ''
  4604. this.modalData.projectName = ''
  4605. this.modalData.projectIdFlag = true
  4606. this.$set(this.modalData, 'materialList', [])
  4607. return
  4608. }
  4609. let params = {
  4610. site: this.$store.state.user.site,
  4611. customerNo: this.modalData.endCustomer
  4612. }
  4613. queryCustomer(params).then(({data}) => {
  4614. if (data && data.code === 0) {
  4615. if (data.rows && data.rows.length === 1) {
  4616. const customer = data.rows[0]
  4617. this.modalData.endCustomerName = customer.customerDesc || customer.Customer_desc || customer.customerName || ''
  4618. this.modalData.projectIdFlag = !!this.modalData.endCustomerFlag
  4619. } else {
  4620. this.modalData.endCustomerName = ''
  4621. this.modalData.projectId = ''
  4622. this.modalData.projectName = ''
  4623. this.modalData.projectIdFlag = true
  4624. this.$set(this.modalData, 'materialList', [])
  4625. }
  4626. } else {
  4627. this.modalData.endCustomerName = ''
  4628. this.modalData.projectId = ''
  4629. this.modalData.projectName = ''
  4630. this.modalData.projectIdFlag = true
  4631. this.$set(this.modalData, 'materialList', [])
  4632. }
  4633. }).catch((error) => {
  4634. this.modalData.endCustomerName = ''
  4635. this.modalData.projectId = ''
  4636. this.modalData.projectName = ''
  4637. this.modalData.projectIdFlag = true
  4638. this.$set(this.modalData, 'materialList', [])
  4639. })
  4640. },
  4641. handleQueryProjectByCustomer() {
  4642. if (!this.modalData.projectId) {
  4643. this.modalData.projectName = ''
  4644. return
  4645. }
  4646. let params = {
  4647. site: this.$store.state.user.site,
  4648. projectId: this.modalData.projectId
  4649. }
  4650. if (this.modalData.endCustomer) {
  4651. params.customerId = this.modalData.endCustomer
  4652. }
  4653. queryProjectByCustomer(params).then(({data}) => {
  4654. if (data && data.code === 0) {
  4655. if (data.rows && data.rows.length === 1) {
  4656. const project = data.rows[0]
  4657. this.modalData.projectName = project.projectName || project.Project_name || ''
  4658. } else {
  4659. this.modalData.projectName = ''
  4660. }
  4661. } else {
  4662. this.modalData.projectName = ''
  4663. }
  4664. }).catch((error) => {
  4665. this.modalData.projectName = ''
  4666. })
  4667. },
  4668. projectClickRow(row) {
  4669. const oldProjectId = this.modalData.projectId
  4670. this.modalData.projectId = row.projectId
  4671. this.modalData.projectName = row.projectName
  4672. if (this.modalData.endCustomer && this.modalData.endCustomer !== '') {
  4673. // do nothing
  4674. } else {
  4675. this.modalData.endCustomer = row.customerId
  4676. this.modalData.endCustomerName = row.customerName
  4677. }
  4678. if (oldProjectId && oldProjectId !== row.projectId) {
  4679. this.$set(this.modalData, 'materialList', [])
  4680. }
  4681. this.chooseProjectListFlag = false
  4682. },
  4683. searchProjectInfoList() {
  4684. this.projectList = [];
  4685. if (this.modalData.endCustomer && this.modalData.endCustomer !== '') {
  4686. this.searchProjectData.customerId = this.modalData.endCustomer
  4687. } else {
  4688. this.searchProjectData.customerId = undefined
  4689. }
  4690. this.searchProjectData.site = this.$store.state.user.site
  4691. searchProjectInfoList(this.searchProjectData).then(({data}) => {
  4692. if (data && data.code === 0) {
  4693. const rows = data.rows || []
  4694. this.projectList = rows
  4695. if ((!this.modalData.endCustomer || this.modalData.endCustomer === '') && rows.length > 0) {
  4696. this.modalData.projectId = rows[0].projectId
  4697. this.modalData.projectName = rows[0].projectName
  4698. this.modalData.endCustomer = rows[0].customerId
  4699. this.modalData.endCustomerName = rows[0].customerName
  4700. }
  4701. } else {
  4702. this.projectList = []
  4703. }
  4704. }).catch((error) => {
  4705. this.$message.error('查询项目信息失败')
  4706. })
  4707. },
  4708. closeProjectInfoDialog() {
  4709. if(this.$refs.closeProjectInfoForm) {
  4710. this.$refs.closeProjectInfoForm.resetFields();
  4711. }
  4712. this.searchProjectData = {
  4713. site: this.$store.state.user.site,
  4714. projectId: undefined,
  4715. projectName: undefined,
  4716. customerId: undefined,
  4717. }
  4718. },
  4719. // 申请人输入校验
  4720. applicantBlur (tagNo) {
  4721. if (this.modalData.applicant != null && this.modalData.applicant !== '') {
  4722. let tempData = {
  4723. tagno: tagNo,
  4724. conditionSql: " and a.username = '" + this.modalData.applicant + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  4725. }
  4726. verifyData(tempData).then(({data}) => {
  4727. if (data && data.code === 0) {
  4728. if (data.baseListData.length > 0) {
  4729. this.modalData.applicant = data.baseListData[0].username
  4730. this.modalData.applicantName = data.baseListData[0].user_display
  4731. return
  4732. }
  4733. }
  4734. this.modalData.applicantName = ''
  4735. })
  4736. } else {
  4737. this.modalData.applicantName = ''
  4738. }
  4739. },
  4740. // PM输入校验
  4741. pmBlur (tagNo) {
  4742. if (this.modalData.pm != null && this.modalData.pm !== '') {
  4743. let tempData = {
  4744. tagno: tagNo,
  4745. conditionSql: " and a.username = '" + this.modalData.pm + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  4746. }
  4747. verifyData(tempData).then(({data}) => {
  4748. if (data && data.code === 0) {
  4749. if (data.baseListData.length > 0) {
  4750. this.modalData.pm = data.baseListData[0].username
  4751. this.modalData.pmName = data.baseListData[0].user_display
  4752. return
  4753. }
  4754. }
  4755. this.modalData.pmName = ''
  4756. })
  4757. } else {
  4758. this.modalData.pmName = ''
  4759. }
  4760. },
  4761. // NPD工程师输入校验
  4762. npdEngineerBlur (tagNo) {
  4763. if (this.modalData.npdEngineer != null && this.modalData.npdEngineer !== '') {
  4764. let tempData = {
  4765. tagno: tagNo,
  4766. conditionSql: " and a.username = '" + this.modalData.npdEngineer + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  4767. }
  4768. verifyData(tempData).then(({data}) => {
  4769. if (data && data.code === 0) {
  4770. if (data.baseListData.length > 0) {
  4771. this.modalData.npdEngineer = data.baseListData[0].username
  4772. this.modalData.npdEngineerName = data.baseListData[0].user_display
  4773. return
  4774. }
  4775. }
  4776. this.modalData.npdEngineerName = ''
  4777. })
  4778. } else {
  4779. this.modalData.npdEngineerName = ''
  4780. }
  4781. },
  4782. // 技术计划输入校验
  4783. technicalPlanBlur (tagNo) {
  4784. if (this.modalData.technicalPlan != null && this.modalData.technicalPlan !== '') {
  4785. let tempData = {
  4786. tagno: tagNo,
  4787. conditionSql: " and a.username = '" + this.modalData.technicalPlan + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  4788. }
  4789. verifyData(tempData).then(({data}) => {
  4790. if (data && data.code === 0) {
  4791. if (data.baseListData.length > 0) {
  4792. this.modalData.technicalPlan = data.baseListData[0].username
  4793. this.modalData.technicalPlanName = data.baseListData[0].user_display
  4794. return
  4795. }
  4796. }
  4797. this.modalData.technicalPlanName = ''
  4798. })
  4799. } else {
  4800. this.modalData.technicalPlanName = ''
  4801. }
  4802. },
  4803. // 采购输入校验
  4804. buyerBlur (tagNo) {
  4805. if (this.modalData.buyer != null && this.modalData.buyer !== '') {
  4806. let tempData = {
  4807. tagno: tagNo,
  4808. conditionSql: " and a.username = '" + this.modalData.buyer + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  4809. }
  4810. verifyData(tempData).then(({data}) => {
  4811. if (data && data.code === 0) {
  4812. if (data.baseListData.length > 0) {
  4813. this.modalData.buyer = data.baseListData[0].username
  4814. this.modalData.buyerName = data.baseListData[0].user_display
  4815. return
  4816. }
  4817. }
  4818. this.modalData.buyerName = ''
  4819. })
  4820. } else {
  4821. this.modalData.buyerName = ''
  4822. }
  4823. },
  4824. // 商品组1输入校验
  4825. commGroup1Blur (tagNo) {
  4826. if (this.modalData.commGroup1 != null && this.modalData.commGroup1 !== '') {
  4827. let tempData = {
  4828. tagno: tagNo,
  4829. conditionSql: " and product_group_id = '" + this.modalData.commGroup1 + "'" + " and site = '" + this.$store.state.user.site + "'"
  4830. }
  4831. verifyData(tempData).then(({data}) => {
  4832. if (data && data.code === 0 && data.baseListData.length > 0) {
  4833. this.modalData.commGroup1 = data.baseListData[0].product_group_id
  4834. this.modalData.commGroup1Desc = data.baseListData[0].product_group_name
  4835. } else {
  4836. this.modalData.commGroup1Desc = ''
  4837. }
  4838. })
  4839. } else {
  4840. this.modalData.commGroup1Desc = ''
  4841. }
  4842. },
  4843. // 商品组2输入校验
  4844. commGroup2Blur (tagNo) {
  4845. if (this.modalData.commGroup2 != null && this.modalData.commGroup2 !== '') {
  4846. let tempData = {
  4847. tagno: tagNo,
  4848. conditionSql: " and product_group_id = '" + this.modalData.commGroup2 + "'" + " and site = '" + this.$store.state.user.site + "'"
  4849. }
  4850. verifyData(tempData).then(({data}) => {
  4851. if (data && data.code === 0 && data.baseListData.length > 0) {
  4852. this.modalData.commGroup2 = data.baseListData[0].product_group_id
  4853. this.modalData.commGroup2Desc = data.baseListData[0].product_group_name
  4854. } else {
  4855. this.modalData.commGroup2Desc = ''
  4856. }
  4857. })
  4858. } else {
  4859. this.modalData.commGroup2Desc = ''
  4860. }
  4861. },
  4862. // 商品组3输入校验
  4863. commGroup3Blur (tagNo) {
  4864. if (this.modalData.commGroup3 != null && this.modalData.commGroup3 !== '') {
  4865. let tempData = {
  4866. tagno: tagNo,
  4867. conditionSql: " and product_group_id = '" + this.modalData.commGroup3 + "'" + " and site = '" + this.$store.state.user.site + "'"
  4868. }
  4869. verifyData(tempData).then(({data}) => {
  4870. if (data && data.code === 0 && data.baseListData.length > 0) {
  4871. this.modalData.commGroup3 = data.baseListData[0].product_group_id
  4872. this.modalData.commGroup3Desc = data.baseListData[0].product_group_name
  4873. } else {
  4874. this.modalData.commGroup3Desc = ''
  4875. }
  4876. })
  4877. } else {
  4878. this.modalData.commGroup3Desc = ''
  4879. }
  4880. }
  4881. }
  4882. }
  4883. </script>
  4884. <style scoped lang="scss">
  4885. /deep/ .customer-tab .el-tabs__content {
  4886. padding: 0 !important;
  4887. }
  4888. /deep/ .rohs-material-table .el-table__header-wrapper th > .cell {
  4889. white-space: nowrap;
  4890. word-break: keep-all;
  4891. }
  4892. /deep/ .rohs-multiple-two-rows.el-select .el-input__inner,
  4893. /deep/ .rohs-multiple-two-rows .el-select .el-input__inner {
  4894. min-height: 62px !important;
  4895. height: auto !important;
  4896. padding-top: 6px !important;
  4897. padding-bottom: 6px !important;
  4898. }
  4899. /deep/ .rohs-multiple-two-rows.el-select .el-select__tags,
  4900. /deep/ .rohs-multiple-two-rows .el-select .el-select__tags {
  4901. max-width: calc(100% - 34px) !important;
  4902. max-height: 50px;
  4903. overflow-y: auto;
  4904. overflow-x: hidden;
  4905. white-space: normal;
  4906. }
  4907. /deep/ .rohs-multiple-two-rows.el-select .el-select__tags > span,
  4908. /deep/ .rohs-multiple-two-rows .el-select .el-select__tags > span {
  4909. display: inline;
  4910. max-width: 100%;
  4911. white-space: normal;
  4912. }
  4913. /deep/ .rohs-multiple-two-rows.el-select .el-select__tags .el-tag,
  4914. /deep/ .rohs-multiple-two-rows .el-select .el-select__tags .el-tag {
  4915. display: inline-flex;
  4916. max-width: 100%;
  4917. height: auto;
  4918. line-height: 16px;
  4919. padding-top: 2px;
  4920. padding-bottom: 2px;
  4921. margin-right: 4px;
  4922. white-space: normal;
  4923. vertical-align: middle;
  4924. }
  4925. /deep/ .rohs-multiple-two-rows.el-select .el-select__tags .el-tag .el-select__tags-text,
  4926. /deep/ .rohs-multiple-two-rows .el-select .el-select__tags .el-tag .el-select__tags-text {
  4927. white-space: normal;
  4928. word-break: break-all;
  4929. }
  4930. </style>