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.

2695 lines
120 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="节点审批人">
  16. <el-input v-model="searchData.currentApprover" clearable style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item label="当前节点">
  19. <el-select v-model="searchData.nodeId" placeholder="请选择节点" clearable style="width: 120px">
  20. <el-option
  21. v-for="option in nodeOptions"
  22. :key="option.id"
  23. :label="option.name"
  24. :value="option.id">
  25. </el-option>
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item :label="' '">
  29. <el-button v-if="authSearch" @click="getDataList">查询</el-button>
  30. <el-button v-if="authUpdate" @click="addOrUpdateHandle()">新增</el-button>
  31. <el-button v-if="authSearch" @click="exportHandle()">导出</el-button>
  32. <el-button v-if="authSearch" @click="searchHandle()">搜索</el-button>
  33. </el-form-item>
  34. </el-form>
  35. <!-- 列表 -->
  36. <el-table
  37. ref="rohsTable"
  38. :height="height"
  39. :data="dataList"
  40. border
  41. :row-style="rowStyle"
  42. @row-click="changeClickRow"
  43. @current-change="currentChange"
  44. v-loading="dataListLoading"
  45. style="width: 100%;">
  46. <el-table-column prop="referenceNo" header-align="center" align="center" label="序列号" width="165"></el-table-column>
  47. <el-table-column prop="status" header-align="center" align="center" label="单据状态" width="120"></el-table-column>
  48. <el-table-column prop="nodeId" header-align="center" align="center" label="当前节点ID" width="130"></el-table-column>
  49. <el-table-column prop="nodeName" header-align="center" align="center" label="当前节点" width="150"></el-table-column>
  50. <el-table-column prop="currentApprover" header-align="center" align="center" label="当前节点审批人" width="170"></el-table-column>
  51. <el-table-column prop="applicant" header-align="center" align="center" label="申请人编码" width="130"></el-table-column>
  52. <el-table-column prop="applicantName" header-align="center" align="center" label="申请人名称" width="150"></el-table-column>
  53. <el-table-column prop="pm" header-align="center" align="center" label="PM编码" width="130"></el-table-column>
  54. <el-table-column prop="pmName" header-align="center" align="center" label="PM名称" width="150"></el-table-column>
  55. <el-table-column prop="applicationDate" header-align="center" align="center" label="申请日期" width="165"></el-table-column>
  56. <el-table-column prop="plannedMassProductionDate" header-align="center" align="center" label="计划转量产时间" width="210"></el-table-column>
  57. <el-table-column prop="process" header-align="center" align="center" label="工艺" width="120"></el-table-column>
  58. <el-table-column prop="color" header-align="center" align="center" label="颜色" width="120"></el-table-column>
  59. <el-table-column prop="vendorCode" header-align="center" align="center" label="供应商代码" width="160"></el-table-column>
  60. <el-table-column prop="vendorMaterialCode" header-align="center" align="center" label="供应商材料编号" width="200" :show-overflow-tooltip="true"></el-table-column>
  61. <el-table-column prop="materialClassify" header-align="center" align="center" label="材料分类" width="200" :show-overflow-tooltip="true"></el-table-column>
  62. <el-table-column prop="otherMaterialClassify" header-align="center" align="center" label="其他材料分类" width="210" :show-overflow-tooltip="true"></el-table-column>
  63. <el-table-column prop="materialUseFor" header-align="center" align="center" label="辅材用途" width="180" :show-overflow-tooltip="true"></el-table-column>
  64. <el-table-column prop="endCustomer" header-align="center" align="center" label="最终客户编码" width="160"></el-table-column>
  65. <el-table-column prop="endCustomerName" header-align="center" align="center" label="最终客户名称" width="180"></el-table-column>
  66. <el-table-column prop="projectId" header-align="center" align="center" label="项目编码" width="140"></el-table-column>
  67. <el-table-column prop="projectName" header-align="center" align="center" label="项目名称" width="180"></el-table-column>
  68. <el-table-column prop="commGroup1" header-align="center" align="center" label="商品组1编码" width="170"></el-table-column>
  69. <el-table-column prop="commGroup1Desc" header-align="center" align="center" label="商品组1名称" width="170"></el-table-column>
  70. <el-table-column prop="commGroup2" header-align="center" align="center" label="商品组2编码" width="170"></el-table-column>
  71. <el-table-column prop="commGroup2Desc" header-align="center" align="center" label="商品组2名称" width="170"></el-table-column>
  72. <el-table-column prop="commGroup3" header-align="center" align="center" label="商品组3编码" width="170"></el-table-column>
  73. <el-table-column prop="commGroup3Desc" header-align="center" align="center" label="商品组3名称" width="170"></el-table-column>
  74. <el-table-column prop="needCreateNumber" header-align="center" align="center" label="需创建内部编号" width="200"></el-table-column>
  75. <el-table-column prop="npdEngineer" header-align="center" align="center" label="NPD工程师编码" width="170"></el-table-column>
  76. <el-table-column prop="npdEngineerName" header-align="center" align="center" label="NPD工程师名称" width="170"></el-table-column>
  77. <el-table-column prop="materialValidityTime" header-align="center" align="center" label="材料有效期" width="200"></el-table-column>
  78. <el-table-column prop="needDeviation" header-align="center" align="center" label="是否需偏差许可" width="190"></el-table-column>
  79. <el-table-column prop="technicalPlan" header-align="center" align="center" label="技术计划编码" width="170"></el-table-column>
  80. <el-table-column prop="technicalPlanName" header-align="center" align="center" label="技术计划名称" width="170"></el-table-column>
  81. <el-table-column prop="buyer" header-align="center" align="center" label="采购编码" width="130"></el-table-column>
  82. <el-table-column prop="buyerName" header-align="center" align="center" label="采购名称" width="130"></el-table-column>
  83. <el-table-column prop="expectReportTime" header-align="center" align="center" label="报告时间(月)" width="200"></el-table-column>
  84. <el-table-column prop="sgsReportNumber" header-align="center" align="center" label="SGS报告编号" width="190" :show-overflow-tooltip="true"></el-table-column>
  85. <el-table-column prop="expiredDate" header-align="center" align="center" label="报告日期" width="165"></el-table-column>
  86. <el-table-column prop="validUntil" header-align="center" align="center" label="有效期" width="160"></el-table-column>
  87. <el-table-column prop="isMeetRohsRequirement" header-align="center" align="center" label="符合RoHS" width="170"></el-table-column>
  88. <el-table-column prop="isAhGrade" header-align="center" align="center" label="AH属性" width="140"></el-table-column>
  89. <el-table-column prop="hsfSupplierClassification" header-align="center" align="center" label="HSF供应商等级" width="220"></el-table-column>
  90. <el-table-column prop="hsfApprover" header-align="center" align="center" label="HSF审批人" width="240" :show-overflow-tooltip="true"></el-table-column>
  91. <el-table-column prop="relatedPeople" header-align="center" align="center" label="Inform Related people" width="200" :show-overflow-tooltip="true"></el-table-column>
  92. <el-table-column prop="isSameMaterialDiffSize" header-align="center" align="center" label="同材不同规格" width="220"></el-table-column>
  93. <el-table-column prop="ifsPartNo" header-align="center" align="center" label="IFS编号" width="150"></el-table-column>
  94. <el-table-column prop="remark" header-align="center" align="center" label="备注" width="220" :show-overflow-tooltip="true"></el-table-column>
  95. <el-table-column fixed="right" header-align="center" align="center" width="130" label="操作">
  96. <template slot-scope="scope">
  97. <el-link v-if="authUpdate && scope.row.status !== '已完成'" style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">编辑</el-link>
  98. <el-link v-if="authUpdate && scope.row.status === '已完成'" style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">详情</el-link>
  99. <el-link v-if="authIssue && scope.row.status === '草稿'" style="cursor: pointer; margin-left: 10px;" @click="issueModal(scope.row)">下达</el-link>
  100. </template>
  101. </el-table-column>
  102. </el-table>
  103. <!-- 分页 -->
  104. <el-pagination style="margin-top: 0px"
  105. @size-change="sizeChangeHandle"
  106. @current-change="currentChangeHandle"
  107. :current-page="pageIndex"
  108. :page-sizes="[20, 50, 100, 200, 500]"
  109. :page-size="pageSize"
  110. :total="totalPage"
  111. layout="total, sizes, prev, pager, next, jumper">
  112. </el-pagination>
  113. <!-- 编辑模态框 -->
  114. <el-dialog
  115. :title="modalTitle"
  116. :visible.sync="modalFlag"
  117. width="1010px"
  118. top="10vh"
  119. v-drag
  120. :close-on-click-modal="false"
  121. :showClose="false">
  122. <el-tabs tab-position="left" type="border-card" v-model="activeName" style="width: 100%;height: 650px;">
  123. <!-- 基本信息 -->
  124. <el-tab-pane label="基本信息" name="basicInfo">
  125. <div style="height: 635px">
  126. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  127. <el-form-item>
  128. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('applicant')" slot="label" @click="getBaseList(103, 1)"><a herf="#">申请人/Applicant</a></span>
  129. <span v-else slot="label">申请人/Applicant</span>
  130. <el-input v-model="modalData.applicant" @blur="applicantBlur(103)" :disabled="isRohsFieldDisabled('applicant')" style="width: 150px"></el-input>
  131. <el-input v-model="modalData.applicantName" disabled style="width: 240px"></el-input>
  132. </el-form-item>
  133. <el-form-item label="申请日期/Application Date">
  134. <el-date-picker v-model="modalData.applicationDate" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('applicationDate')" style="width: 190px" :editable=false></el-date-picker>
  135. </el-form-item>
  136. <el-form-item label="工艺/Process">
  137. <dict-data-select v-model="modalData.process" clearable :disabled="isRohsFieldDisabled('process')" style="width: 190px" dict-type="rohs_process"></dict-data-select>
  138. </el-form-item>
  139. </el-form>
  140. <el-form :inline="true" label-position="top" :model="modalData">
  141. <el-form-item label="供应商代码/Vendor Code">
  142. <el-input v-model="modalData.vendorCode" :disabled="isRohsFieldDisabled('vendorCode')" style="width: 150px"></el-input>
  143. </el-form-item>
  144. <el-form-item label="供应商材料编号/Vendor Material Code" style="margin-left: -10px">
  145. <el-input v-model="modalData.vendorMaterialCode" :disabled="isRohsFieldDisabled('vendorMaterialCode')" style="width: 240px"></el-input>
  146. </el-form-item>
  147. <el-form-item label="辅材用途/Material Use For">
  148. <el-input v-model="modalData.materialUseFor" :disabled="isRohsFieldDisabled('materialUseFor')" style="width: 190px"></el-input>
  149. </el-form-item>
  150. </el-form>
  151. <el-form :inline="true" label-position="top" :model="modalData">
  152. <el-form-item label="材料分类/Material Classify">
  153. <dict-data-select class="rohs-multiple-ellipsis" v-model="modalData.materialClassifyList" multiple :title="getMultipleSelectTitle(modalData.materialClassifyList)" :disabled="isRohsFieldDisabled('materialClassify')" style="width: 394px" dict-type="rohs_material_classify"></dict-data-select>
  154. </el-form-item>
  155. <el-form-item label="其他材料分类/Other Material Classify" v-if="modalData.materialClassifyList && modalData.materialClassifyList.includes('Other其他')">
  156. <el-input v-model="modalData.otherMaterialClassify" :disabled="isRohsFieldDisabled('otherMaterialClassify')" style="width: 190px"></el-input>
  157. </el-form-item>
  158. </el-form>
  159. <el-form :inline="true" label-position="top" :model="modalData">
  160. <el-form-item>
  161. <span slot="label" v-if="!modalData.endCustomerFlag && !isRohsFieldDisabled('endCustomer')" @click="getBaseList(102, 1)"><a herf="#">最终客户/End Customer</a></span>
  162. <span slot="label" v-else>最终客户/End Customer</span>
  163. <el-input :disabled="modalData.endCustomerFlag || isRohsFieldDisabled('endCustomer')" readonly v-model="modalData.endCustomer" @blur="handleQueryCustomer" style="width: 150px"></el-input>
  164. <el-input disabled v-model="modalData.endCustomerName" style="width: 240px"></el-input>
  165. </el-form-item>
  166. <el-form-item>
  167. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('pm')" slot="label" @click="getBaseList(103, 5)"><a herf="#">PM人员/PM</a></span>
  168. <span v-else slot="label">PM人员/PM</span>
  169. <el-input v-model="modalData.pm" @blur="pmBlur(103)" :disabled="isRohsFieldDisabled('pm')" style="width: 150px"></el-input>
  170. <el-input v-model="modalData.pmName" disabled style="width: 240px"></el-input>
  171. </el-form-item>
  172. </el-form>
  173. <el-form :inline="true" label-position="top" :model="modalData">
  174. <el-form-item>
  175. <span slot="label" v-if="!modalData.projectIdFlag && !isRohsFieldDisabled('projectId')" @click="chooseProjectListFlag = true"><a herf="#">项目编码/Project ID</a></span>
  176. <span slot="label" v-else>项目编码/Project ID</span>
  177. <el-input :disabled="modalData.projectIdFlag || isRohsFieldDisabled('projectId')" readonly v-model="modalData.projectId" @blur="handleQueryProjectByCustomer" style="width: 150px"></el-input>
  178. <el-input disabled v-model="modalData.projectName" style="width: 240px"></el-input>
  179. </el-form-item>
  180. <el-form-item label="颜色/Color">
  181. <el-input v-model="modalData.color" :disabled="isRohsFieldDisabled('color')" style="width: 150px"></el-input>
  182. </el-form-item>
  183. <el-form-item label="计划转量产时间/Planned Mass Production">
  184. <el-date-picker v-model="modalData.plannedMassProductionDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :disabled="isRohsFieldDisabled('plannedMassProductionDate')" style="width: 230px" :editable=false></el-date-picker>
  185. </el-form-item>
  186. </el-form>
  187. <el-form :inline="true" label-position="top" :model="modalData">
  188. <el-form-item>
  189. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('commGroup1')" slot="label" @click="getBaseList(110)"><a herf="#">商品组1 / Comm Group 1</a></span>
  190. <span v-else slot="label">商品组1 / Comm Group 1</span>
  191. <el-input v-model="modalData.commGroup1" @change="commGroup1Blur(110)" :disabled="isRohsFieldDisabled('commGroup1')" style="width: 150px"></el-input>
  192. <el-input v-model="modalData.commGroup1Desc" disabled style="width: 240px"></el-input>
  193. </el-form-item>
  194. <el-form-item label="是否需偏差许可/Need Deviation">
  195. <el-radio-group v-model="modalData.needDeviation" :disabled="isRohsFieldDisabled('needDeviation')" style="width: 190px">
  196. <el-radio label="Y" @click.native.prevent="radioClick('needDeviation', 'Y')"></el-radio>
  197. <el-radio label="N" @click.native.prevent="radioClick('needDeviation', 'N')"></el-radio>
  198. </el-radio-group>
  199. </el-form-item>
  200. </el-form>
  201. <el-form :inline="true" label-position="top" :model="modalData">
  202. <el-form-item>
  203. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('commGroup2')" slot="label" @click="getBaseList(111)"><a herf="#">商品组2 / Comm Group 2</a></span>
  204. <span v-else slot="label">商品组2 / Comm Group 2</span>
  205. <el-input v-model="modalData.commGroup2" @change="commGroup2Blur(111)" :disabled="isRohsFieldDisabled('commGroup2')" style="width: 150px"></el-input>
  206. <el-input v-model="modalData.commGroup2Desc" disabled style="width: 240px"></el-input>
  207. </el-form-item>
  208. <el-form-item label="需创建内部编号/Need Create No.">
  209. <el-radio-group v-model="modalData.needCreateNumber" :disabled="isRohsFieldDisabled('needCreateNumber')" style="width: 190px">
  210. <el-radio label="Y" @click.native.prevent="radioClick('needCreateNumber', 'Y')"></el-radio>
  211. <el-radio label="N" @click.native.prevent="radioClick('needCreateNumber', 'N')"></el-radio>
  212. </el-radio-group>
  213. </el-form-item>
  214. </el-form>
  215. <el-form :inline="true" label-position="top" :model="modalData">
  216. <el-form-item>
  217. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('commGroup3')" slot="label" @click="getBaseList(130)"><a herf="#">商品组3 / Comm Group 3</a></span>
  218. <span v-else slot="label">商品组3 / Comm Group 3</span>
  219. <el-input v-model="modalData.commGroup3" @change="commGroup3Blur(130)" :disabled="isRohsFieldDisabled('commGroup3')" style="width: 150px"></el-input>
  220. <el-input v-model="modalData.commGroup3Desc" disabled style="width: 240px"></el-input>
  221. </el-form-item>
  222. <el-form-item label="是否Fiber材料/Fiber Material">
  223. <el-radio-group v-model="modalData.isFiberMaterial" :disabled="isRohsFieldDisabled('isFiberMaterial')" style="width: 190px">
  224. <el-radio label="Y" @click.native.prevent="radioClick('isFiberMaterial', 'Y')"></el-radio>
  225. <el-radio label="N" @click.native.prevent="radioClick('isFiberMaterial', 'N')"></el-radio>
  226. </el-radio-group>
  227. </el-form-item>
  228. </el-form>
  229. <el-form :inline="true" label-position="top" :model="modalData">
  230. <el-form-item>
  231. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('npdEngineer')" slot="label" @click="getBaseList(103, 3)"><a herf="#">NPD工程师/NPD Engineer</a></span>
  232. <span v-else slot="label">NPD工程师/NPD Engineer</span>
  233. <el-input v-model="modalData.npdEngineer" @blur="npdEngineerBlur(103)" :disabled="isRohsFieldDisabled('npdEngineer')" style="width: 150px"></el-input>
  234. <el-input v-model="modalData.npdEngineerName" disabled style="width: 240px"></el-input>
  235. </el-form-item>
  236. <el-form-item label="WM所需求规格/WM Required Spec">
  237. <el-input v-model="modalData.wmRequiredSpec" :disabled="isRohsFieldDisabled('wmRequiredSpec')" style="width: 190px"></el-input>
  238. </el-form-item>
  239. <el-form-item label="材料厚度/Material Thickness">
  240. <el-input v-model="modalData.materialThickness" :disabled="isRohsFieldDisabled('materialThickness')" style="width: 190px"></el-input>
  241. </el-form-item>
  242. </el-form>
  243. <el-form :inline="true" label-position="top" :model="modalData">
  244. <el-form-item label="材料有效期/Material Validity Time">
  245. <el-date-picker v-model="modalData.materialValidityTime" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('materialValidityTime')" style="width: 190px" :editable=false></el-date-picker>
  246. </el-form-item>
  247. <el-form-item label="有效期备注/Validity Comments">
  248. <el-input v-model="modalData.materialValidityComments" :disabled="isRohsFieldDisabled('materialValidityComments')" style="width: 190px"></el-input>
  249. </el-form-item>
  250. <el-form-item label="报告时间(月)/Expect Report Time">
  251. <el-input class="inlineNumber numInput" v-model="modalData.expectReportTime" :disabled="isRohsFieldDisabled('expectReportTime')" type="number" style="width: 190px"></el-input>
  252. </el-form-item>
  253. <el-form-item label=" " style="margin-top: -2px;">
  254. <el-button type="primary" icon="el-icon-edit-outline" v-if="authDataEntry" @click="openRohsRemarkDialog">RoHs备注</el-button>
  255. </el-form-item>
  256. </el-form>
  257. <el-form :inline="true" label-position="top" :model="modalData">
  258. <el-form-item>
  259. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('technicalPlan')" slot="label" @click="getBaseList(103, 4)"><a herf="#">技术计划/Technical Plan</a></span>
  260. <span v-else slot="label">技术计划/Technical Plan</span>
  261. <el-input v-model="modalData.technicalPlan" @blur="technicalPlanBlur(103)" :disabled="isRohsFieldDisabled('technicalPlan')" style="width: 150px"></el-input>
  262. <el-input v-model="modalData.technicalPlanName" disabled style="width: 240px"></el-input>
  263. </el-form-item>
  264. <el-form-item>
  265. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('buyer')" slot="label" @click="getBaseList(2000, 2)"><a herf="#">采购/Buyer</a></span>
  266. <span v-else slot="label">采购/Buyer</span>
  267. <el-input v-model="modalData.buyer" @blur="buyerBlur(2000)" :disabled="isRohsFieldDisabled('buyer')" style="width: 150px"></el-input>
  268. <el-input v-model="modalData.buyerName" disabled style="width: 240px"></el-input>
  269. </el-form-item>
  270. </el-form>
  271. <el-form :inline="true" label-position="top" :model="modalData">
  272. <el-form-item label="所需审批文件/Docs Needed" >
  273. <dict-data-select class="rohs-multiple-ellipsis" v-model="modalData.qualificationDocumentsNeededList" multiple :title="getMultipleSelectTitle(modalData.qualificationDocumentsNeededList)" :disabled="isRohsFieldDisabled('qualificationDocumentsNeeded')" style="width: 394px" dict-type="rohs_qualification_docs"></dict-data-select>
  274. </el-form-item>
  275. <el-form-item label="测试报告必测项/Test Items">
  276. <dict-data-select class="rohs-multiple-ellipsis" v-model="modalData.testReportIncludingItemsList" multiple :title="getMultipleSelectTitle(modalData.testReportIncludingItemsList)" :disabled="isRohsFieldDisabled('testReportIncludingItems')" style="width: 394px" dict-type="rohs_test_report_items"></dict-data-select>
  277. </el-form-item>
  278. </el-form>
  279. <el-form :inline="true" label-position="top" :model="modalData">
  280. <el-form-item label="备注说明/Remark" style="display: block;">
  281. <el-input type="textarea" :rows="3" v-model="modalData.remark" :disabled="isRohsFieldDisabled('remark')" resize="none" style="width: 802px;height: 30px"></el-input>
  282. </el-form-item>
  283. </el-form>
  284. </div>
  285. </el-tab-pane>
  286. <!-- HSF 填写信息 -->
  287. <el-tab-pane label="HSF 填写信息" name="hsfInfo">
  288. <div style="height: 635px">
  289. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  290. <el-form-item label="SGS报告编号/SGS Report Number">
  291. <el-input v-model="modalData.sgsReportNumber" :disabled="isRohsFieldDisabled('sgsReportNumber')" style="width: 230px"></el-input>
  292. </el-form-item>
  293. <el-form-item label="报告日期/Expired Date">
  294. <el-date-picker v-model="modalData.expiredDate" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('expiredDate')" style="width: 180px" :editable=false></el-date-picker>
  295. </el-form-item>
  296. <el-form-item label="有效期/Valid Until">
  297. <dict-data-select v-model="modalData.validUntil" clearable :disabled="isRohsFieldDisabled('validUntil')" style="width: 180px" dict-type="rohs_valid_until"></dict-data-select>
  298. </el-form-item>
  299. </el-form>
  300. <el-form :inline="true" label-position="top" :model="modalData">
  301. <el-form-item label="是否符合RoHS/Meet RoHS Req">
  302. <el-radio-group v-model="modalData.isMeetRohsRequirement" :disabled="isRohsFieldDisabled('isMeetRohsRequirement')" style="width: 230px">
  303. <el-radio label="Y" @click.native.prevent="radioClick('isMeetRohsRequirement', 'Y')"></el-radio>
  304. <el-radio label="N" @click.native.prevent="radioClick('isMeetRohsRequirement', 'N')"></el-radio>
  305. </el-radio-group>
  306. </el-form-item>
  307. <el-form-item label="材料属性是否是AH/Is AH Grade">
  308. <el-radio-group v-model="modalData.isAhGrade" :disabled="isRohsFieldDisabled('isAhGrade')" style="width: 180px">
  309. <el-radio label="Y" @click.native.prevent="radioClick('isAhGrade', 'Y')"></el-radio>
  310. <el-radio label="N" @click.native.prevent="radioClick('isAhGrade', 'N')"></el-radio>
  311. </el-radio-group>
  312. </el-form-item>
  313. <el-form-item label="HSF供应商等级/Supplier Class">
  314. <el-radio-group v-model="modalData.hsfSupplierClassification" :disabled="isRohsFieldDisabled('hsfSupplierClassification')" style="width: 180px">
  315. <el-radio label="A类" @click.native.prevent="radioClick('hsfSupplierClassification', 'A类')">A类</el-radio>
  316. <el-radio label="B类" @click.native.prevent="radioClick('hsfSupplierClassification', 'B类')">B类</el-radio>
  317. <el-radio label="C类" @click.native.prevent="radioClick('hsfSupplierClassification', 'C类')">C类</el-radio>
  318. </el-radio-group>
  319. </el-form-item>
  320. </el-form>
  321. <el-form :inline="true" label-position="top" :model="modalData">
  322. <el-form-item label="Fiber报告信息/Fiber Information" style="display: block;">
  323. <el-input type="textarea" :rows="3" v-model="modalData.fiberInformation" :disabled="isRohsFieldDisabled('fiberInformation')" resize="none" style="width: 802px;height: 30px"></el-input>
  324. </el-form-item>
  325. </el-form>
  326. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 45px">
  327. <el-form-item>
  328. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('hsfApprover')" slot="label" @click="openHsfApproverChooseModal"><a herf="#">HSF审批人/HSF Approver</a></span>
  329. <span v-else slot="label">HSF审批人/HSF Approver</span>
  330. <el-input
  331. v-model="modalData.hsfApprover"
  332. readonly
  333. :disabled="isRohsFieldDisabled('hsfApprover')"
  334. style="width: 420px"
  335. placeholder="请选择人员"
  336. @focus="openHsfApproverChooseModal">
  337. </el-input>
  338. </el-form-item>
  339. </el-form>
  340. <el-form :inline="true" label-position="top" :model="modalData">
  341. <el-form-item label="Inform Related people">
  342. <el-select
  343. v-model="modalData.relatedPeople"
  344. clearable
  345. filterable
  346. :disabled="isRohsFieldDisabled('relatedPeople')"
  347. style="width: 420px"
  348. placeholder="请从HSF审批人中选择">
  349. <el-option
  350. v-for="item in (modalData.hsfApproverList || [])"
  351. :key="item"
  352. :label="item"
  353. :value="item">
  354. </el-option>
  355. </el-select>
  356. </el-form-item>
  357. </el-form>
  358. <el-form v-if="shouldShowHsfStandard(modalData.endCustomer)" :inline="true" label-position="top" :model="modalData" style="margin-top: 0px">
  359. <el-form-item label="HSF标准/HSF Standard" style="display: block;">
  360. <el-input type="textarea" :rows="3" v-model="modalData.hsfStandard" :disabled="isRohsFieldDisabled('hsfStandard')" resize="none" style="width: 802px;height: 30px"></el-input>
  361. </el-form-item>
  362. </el-form>
  363. </div>
  364. </el-tab-pane>
  365. <!-- NPD 信息 -->
  366. <el-tab-pane label="NPD 信息" name="npdInfo">
  367. <div style="height: 635px; overflow-y: auto;">
  368. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  369. <el-form-item label="现有材料不同规格/Same Material Diff Size">
  370. <el-radio-group v-model="modalData.isSameMaterialDiffSize" :disabled="isRohsFieldDisabled('isSameMaterialDiffSize')" style="width: 190px">
  371. <el-radio label="Y" @click.native.prevent="radioClick('isSameMaterialDiffSize', 'Y')"></el-radio>
  372. <el-radio label="N" @click.native.prevent="radioClick('isSameMaterialDiffSize', 'N')"></el-radio>
  373. </el-radio-group>
  374. </el-form-item>
  375. </el-form>
  376. <el-form :inline="true" label-position="top" :model="modalData">
  377. <el-form-item label="材料描述/Material Desc." style="display: block;">
  378. <el-input type="textarea" :rows="3" v-model="modalData.materialDesc" :disabled="isRohsFieldDisabled('materialDesc')" resize="none" style="width: 802px;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="备注说明/NPD Remark" style="display: block;">
  383. <el-input type="textarea" :rows="3" v-model="modalData.npdRemark" :disabled="isRohsFieldDisabled('npdRemark')" resize="none" style="width: 802px;height: 30px"></el-input>
  384. </el-form-item>
  385. </el-form>
  386. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 50px">
  387. <el-form-item label="TDS属性/TDS Property" style="display: block;">
  388. <oss-components
  389. :save-visible="authFileSave"
  390. :download-visible="authFileDownLoad"
  391. :remove-visible="authFileRemove"
  392. :preview-visible="authFilePreview"
  393. :disabled="showModalFlag || modalData.status === '已完成'"
  394. :enable-upgrade="!showModalFlag && modalData.status !== '已完成'"
  395. :require-file-no-rev="true"
  396. :auto-file-no="true"
  397. :single-upload="true"
  398. :row-click-select="true"
  399. :show-order-ref2="false"
  400. label="序列号"
  401. :height="350"
  402. style="margin-top: 2px"
  403. :columns="tdsFileColumnList"
  404. :order-ref1="modalData.site || ''"
  405. :order-ref2="modalData.referenceNo || ''"
  406. order-ref3="tdsProperty">
  407. </oss-components>
  408. </el-form-item>
  409. </el-form>
  410. </div>
  411. </el-tab-pane>
  412. <!-- 材料信息 -->
  413. <el-tab-pane label="材料信息" name="materialInfo">
  414. <div style="height: 635px">
  415. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -15px;">
  416. <el-form-item label=" ">
  417. <el-button type="primary" v-if="!showModalFlag && canEditRohsMaterial()" @click="openProjectMaterialDialog">新增材料</el-button>
  418. <el-button type="danger" v-if="!showModalFlag && canEditRohsMaterial()" @click="removeSelectedMaterialRows">删除材料</el-button>
  419. </el-form-item>
  420. </el-form>
  421. <el-table
  422. ref="rohsMaterialTable"
  423. class="rohs-material-table"
  424. border
  425. :data="modalData.materialList"
  426. @selection-change="materialSelectionChange"
  427. :header-cell-style="materialDialogHeaderCellStyle"
  428. :height="585"
  429. style="width: 100%">
  430. <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
  431. <el-table-column type="index" label="序号" width="50" header-align="center" align="center"></el-table-column>
  432. <el-table-column prop="testPartNo" label="PLM物料编码/Test Part No." min-width="180" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  433. <el-table-column prop="finalPartNo" label="IFS物料编码/Final Part No." min-width="180" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  434. <el-table-column prop="customerPartNo" label="客户料号/Customer Part No." min-width="180" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  435. <el-table-column prop="partDesc" label="描述/Part Desc." min-width="220" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  436. </el-table>
  437. </div>
  438. </el-tab-pane>
  439. <el-tab-pane label="附件信息" name="attachmentInfo">
  440. <div style="height: 635px">
  441. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -15px;">
  442. <el-form-item label=" ">
  443. <el-button type="primary" icon="el-icon-upload" @click="uploadDialog = true">上传附件</el-button>
  444. </el-form-item>
  445. </el-form>
  446. </div>
  447. </el-tab-pane>
  448. </el-tabs>
  449. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  450. <el-button type="primary" v-if="canSaveAction()" @click="dataFormSubmit()">保存</el-button>
  451. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  452. <el-button type="primary" v-if="canAgreeAction()" :loading="submitLoading" @click="agreeSubmit">同意</el-button>
  453. <el-button type="primary" v-if="canRejectAction()" :loading="submitLoading" @click="openRejectModal">驳回</el-button>
  454. </el-footer>
  455. </el-dialog>
  456. <upload-file-list
  457. v-if="modalFlag"
  458. folder="rohs"
  459. order-ref3="rohsAttachment"
  460. title="RoHs 附件上传"
  461. :label="'序列号'"
  462. :file-list.sync="fileList"
  463. :no="modalData.referenceNo"
  464. :upload-dialog.sync="uploadDialog"
  465. path="/upload/test">
  466. </upload-file-list>
  467. <!--选择项目模态框-->
  468. <el-dialog title="选择-项目" :close-on-click-modal="false" @close="closeProjectInfoDialog"
  469. @open="searchProjectInfoList" :visible.sync="chooseProjectListFlag" width="35%">
  470. <el-form label-position="top" :model="searchProjectData" ref="closeProjectInfoForm">
  471. <el-row :gutter="10">
  472. <el-col :span="6">
  473. <el-form-item label="项目号">
  474. <el-input v-model="searchProjectData.projectId"></el-input>
  475. </el-form-item>
  476. </el-col>
  477. <el-col :span="6">
  478. <el-form-item label="项目名称">
  479. <el-input v-model="searchProjectData.projectName"></el-input>
  480. </el-form-item>
  481. </el-col>
  482. <el-col :span="6">
  483. <el-form-item label=" ">
  484. <el-button type="primary" @click="searchProjectInfoList">查询</el-button>
  485. </el-form-item>
  486. </el-col>
  487. </el-row>
  488. <el-table :height="223"
  489. :data="projectList"
  490. border
  491. @row-click="projectClickRow">
  492. <el-table-column label="项目号" prop="projectId"/>
  493. <el-table-column label="项目名称" prop="projectName"/>
  494. </el-table>
  495. </el-form>
  496. <el-footer style="height:35px;margin-top: 10px;text-align:center">
  497. <el-button type="primary" @click="chooseProjectListFlag = false">关闭</el-button>
  498. </el-footer>
  499. </el-dialog>
  500. <el-dialog title="选择项目物料" top="15vh" width="75%" :close-on-click-modal="false" v-drag :visible.sync="projectMaterialDialogFlag">
  501. <el-form :inline="true" label-position="top" :model="projectMaterialSearchData">
  502. <el-form-item label="PLM物料编码/Test Part No.">
  503. <el-input v-model="projectMaterialSearchData.testPartNo" clearable style="width: 150px"></el-input>
  504. </el-form-item>
  505. <el-form-item label="描述/Part Desc">
  506. <el-input v-model="projectMaterialSearchData.partDesc" clearable style="width: 150px"></el-input>
  507. </el-form-item>
  508. <el-form-item label="IFS物料编码/Final Part No.">
  509. <el-input v-model="projectMaterialSearchData.finalPartNo" clearable style="width: 150px"></el-input>
  510. </el-form-item>
  511. <el-form-item label="客户料号/Customer Part No.">
  512. <el-input v-model="projectMaterialSearchData.customerPartNo" clearable style="width: 150px"></el-input>
  513. </el-form-item>
  514. <el-form-item label=" ">
  515. <el-button type="primary" @click="searchProjectMaterialList">查询</el-button>
  516. </el-form-item>
  517. </el-form>
  518. <el-table
  519. ref="projectMaterialTable"
  520. class="rohs-material-table"
  521. border
  522. v-loading="projectMaterialLoading"
  523. :data="projectMaterialList"
  524. @selection-change="projectMaterialSelectionChange"
  525. :header-cell-style="materialDialogHeaderCellStyle"
  526. :height="320"
  527. style="width: 100%">
  528. <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
  529. <el-table-column prop="testPartNo" label="PLM物料编码/Test Part No." min-width="180" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  530. <el-table-column prop="finalPartNo" label="IFS物料编码/Final Part No." min-width="180" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  531. <el-table-column prop="customerPartNo" label="客户料号/Customer Part No." min-width="180" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  532. <el-table-column prop="partDesc" label="描述/Part Desc." min-width="220" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  533. </el-table>
  534. <el-pagination
  535. style="margin-top: 10px"
  536. @size-change="projectMaterialSizeChangeHandle"
  537. @current-change="projectMaterialCurrentChangeHandle"
  538. :current-page="projectMaterialPageIndex"
  539. :page-sizes="[20, 50, 100]"
  540. :page-size="projectMaterialPageSize"
  541. :total="projectMaterialTotal"
  542. layout="total, sizes, prev, pager, next, jumper">
  543. </el-pagination>
  544. <el-footer style="height:35px;margin-top: 10px;text-align:center">
  545. <el-button type="primary" @click="confirmProjectMaterialSelection">确定</el-button>
  546. <el-button type="primary" @click="projectMaterialDialogFlag = false">关闭</el-button>
  547. </el-footer>
  548. </el-dialog>
  549. <el-dialog width="530px" title="HSF审批人" :close-on-click-modal="false" :visible.sync="hsfApproverFlag">
  550. <el-transfer
  551. v-model="hsfApproverTransferList"
  552. class="rq"
  553. filterable
  554. :props="hsfApproverOperatorProp"
  555. :data="hsfApproverOptionList"
  556. :titles="['未选择', '已选择']">
  557. </el-transfer>
  558. <span slot="footer" class="dialog-footer">
  559. <div style="margin-top: 5px">
  560. <el-button type="primary" @click="saveHsfApproverChooseModal">确定</el-button>
  561. <el-button type="primary" @click="hsfApproverFlag = false">取消</el-button>
  562. </div>
  563. </span>
  564. </el-dialog>
  565. <el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="submitModalFlag" width="500px">
  566. <el-form label-position="top">
  567. <el-form-item label="驳回意见/Reject Opinion">
  568. <el-input type="textarea" v-model="rejectOpinion" :rows="3" resize="none" show-word-limit style="width: 479px;height: 30px"></el-input>
  569. </el-form-item>
  570. </el-form>
  571. <el-footer style="height:35px;margin-top:50px;text-align:center">
  572. <el-button type="primary" :loading="submitLoading" @click="rejectSubmit">确定</el-button>
  573. <el-button type="primary" @click="submitModalFlag = false">取消</el-button>
  574. </el-footer>
  575. </el-dialog>
  576. <el-dialog width="700px" title="RoHs备注" :close-on-click-modal="false" :visible.sync="rohsRemarkFlag" v-drag>
  577. <el-form label-position="top">
  578. <el-form-item label="RoHs备注">
  579. <el-input
  580. type="textarea"
  581. v-model="rohsRemarkForm.rohsRemark"
  582. :rows="6"
  583. maxlength="255"
  584. show-word-limit
  585. resize="none">
  586. </el-input>
  587. </el-form-item>
  588. </el-form>
  589. <el-footer style="height:35px;margin-top:110px;text-align:center">
  590. <el-button type="primary" @click="refreshRohsRemark">刷新</el-button>
  591. <el-button type="primary" @click="saveRohsRemark">保存</el-button>
  592. <el-button type="primary" @click="rohsRemarkFlag = false">取消</el-button>
  593. </el-footer>
  594. </el-dialog>
  595. <!-- 底部附件页签 -->
  596. <el-tabs v-model="activeTable" style="width: 100%; height: 100%;" type="border-card" @tab-click="refreshCurrentTabTable" class="customer-tab">
  597. <el-tab-pane label="基本信息" name="basicInfo">
  598. <div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
  599. <el-form :inline="true" label-position="top" :model="currentRow">
  600. <el-form-item>
  601. <span slot="label">申请人/Applicant</span>
  602. <el-input :value="currentRow.applicant || ''" disabled style="width: 150px"></el-input>
  603. <el-input :value="currentRow.applicantName || ''" disabled style="width: 240px"></el-input>
  604. </el-form-item>
  605. <el-form-item label="申请日期/Application Date">
  606. <el-date-picker :value="currentRow.applicationDate" disabled type="date" value-format="yyyy-MM-dd" style="width: 190px"></el-date-picker>
  607. </el-form-item>
  608. <el-form-item label="工艺/Process">
  609. <el-input :value="currentRow.process || ''" disabled style="width: 190px"></el-input>
  610. </el-form-item>
  611. </el-form>
  612. <el-form :inline="true" label-position="top" :model="currentRow">
  613. <el-form-item label="供应商代码/Vendor Code">
  614. <el-input :value="currentRow.vendorCode || ''" disabled style="width: 150px"></el-input>
  615. </el-form-item>
  616. <el-form-item label="供应商材料编号/Vendor Material Code" style="margin-left: -10px">
  617. <el-input :value="currentRow.vendorMaterialCode || ''" disabled style="width: 240px"></el-input>
  618. </el-form-item>
  619. <el-form-item label="辅材用途/Material Use For">
  620. <el-input :value="currentRow.materialUseFor || ''" disabled style="width: 190px"></el-input>
  621. </el-form-item>
  622. </el-form>
  623. <el-form :inline="true" label-position="top" :model="currentRow">
  624. <el-form-item label="材料分类/Material Classify">
  625. <el-input :value="currentRow.materialClassify || ''" disabled style="width: 394px"></el-input>
  626. </el-form-item>
  627. <el-form-item label="其他材料分类/Other Material Classify" v-if="currentRow.materialClassify && currentRow.materialClassify.includes('Other其他')">
  628. <el-input :value="currentRow.otherMaterialClassify || ''" disabled style="width: 190px"></el-input>
  629. </el-form-item>
  630. </el-form>
  631. <el-form :inline="true" label-position="top" :model="currentRow">
  632. <el-form-item>
  633. <span slot="label">最终客户/End Customer</span>
  634. <el-input :value="currentRow.endCustomer || ''" disabled style="width: 150px"></el-input>
  635. <el-input :value="currentRow.endCustomerName || ''" disabled style="width: 240px"></el-input>
  636. </el-form-item>
  637. <el-form-item>
  638. <span slot="label">PM人员/PM</span>
  639. <el-input :value="currentRow.pm || ''" disabled style="width: 150px"></el-input>
  640. <el-input :value="currentRow.pmName || ''" disabled style="width: 240px"></el-input>
  641. </el-form-item>
  642. </el-form>
  643. <el-form :inline="true" label-position="top" :model="currentRow">
  644. <el-form-item>
  645. <span slot="label">项目编码/Project ID</span>
  646. <el-input :value="currentRow.projectId || ''" disabled style="width: 150px"></el-input>
  647. <el-input :value="currentRow.projectName || ''" disabled style="width: 240px"></el-input>
  648. </el-form-item>
  649. <el-form-item label="颜色/Color">
  650. <el-input :value="currentRow.color || ''" disabled style="width: 150px"></el-input>
  651. </el-form-item>
  652. <el-form-item label="计划转量产时间/Planned Mass Production">
  653. <el-date-picker :value="currentRow.plannedMassProductionDate" disabled type="datetime" value-format="yyyy-MM-dd HH:mm:ss" style="width: 230px"></el-date-picker>
  654. </el-form-item>
  655. </el-form>
  656. <el-form :inline="true" label-position="top" :model="currentRow">
  657. <el-form-item>
  658. <span slot="label">商品组1 / Comm Group 1</span>
  659. <el-input :value="currentRow.commGroup1 || ''" disabled style="width: 150px"></el-input>
  660. <el-input :value="currentRow.commGroup1Desc || ''" disabled style="width: 240px"></el-input>
  661. </el-form-item>
  662. <el-form-item label="是否需偏差许可/Need Deviation">
  663. <el-input :value="displayYesNo(currentRow.needDeviation)" disabled style="width: 190px"></el-input>
  664. </el-form-item>
  665. </el-form>
  666. <el-form :inline="true" label-position="top" :model="currentRow">
  667. <el-form-item>
  668. <span slot="label">商品组2 / Comm Group 2</span>
  669. <el-input :value="currentRow.commGroup2 || ''" disabled style="width: 150px"></el-input>
  670. <el-input :value="currentRow.commGroup2Desc || ''" disabled style="width: 240px"></el-input>
  671. </el-form-item>
  672. <el-form-item label="需创建内部编号/Need Create No.">
  673. <el-input :value="displayYesNo(currentRow.needCreateNumber)" disabled style="width: 190px"></el-input>
  674. </el-form-item>
  675. </el-form>
  676. <el-form :inline="true" label-position="top" :model="currentRow">
  677. <el-form-item>
  678. <span slot="label">商品组3 / Comm Group 3</span>
  679. <el-input :value="currentRow.commGroup3 || ''" disabled style="width: 150px"></el-input>
  680. <el-input :value="currentRow.commGroup3Desc || ''" disabled style="width: 240px"></el-input>
  681. </el-form-item>
  682. <el-form-item label="是否Fiber材料/Fiber Material">
  683. <el-input :value="displayYesNo(currentRow.isFiberMaterial)" disabled style="width: 190px"></el-input>
  684. </el-form-item>
  685. </el-form>
  686. <el-form :inline="true" label-position="top" :model="currentRow">
  687. <el-form-item>
  688. <span slot="label">NPD工程师/NPD Engineer</span>
  689. <el-input :value="currentRow.npdEngineer || ''" disabled style="width: 150px"></el-input>
  690. <el-input :value="currentRow.npdEngineerName || ''" disabled style="width: 240px"></el-input>
  691. </el-form-item>
  692. <el-form-item label="WM所需求规格/WM Required Spec">
  693. <el-input :value="currentRow.wmRequiredSpec || ''" disabled style="width: 190px"></el-input>
  694. </el-form-item>
  695. <el-form-item label="材料厚度/Material Thickness">
  696. <el-input :value="currentRow.materialThickness || ''" disabled style="width: 190px"></el-input>
  697. </el-form-item>
  698. </el-form>
  699. <el-form :inline="true" label-position="top" :model="currentRow">
  700. <el-form-item label="材料有效期/Material Validity Time">
  701. <el-date-picker :value="currentRow.materialValidityTime" disabled type="date" value-format="yyyy-MM-dd" style="width: 190px"></el-date-picker>
  702. </el-form-item>
  703. <el-form-item label="有效期备注/Validity Comments">
  704. <el-input :value="currentRow.materialValidityComments || ''" disabled style="width: 190px"></el-input>
  705. </el-form-item>
  706. <el-form-item label="报告时间(月)/Expect Report Time">
  707. <el-input :value="currentRow.expectReportTime" disabled style="width: 190px"></el-input>
  708. </el-form-item>
  709. </el-form>
  710. <el-form :inline="true" label-position="top" :model="currentRow">
  711. <el-form-item>
  712. <span slot="label">技术计划/Technical Plan</span>
  713. <el-input :value="currentRow.technicalPlan || ''" disabled style="width: 150px"></el-input>
  714. <el-input :value="currentRow.technicalPlanName || ''" disabled style="width: 240px"></el-input>
  715. </el-form-item>
  716. <el-form-item>
  717. <span slot="label">采购/Buyer</span>
  718. <el-input :value="currentRow.buyer || ''" disabled style="width: 150px"></el-input>
  719. <el-input :value="currentRow.buyerName || ''" disabled style="width: 240px"></el-input>
  720. </el-form-item>
  721. </el-form>
  722. <el-form :inline="true" label-position="top" :model="currentRow">
  723. <el-form-item label="所需审批文件/Docs Needed">
  724. <el-input :value="currentRow.qualificationDocumentsNeeded || ''" disabled style="width: 394px"></el-input>
  725. </el-form-item>
  726. <el-form-item label="测试报告必测项/Test Items">
  727. <el-input :value="currentRow.testReportIncludingItems || ''" disabled style="width: 394px"></el-input>
  728. </el-form-item>
  729. </el-form>
  730. <el-form :inline="true" label-position="top" :model="currentRow">
  731. <el-form-item label="备注说明/Remark" style="display: block;">
  732. <el-input type="textarea" :rows="3" :value="currentRow.remark || ''" disabled resize="none" style="width: 802px;height: 30px"></el-input>
  733. </el-form-item>
  734. </el-form>
  735. </div>
  736. </el-tab-pane>
  737. <el-tab-pane label="HSF 填写信息" name="hsfInfo">
  738. <div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
  739. <el-form :inline="true" label-position="top" :model="currentRow">
  740. <el-form-item label="SGS报告编号/SGS Report Number">
  741. <el-input :value="currentRow.sgsReportNumber || ''" disabled style="width: 230px"></el-input>
  742. </el-form-item>
  743. <el-form-item label="报告日期/Expired Date">
  744. <el-date-picker :value="currentRow.expiredDate" disabled type="date" value-format="yyyy-MM-dd" style="width: 180px"></el-date-picker>
  745. </el-form-item>
  746. <el-form-item label="有效期/Valid Until">
  747. <el-input :value="currentRow.validUntil || ''" disabled style="width: 180px"></el-input>
  748. </el-form-item>
  749. </el-form>
  750. <el-form :inline="true" label-position="top" :model="currentRow">
  751. <el-form-item label="是否符合RoHS/Meet RoHS Req"><el-input :value="displayYesNo(currentRow.isMeetRohsRequirement)" disabled style="width: 230px"></el-input></el-form-item>
  752. <el-form-item label="材料属性是否是AH/Is AH Grade"><el-input :value="displayYesNo(currentRow.isAhGrade)" disabled style="width: 180px"></el-input></el-form-item>
  753. <el-form-item label="HSF供应商等级/Supplier Class"><el-input :value="currentRow.hsfSupplierClassification || ''" disabled style="width: 180px"></el-input></el-form-item>
  754. </el-form>
  755. <el-form :inline="true" label-position="top" :model="currentRow">
  756. <el-form-item label="HSF审批人/HSF Approver"><el-input :value="currentRow.hsfApprover || ''" disabled style="width: 420px"></el-input></el-form-item>
  757. </el-form>
  758. <el-form :inline="true" label-position="top" :model="currentRow">
  759. <el-form-item label="Inform Related people"><el-input :value="currentRow.relatedPeople || ''" disabled style="width: 420px"></el-input></el-form-item>
  760. </el-form>
  761. <el-form :inline="true" label-position="top" :model="currentRow">
  762. <el-form-item label="Fiber报告信息/Fiber Information" style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.fiberInformation || ''" disabled resize="none" style="width: 802px;height: 30px"></el-input></el-form-item>
  763. </el-form>
  764. <el-form v-if="shouldShowHsfStandard(currentRow.endCustomer)" :inline="true" label-position="top" :model="currentRow" style="margin-top: 50px">
  765. <el-form-item label="HSF标准/HSF Standard" style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.hsfStandard || ''" disabled resize="none" style="width: 802px;height: 30px"></el-input></el-form-item>
  766. </el-form>
  767. </div>
  768. </el-tab-pane>
  769. <el-tab-pane label="NPD 信息" name="npdInfo">
  770. <div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
  771. <el-form :inline="true" label-position="top" :model="currentRow">
  772. <el-form-item label="现有材料不同规格/Same Material Diff Size"><el-input :value="displayYesNo(currentRow.isSameMaterialDiffSize)" disabled style="width: 205px"></el-input></el-form-item>
  773. </el-form>
  774. <el-form :inline="true" label-position="top" :model="currentRow">
  775. <el-form-item label="材料描述/Material Desc." style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.materialDesc || ''" disabled resize="none" style="width: 802px;height: 30px"></el-input></el-form-item>
  776. </el-form>
  777. <el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 50px">
  778. <el-form-item label="备注说明/NPD Remark" style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.npdRemark || ''" disabled resize="none" style="width: 802px;height: 30px"></el-input></el-form-item>
  779. </el-form>
  780. <el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 50px">
  781. <el-form-item label="TDS属性/TDS Property" style="display: block;">
  782. <oss-components
  783. :save-visible="authFileSave"
  784. :download-visible="authFileDownLoad"
  785. :remove-visible="authFileRemove"
  786. :preview-visible="authFilePreview"
  787. :disabled="true"
  788. label="序列号"
  789. :height="180"
  790. style="margin-top: 2px"
  791. :columns="tdsFileColumnList"
  792. :order-ref1="currentRow.site || ''"
  793. :order-ref2="currentRow.referenceNo || ''"
  794. order-ref3="tdsProperty">
  795. </oss-components>
  796. </el-form-item>
  797. </el-form>
  798. </div>
  799. </el-tab-pane>
  800. <el-tab-pane label="材料信息" name="materialInfo">
  801. <div :style="{height: secondHeight + 'px'}" style="overflow-y: auto;">
  802. <el-table
  803. class="rohs-material-table"
  804. border
  805. :data="currentRow.materialList || []"
  806. :height="secondHeight"
  807. style="width: 100%">
  808. <el-table-column type="index" label="序号" width="50" header-align="center" align="center"></el-table-column>
  809. <el-table-column prop="testPartNo" label="PLM物料编码/Test Part No." min-width="180" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  810. <el-table-column prop="finalPartNo" label="IFS物料编码/Final Part No." min-width="180" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  811. <el-table-column prop="customerPartNo" label="客户料号/Customer Part No." min-width="180" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  812. <el-table-column prop="partDesc" label="描述/Part Desc." min-width="220" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  813. </el-table>
  814. </div>
  815. </el-tab-pane>
  816. <el-tab-pane label="附件信息" name="attachment">
  817. <oss-components
  818. :save-visible="authFileSave"
  819. :download-visible="authFileDownLoad"
  820. :remove-visible="authFileRemove"
  821. :preview-visible="authFilePreview"
  822. :disabled="currentRow.status === '已完成'"
  823. label="序列号"
  824. :height="secondHeight - 25"
  825. style="margin-top: 2px"
  826. :columns="fileColumnList"
  827. :order-ref1="currentRow.site"
  828. :order-ref2="currentRow.referenceNo"
  829. order-ref3="rohsAttachment">
  830. </oss-components>
  831. </el-tab-pane>
  832. <el-tab-pane label="审批信息" name="approvalInformation">
  833. <approval-information v-model:data-list="approvalList" :height="secondHeight"></approval-information>
  834. </el-tab-pane>
  835. </el-tabs>
  836. <ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
  837. </div>
  838. </template>
  839. <script>
  840. import * as api from '@/api/rohs/rohs'
  841. import { checkSuperAdmin } from "@/api/changeManagement/changeManagement"
  842. import { verifyData } from "@/api/chooselist/chooselist.js"
  843. import { searchProjectInfoList } from "@/api/quotation/quotationInformation.js"
  844. import { queryCustomer } from "@/api/customer/customerInformation"
  845. import { queryProjectByCustomer } from "@/api/project/project"
  846. import uploadFileList from '../common/uploadFileList'
  847. import ossComponents from '../oss/ossComponents.vue'
  848. import ChooseList from '@/views/modules/common/Chooselist'
  849. import DictDataSelect from "../sys/dict-data-select.vue"
  850. import ApprovalInformation from "../changeManagement/approvalInformation.vue"
  851. export default {
  852. components: {
  853. uploadFileList,
  854. ossComponents,
  855. ChooseList,
  856. DictDataSelect,
  857. ApprovalInformation
  858. },
  859. data () {
  860. return {
  861. searchData: {
  862. site: this.$store.state.user.site,
  863. referenceNo: '',
  864. status: '',
  865. currentApprover: '',
  866. nodeId: ''
  867. },
  868. dataList: [],
  869. pageIndex: 1,
  870. pageSize: 20,
  871. totalPage: 0,
  872. dataListLoading: false,
  873. activeTable: 'basicInfo',
  874. menuId: '108006', // 暂定ROHS菜单ID
  875. authSearch: false,
  876. authUpdate: false,
  877. authIssue: false,
  878. authSubmit: false,
  879. authReject: false,
  880. authFileSave: false,
  881. authFileDownLoad: false,
  882. authFileRemove: false,
  883. authFilePreview: false,
  884. authDataEntry: false,
  885. authDelete: false,
  886. superAdmin: false,
  887. createBy2: this.$store.state.user.name,
  888. height: 400,
  889. secondHeight: 200,
  890. currentRow: {},
  891. fileColumnList: [
  892. {
  893. columnProp: 'fileName',
  894. headerAlign: 'center',
  895. align: 'center',
  896. columnLabel: '文件名称',
  897. columnHidden: false,
  898. columnImage: false,
  899. columnSortable: false,
  900. status: true,
  901. fixed: '',
  902. columnWidth: 140
  903. },
  904. {
  905. columnProp: 'fileRemark',
  906. headerAlign: 'center',
  907. align: 'center',
  908. columnLabel: '备注',
  909. columnHidden: false,
  910. columnImage: false,
  911. columnSortable: false,
  912. status: true,
  913. fixed: '',
  914. columnWidth: 200
  915. },
  916. {
  917. columnProp: 'createDate',
  918. headerAlign: 'center',
  919. align: 'center',
  920. columnLabel: '上传时间',
  921. columnHidden: false,
  922. columnImage: false,
  923. columnSortable: false,
  924. status: true,
  925. fixed: '',
  926. columnWidth: 150
  927. },
  928. {
  929. columnProp: 'createBy',
  930. headerAlign: 'center',
  931. align: 'center',
  932. columnLabel: '上传人',
  933. columnHidden: false,
  934. columnImage: false,
  935. columnSortable: false,
  936. status: true,
  937. fixed: '',
  938. columnWidth: 120
  939. }
  940. ],
  941. tdsFileColumnList: [
  942. {
  943. columnProp: 'fileNo',
  944. headerAlign: 'center',
  945. align: 'center',
  946. columnLabel: '文件编码',
  947. columnHidden: false,
  948. columnImage: false,
  949. columnSortable: false,
  950. status: true,
  951. fixed: '',
  952. columnWidth: 130
  953. },
  954. {
  955. columnProp: 'rev',
  956. headerAlign: 'center',
  957. align: 'center',
  958. columnLabel: '版本号',
  959. columnHidden: false,
  960. columnImage: false,
  961. columnSortable: false,
  962. status: true,
  963. fixed: '',
  964. columnWidth: 90
  965. },
  966. {
  967. columnProp: 'fileName',
  968. headerAlign: 'center',
  969. align: 'center',
  970. columnLabel: '文件名称',
  971. columnHidden: false,
  972. columnImage: false,
  973. columnSortable: false,
  974. status: true,
  975. fixed: '',
  976. columnWidth: 160
  977. },
  978. {
  979. columnProp: 'fileRemark',
  980. headerAlign: 'center',
  981. align: 'center',
  982. columnLabel: '备注',
  983. columnHidden: false,
  984. columnImage: false,
  985. columnSortable: false,
  986. status: true,
  987. fixed: '',
  988. columnWidth: 180
  989. },
  990. {
  991. columnProp: 'createDate',
  992. headerAlign: 'center',
  993. align: 'center',
  994. columnLabel: '上传时间',
  995. columnHidden: false,
  996. columnImage: false,
  997. columnSortable: false,
  998. status: true,
  999. fixed: '',
  1000. columnWidth: 150
  1001. },
  1002. {
  1003. columnProp: 'invalidationTime',
  1004. headerAlign: 'center',
  1005. align: 'center',
  1006. columnLabel: '失效时间',
  1007. columnHidden: false,
  1008. columnImage: false,
  1009. columnSortable: false,
  1010. status: true,
  1011. fixed: '',
  1012. columnWidth: 150
  1013. },
  1014. {
  1015. columnProp: 'createBy',
  1016. headerAlign: 'center',
  1017. align: 'center',
  1018. columnLabel: '上传人',
  1019. columnHidden: false,
  1020. columnImage: false,
  1021. columnSortable: false,
  1022. status: true,
  1023. fixed: '',
  1024. columnWidth: 120
  1025. }
  1026. ],
  1027. modalFlag: false,
  1028. uploadDialog: false,
  1029. chooseProjectListFlag: false,
  1030. projectMaterialDialogFlag: false,
  1031. searchProjectData: {
  1032. site: '',
  1033. projectId: undefined,
  1034. projectName: undefined,
  1035. customerId: undefined,
  1036. },
  1037. projectMaterialSearchData: {
  1038. testPartNo: '',
  1039. partDesc: '',
  1040. finalPartNo: '',
  1041. customerPartNo: ''
  1042. },
  1043. projectMaterialList: [],
  1044. projectMaterialSelections: [],
  1045. materialSelections: [],
  1046. projectMaterialPageIndex: 1,
  1047. projectMaterialPageSize: 20,
  1048. projectMaterialTotal: 0,
  1049. projectMaterialLoading: false,
  1050. nodeOptions: [],
  1051. projectList: [],
  1052. hsfApproverOptionList: [],
  1053. hsfApproverTransferList: [],
  1054. hsfApproverFlag: false,
  1055. hsfApproverOperatorProp: {
  1056. key: 'operatorId',
  1057. label: 'operatorName'
  1058. },
  1059. fileList: [],
  1060. approvalList: [],
  1061. plmRohsAuthorityArr: [],
  1062. nodeAuthorityLoaded: false,
  1063. isEditMode: false,
  1064. modalTitle: 'RoHs 新增',
  1065. activeName: 'basicInfo',
  1066. showModalFlag: false,
  1067. submitModalFlag: false,
  1068. rohsRemarkFlag: false,
  1069. rejectOpinion: '',
  1070. submitLoading: false,
  1071. rohsRemarkForm: {
  1072. rohsRemark: ''
  1073. },
  1074. modalData: {
  1075. site: 'DEFAULT',
  1076. referenceNo: '',
  1077. applicant: '',
  1078. pm: '',
  1079. pmName: '',
  1080. applicationDate: '',
  1081. process: '',
  1082. plannedMassProductionDate: '',
  1083. color: '',
  1084. vendorCode: '',
  1085. vendorMaterialCode: '',
  1086. materialClassify: '',
  1087. otherMaterialClassify: '',
  1088. materialUseFor: '',
  1089. endCustomer: '',
  1090. projectId: '',
  1091. commGroup1: '',
  1092. commGroup1Desc: '',
  1093. commGroup2: '',
  1094. commGroup2Desc: '',
  1095. commGroup3: '',
  1096. commGroup3Desc: '',
  1097. needCreateNumber: '',
  1098. npdEngineer: '',
  1099. materialValidityTime: '',
  1100. materialValidityComments: '',
  1101. needDeviation: '',
  1102. technicalPlan: '',
  1103. wmRequiredSpec: '',
  1104. isFiberMaterial: '',
  1105. materialThickness: '',
  1106. buyer: '',
  1107. expectReportTime: 0,
  1108. qualificationDocumentsNeeded: '',
  1109. qualificationDocumentsNeededList: [],
  1110. testReportIncludingItems: '',
  1111. testReportIncludingItemsList: [],
  1112. remark: '',
  1113. rohsRemark: '',
  1114. status: '',
  1115. sgsReportNumber: '',
  1116. expiredDate: '',
  1117. fiberInformation: '',
  1118. hsfStandard: '',
  1119. hsfApprover: '',
  1120. hsfApproverList: [],
  1121. relatedPeople: '',
  1122. buNo: '',
  1123. validUntil: '',
  1124. isMeetRohsRequirement: '',
  1125. isAhGrade: '',
  1126. hsfSupplierClassification: '',
  1127. materialDesc: '',
  1128. npdRemark: '',
  1129. isSameMaterialDiffSize: '',
  1130. ifsPartNo: '',
  1131. materialList: [],
  1132. stepId: null,
  1133. rejectFlag: '',
  1134. rejectStepId: null,
  1135. createBy2: '',
  1136. isReject: 'Y',
  1137. tpProcessControl: 'N',
  1138. csProcessControl: 'N'
  1139. }
  1140. }
  1141. },
  1142. created () {
  1143. this.menuId = this.$route.meta.menuId
  1144. this.getButtonAuthData()
  1145. this.checkSuperAdmin()
  1146. },
  1147. mounted () {
  1148. this.fetchNodeOptions()
  1149. if (this.authSearch) {
  1150. this.getDataList()
  1151. }
  1152. this.$nextTick(() => {
  1153. this.height = window.innerHeight / 2 - 30
  1154. /*第二个表格高度的动态调整*/
  1155. this.secondHeight = window.innerHeight / 2 - 186
  1156. })
  1157. },
  1158. methods: {
  1159. fetchNodeOptions () {
  1160. if (!this.searchData.site || !this.menuId) {
  1161. this.nodeOptions = []
  1162. return
  1163. }
  1164. let params = {
  1165. site: this.searchData.site,
  1166. menuId: this.menuId
  1167. }
  1168. api.getNodeList(params).then(({data}) => {
  1169. if (data && data.code === 0 && Array.isArray(data.rows)) {
  1170. this.nodeOptions = data.rows
  1171. .filter(item => item && item.nodeId)
  1172. .map(item => ({
  1173. id: item.nodeId,
  1174. name: item.nodeName
  1175. }))
  1176. } else {
  1177. this.nodeOptions = []
  1178. }
  1179. }).catch(() => {
  1180. this.nodeOptions = []
  1181. })
  1182. },
  1183. loadNodeAuthority (site, stepId) {
  1184. if (!site || stepId === null || stepId === undefined || !this.menuId) {
  1185. this.plmRohsAuthorityArr = []
  1186. this.nodeAuthorityLoaded = true
  1187. return Promise.resolve()
  1188. }
  1189. this.nodeAuthorityLoaded = false
  1190. let params = {
  1191. site: site,
  1192. stepId: stepId,
  1193. menuId: this.menuId
  1194. }
  1195. return api.getRohsNodeAuthority(params).then(({data}) => {
  1196. if (data && data.code === 0 && data.rows) {
  1197. this.plmRohsAuthorityArr = data.rows.plm_rohs || []
  1198. } else {
  1199. this.plmRohsAuthorityArr = []
  1200. }
  1201. this.nodeAuthorityLoaded = true
  1202. }).catch(() => {
  1203. this.plmRohsAuthorityArr = []
  1204. this.nodeAuthorityLoaded = true
  1205. })
  1206. },
  1207. rohsFieldFlag (fieldId) {
  1208. if (!this.plmRohsAuthorityArr || this.plmRohsAuthorityArr.length === 0) {
  1209. return 'N'
  1210. }
  1211. let target = this.plmRohsAuthorityArr.find(item => item.fieldId === fieldId)
  1212. return target ? target.updateFlag : 'N'
  1213. },
  1214. isRohsFieldDisabled (fieldId) {
  1215. if (this.showModalFlag) {
  1216. return true
  1217. }
  1218. if (!this.isEditMode) {
  1219. return false
  1220. }
  1221. return this.rohsFieldFlag(fieldId) === 'N'
  1222. },
  1223. canEditRohsMaterial () {
  1224. return !this.showModalFlag
  1225. },
  1226. getRohsSubmitFieldValue (fieldId) {
  1227. const fieldMapping = {
  1228. materialClassify: 'materialClassifyList',
  1229. qualificationDocumentsNeeded: 'qualificationDocumentsNeededList',
  1230. testReportIncludingItems: 'testReportIncludingItemsList',
  1231. hsfApprover: 'hsfApproverList'
  1232. }
  1233. const mappedField = fieldMapping[fieldId]
  1234. if (mappedField) {
  1235. return this.modalData[mappedField]
  1236. }
  1237. return this.modalData[fieldId]
  1238. },
  1239. isSubmitFieldEmpty (value) {
  1240. if (Array.isArray(value)) {
  1241. return value.length === 0
  1242. }
  1243. if (typeof value === 'string') {
  1244. return value.trim() === ''
  1245. }
  1246. return !value
  1247. },
  1248. validateSubmitRequiredFields () {
  1249. if (this.plmRohsAuthorityArr && this.plmRohsAuthorityArr.length > 0) {
  1250. for (let i = 0; i < this.plmRohsAuthorityArr.length; i++) {
  1251. const fieldConfig = this.plmRohsAuthorityArr[i]
  1252. if (fieldConfig.required !== 'Y') {
  1253. continue
  1254. }
  1255. if (fieldConfig.fieldId === 'hsfStandard' && !this.shouldShowHsfStandard(this.modalData.endCustomer)) {
  1256. continue
  1257. }
  1258. const value = this.getRohsSubmitFieldValue(fieldConfig.fieldId)
  1259. if (this.isSubmitFieldEmpty(value)) {
  1260. this.$message.warning((fieldConfig.fieldName || fieldConfig.fieldId) + '不能为空!')
  1261. return false
  1262. }
  1263. }
  1264. }
  1265. return true
  1266. },
  1267. materialDialogHeaderCellStyle () {
  1268. return {
  1269. whiteSpace: 'nowrap',
  1270. wordBreak: 'keep-all'
  1271. }
  1272. },
  1273. displayYesNo (value) {
  1274. if (value === 'Y') {
  1275. return '是'
  1276. }
  1277. if (value === 'N') {
  1278. return '否'
  1279. }
  1280. return value || ''
  1281. },
  1282. getMultipleSelectTitle (value) {
  1283. if (!Array.isArray(value)) {
  1284. return ''
  1285. }
  1286. return value
  1287. .filter(item => item !== null && item !== undefined && String(item).trim() !== '')
  1288. .map(item => String(item).trim())
  1289. .join(';')
  1290. },
  1291. shouldShowHsfStandard (customerCode) {
  1292. return String(customerCode || '').trim().toUpperCase() === 'C00052'
  1293. },
  1294. normalizeHsfStandardByCustomer (formData) {
  1295. if (!formData) {
  1296. return
  1297. }
  1298. if (!this.shouldShowHsfStandard(formData.endCustomer)) {
  1299. this.$set(formData, 'hsfStandard', '')
  1300. }
  1301. },
  1302. syncHsfApproverFields () {
  1303. const list = Array.isArray(this.modalData.hsfApproverList)
  1304. ? this.modalData.hsfApproverList.filter(item => item && item.trim())
  1305. : []
  1306. this.$set(this.modalData, 'hsfApproverList', list)
  1307. this.$set(this.modalData, 'hsfApprover', list.join(';'))
  1308. if (!list.includes(this.modalData.relatedPeople)) {
  1309. this.$set(this.modalData, 'relatedPeople', '')
  1310. }
  1311. },
  1312. mapHsfApproverNamesToIds (nameList, optionList = this.hsfApproverOptionList) {
  1313. if (!Array.isArray(nameList) || !Array.isArray(optionList) || optionList.length === 0) {
  1314. return []
  1315. }
  1316. const nameMap = new Map()
  1317. optionList.forEach(item => {
  1318. if (item && item.operatorName && item.operatorId && !nameMap.has(item.operatorName)) {
  1319. nameMap.set(item.operatorName, item.operatorId)
  1320. }
  1321. })
  1322. return nameList
  1323. .map(name => nameMap.get(name))
  1324. .filter(id => !!id)
  1325. },
  1326. mapHsfApproverIdsToNames (idList, optionList = this.hsfApproverOptionList) {
  1327. if (!Array.isArray(idList) || !Array.isArray(optionList) || optionList.length === 0) {
  1328. return []
  1329. }
  1330. const idMap = new Map()
  1331. optionList.forEach(item => {
  1332. if (item && item.operatorId && item.operatorName) {
  1333. idMap.set(item.operatorId, item.operatorName)
  1334. }
  1335. })
  1336. return idList
  1337. .map(id => idMap.get(id))
  1338. .filter(name => !!name)
  1339. },
  1340. openHsfApproverChooseModal () {
  1341. if (this.isRohsFieldDisabled('hsfApprover')) {
  1342. return
  1343. }
  1344. if (!this.modalData || !this.modalData.projectId) {
  1345. this.$message.warning('请先选择项目编码')
  1346. return
  1347. }
  1348. this.loadHsfApproverByCurrentProject(false).then(() => {
  1349. this.hsfApproverTransferList = this.mapHsfApproverNamesToIds(this.modalData.hsfApproverList)
  1350. if (!this.hsfApproverOptionList || this.hsfApproverOptionList.length === 0) {
  1351. this.$message.warning('未查询到可选HSF审批人')
  1352. return
  1353. }
  1354. this.hsfApproverFlag = true
  1355. })
  1356. },
  1357. saveHsfApproverChooseModal () {
  1358. const selectedNames = this.mapHsfApproverIdsToNames(this.hsfApproverTransferList)
  1359. this.$set(this.modalData, 'hsfApproverList', selectedNames)
  1360. this.syncHsfApproverFields()
  1361. this.hsfApproverFlag = false
  1362. },
  1363. clearHsfApproverFields (clearBuNo = false) {
  1364. if (clearBuNo) {
  1365. this.$set(this.modalData, 'buNo', '')
  1366. }
  1367. this.hsfApproverOptionList = []
  1368. this.hsfApproverTransferList = []
  1369. this.$set(this.modalData, 'hsfApproverList', [])
  1370. this.$set(this.modalData, 'hsfApprover', '')
  1371. this.$set(this.modalData, 'relatedPeople', '')
  1372. },
  1373. loadHsfApproverByCurrentProject (forceSelectAll = false) {
  1374. if (!this.modalData || !this.modalData.site || !this.modalData.projectId) {
  1375. if (forceSelectAll) {
  1376. this.$message.warning('请先选择项目编码')
  1377. }
  1378. this.hsfApproverOptionList = []
  1379. this.hsfApproverTransferList = []
  1380. if (forceSelectAll) {
  1381. this.clearHsfApproverFields(false)
  1382. }
  1383. return Promise.resolve()
  1384. }
  1385. const queryByBu = (buNo) => {
  1386. if (!buNo) {
  1387. if (forceSelectAll) {
  1388. this.$message.warning('当前项目未维护BU,无法查询HSF审批人')
  1389. }
  1390. this.hsfApproverOptionList = []
  1391. this.hsfApproverTransferList = []
  1392. if (forceSelectAll) {
  1393. this.clearHsfApproverFields(false)
  1394. }
  1395. return Promise.resolve()
  1396. }
  1397. const params = {
  1398. site: this.modalData.site,
  1399. buNo: buNo,
  1400. roleNo: 'R015'
  1401. }
  1402. return api.searchBmUser(params).then(({data}) => {
  1403. if (data && data.code === 0 && Array.isArray(data.rows)) {
  1404. this.hsfApproverOptionList = data.rows
  1405. if (forceSelectAll) {
  1406. const defaultSelectedIds = data.rows.map(item => item.operatorId).filter(item => item)
  1407. this.hsfApproverTransferList = defaultSelectedIds
  1408. this.$set(this.modalData, 'hsfApproverList', this.mapHsfApproverIdsToNames(defaultSelectedIds, data.rows))
  1409. } else {
  1410. this.hsfApproverTransferList = this.mapHsfApproverNamesToIds(this.modalData.hsfApproverList, data.rows)
  1411. }
  1412. this.syncHsfApproverFields()
  1413. } else {
  1414. this.hsfApproverOptionList = []
  1415. this.hsfApproverTransferList = []
  1416. if (forceSelectAll) {
  1417. this.clearHsfApproverFields(false)
  1418. }
  1419. }
  1420. }).catch(() => {
  1421. this.hsfApproverOptionList = []
  1422. this.hsfApproverTransferList = []
  1423. if (forceSelectAll) {
  1424. this.clearHsfApproverFields(false)
  1425. }
  1426. })
  1427. }
  1428. if (this.modalData.buNo) {
  1429. return queryByBu(this.modalData.buNo)
  1430. }
  1431. const projectParams = {
  1432. site: this.modalData.site,
  1433. projectId: this.modalData.projectId
  1434. }
  1435. if (this.modalData.endCustomer) {
  1436. projectParams.customerId = this.modalData.endCustomer
  1437. }
  1438. return queryProjectByCustomer(projectParams).then(({data}) => {
  1439. if (data && data.code === 0 && data.rows && data.rows.length === 1) {
  1440. const project = data.rows[0]
  1441. this.$set(this.modalData, 'buNo', project.buNo || project.bu_no || '')
  1442. return queryByBu(this.modalData.buNo)
  1443. } else {
  1444. if (forceSelectAll) {
  1445. this.clearHsfApproverFields(false)
  1446. }
  1447. }
  1448. }).catch(() => {
  1449. if (forceSelectAll) {
  1450. this.clearHsfApproverFields(false)
  1451. }
  1452. })
  1453. },
  1454. isCurrentApprover () {
  1455. return this.superAdmin || (this.modalData.createBy2 && this.modalData.createBy2.split(';').includes(this.createBy2))
  1456. },
  1457. canSaveAction () {
  1458. return !this.showModalFlag && (this.modalData.status === '草稿' || (this.modalData.status === '审批中' && this.isCurrentApprover()))
  1459. },
  1460. canAgreeAction () {
  1461. return this.authSubmit && this.isCurrentApprover() && this.modalData.status === '审批中' && this.modalData.tpProcessControl !== 'Y' && this.modalData.csProcessControl !== 'Y'
  1462. },
  1463. canRejectAction () {
  1464. return this.authReject && this.isCurrentApprover() && this.modalData.status === '审批中' && this.modalData.isReject === 'Y'
  1465. },
  1466. hasPersistedRohsRecord () {
  1467. return !!(this.modalData && this.modalData.site && this.modalData.referenceNo && !String(this.modalData.referenceNo).startsWith('TEMP-'))
  1468. },
  1469. openRohsRemarkDialog () {
  1470. this.$set(this.rohsRemarkForm, 'rohsRemark', this.modalData.rohsRemark || '')
  1471. this.rohsRemarkFlag = true
  1472. },
  1473. refreshRohsRemark () {
  1474. if (!this.hasPersistedRohsRecord()) {
  1475. this.$set(this.rohsRemarkForm, 'rohsRemark', this.modalData.rohsRemark || '')
  1476. return
  1477. }
  1478. api.getRohsDetail(this.modalData.site, this.modalData.referenceNo).then(({data}) => {
  1479. if (data && data.code === 0 && data.data) {
  1480. this.$set(this.rohsRemarkForm, 'rohsRemark', data.data.rohsRemark || '')
  1481. } else {
  1482. this.$message.error((data && data.msg) || '刷新失败')
  1483. }
  1484. }).catch(() => {
  1485. this.$message.error('刷新失败')
  1486. })
  1487. },
  1488. saveRohsRemark () {
  1489. const rohsRemark = this.rohsRemarkForm.rohsRemark || ''
  1490. if (!this.hasPersistedRohsRecord()) {
  1491. this.$set(this.modalData, 'rohsRemark', rohsRemark)
  1492. this.rohsRemarkFlag = false
  1493. this.$message.success('暂存成功,保存单据后写入数据库')
  1494. return
  1495. }
  1496. const params = {
  1497. site: this.modalData.site,
  1498. referenceNo: this.modalData.referenceNo,
  1499. rohsRemark: rohsRemark
  1500. }
  1501. api.updateRohsRemark(params).then(({data}) => {
  1502. if (data && data.code === 0) {
  1503. this.$set(this.modalData, 'rohsRemark', rohsRemark)
  1504. if (this.currentRow && this.currentRow.site === this.modalData.site && this.currentRow.referenceNo === this.modalData.referenceNo) {
  1505. this.$set(this.currentRow, 'rohsRemark', rohsRemark)
  1506. }
  1507. const target = (this.dataList || []).find(item => item.site === this.modalData.site && item.referenceNo === this.modalData.referenceNo)
  1508. if (target) {
  1509. this.$set(target, 'rohsRemark', rohsRemark)
  1510. }
  1511. this.rohsRemarkFlag = false
  1512. this.$message.success('操作成功')
  1513. } else {
  1514. this.$message.error((data && data.msg) || '保存失败')
  1515. }
  1516. }).catch(() => {
  1517. this.$message.error('保存失败')
  1518. })
  1519. },
  1520. loadModalButtonCondition () {
  1521. if (!this.modalData.site || !this.modalData.referenceNo || this.modalData.status !== '审批中') {
  1522. this.$set(this.modalData, 'createBy2', '')
  1523. this.$set(this.modalData, 'isReject', 'Y')
  1524. this.$set(this.modalData, 'tpProcessControl', 'N')
  1525. this.$set(this.modalData, 'csProcessControl', 'N')
  1526. return
  1527. }
  1528. let params = {
  1529. site: this.modalData.site,
  1530. referenceNo: this.modalData.referenceNo
  1531. }
  1532. api.getRohsButtonCondition(params).then(({data}) => {
  1533. if (data && data.code === 0 && data.data) {
  1534. this.$set(this.modalData, 'createBy2', data.data.createBy2 || '')
  1535. this.$set(this.modalData, 'isReject', data.data.isReject || 'Y')
  1536. this.$set(this.modalData, 'tpProcessControl', data.data.tpProcessControl || 'N')
  1537. this.$set(this.modalData, 'csProcessControl', data.data.csProcessControl || 'N')
  1538. } else {
  1539. this.$set(this.modalData, 'createBy2', '')
  1540. this.$set(this.modalData, 'isReject', 'Y')
  1541. this.$set(this.modalData, 'tpProcessControl', 'N')
  1542. this.$set(this.modalData, 'csProcessControl', 'N')
  1543. }
  1544. }).catch(() => {
  1545. this.$set(this.modalData, 'createBy2', '')
  1546. this.$set(this.modalData, 'isReject', 'Y')
  1547. this.$set(this.modalData, 'tpProcessControl', 'N')
  1548. this.$set(this.modalData, 'csProcessControl', 'N')
  1549. })
  1550. },
  1551. // 列表行选中变色
  1552. rowStyle ({row}) {
  1553. if (this.currentRow && this.currentRow.referenceNo === row.referenceNo) {
  1554. return { 'background-color': '#E8F7F6', cursor: 'pointer' }
  1555. }
  1556. },
  1557. // 获取按钮的权限数据
  1558. getButtonAuthData () {
  1559. this.authSearch = this.isAuth(this.menuId+":search")
  1560. this.authUpdate = this.isAuth(this.menuId+":update")
  1561. this.authIssue = this.isAuth(this.menuId+":issue")
  1562. this.authSubmit = this.isAuth(this.menuId+":submit")
  1563. this.authReject = this.isAuth(this.menuId+":reject")
  1564. this.authFileSave = this.isAuth(this.menuId+":fileSave")
  1565. this.authFileDownLoad = this.isAuth(this.menuId+":fileDownLoad")
  1566. this.authFileRemove = this.isAuth(this.menuId+":fileRemove")
  1567. this.authFilePreview = this.isAuth(this.menuId+":filePreview")
  1568. this.authDataEntry = this.isAuth(this.menuId+":dataEntry")
  1569. this.authDelete = this.isAuth(this.menuId+":delete")
  1570. },
  1571. // 校验是否为超级管理员
  1572. checkSuperAdmin () {
  1573. checkSuperAdmin().then(({data}) => {
  1574. this.superAdmin = data.superAdmin
  1575. })
  1576. },
  1577. changeClickRow (row, column, event) {
  1578. // 通过接口或直接赋值,让底部的页签显示当前选中行的数据
  1579. api.getRohsDetail(row.site, row.referenceNo).then(({data}) => {
  1580. if (data && data.code === 0) {
  1581. this.currentRow = data.data || {}
  1582. } else {
  1583. this.currentRow = row || {}
  1584. }
  1585. if (!Array.isArray(this.currentRow.materialList)) {
  1586. this.$set(this.currentRow, 'materialList', [])
  1587. }
  1588. this.fillDisplayFields(this.currentRow, row || {})
  1589. this.refreshCurrentTabTable()
  1590. }).catch(() => {
  1591. this.currentRow = row || {}
  1592. if (!Array.isArray(this.currentRow.materialList)) {
  1593. this.$set(this.currentRow, 'materialList', [])
  1594. }
  1595. this.fillDisplayFields(this.currentRow)
  1596. this.refreshCurrentTabTable()
  1597. })
  1598. },
  1599. currentChange (val) {
  1600. this.currentRow = val || {}
  1601. if (val) {
  1602. if (!Array.isArray(this.currentRow.materialList)) {
  1603. this.$set(this.currentRow, 'materialList', [])
  1604. }
  1605. this.fillDisplayFields(this.currentRow)
  1606. this.refreshCurrentTabTable()
  1607. } else {
  1608. this.approvalList = []
  1609. }
  1610. },
  1611. fillDisplayFields (target, fallbackData = {}) {
  1612. if (!target) {
  1613. return
  1614. }
  1615. const fields = ['applicantName', 'pmName', 'npdEngineerName', 'technicalPlanName', 'buyerName', 'endCustomerName', 'projectName', 'commGroup1Desc', 'commGroup2Desc', 'commGroup3Desc']
  1616. fields.forEach(field => {
  1617. const value = target[field] || fallbackData[field] || ''
  1618. this.$set(target, field, value)
  1619. })
  1620. this.$set(target, 'endCustomerFlag', !!target.endCustomerFlag)
  1621. this.$set(target, 'projectIdFlag', !!target.projectIdFlag)
  1622. },
  1623. refreshCurrentTabTable () {
  1624. if (this.activeTable === 'approvalInformation') {
  1625. this.getApprovalList()
  1626. }
  1627. },
  1628. getApprovalList () {
  1629. if (!this.currentRow || !this.currentRow.site || !this.currentRow.referenceNo) {
  1630. this.approvalList = []
  1631. return
  1632. }
  1633. let params = {
  1634. site: this.currentRow.site,
  1635. menuId: this.menuId,
  1636. documentNo: this.currentRow.referenceNo
  1637. }
  1638. api.getRohsApprovalList(params).then(({data}) => {
  1639. if (data && data.code === 0) {
  1640. this.approvalList = data.rows || []
  1641. } else {
  1642. this.approvalList = []
  1643. }
  1644. }).catch(() => {
  1645. this.approvalList = []
  1646. })
  1647. },
  1648. // 获取列表
  1649. getDataList () {
  1650. if (!this.authSearch) {
  1651. this.dataList = []
  1652. this.totalPage = 0
  1653. this.currentRow = {}
  1654. this.approvalList = []
  1655. return
  1656. }
  1657. this.dataListLoading = true
  1658. let params = {
  1659. page: this.pageIndex,
  1660. limit: this.pageSize,
  1661. site: this.$store.state.user.site,
  1662. menuId: this.menuId,
  1663. referenceNo: this.searchData.referenceNo,
  1664. status: this.searchData.status,
  1665. currentApprover: this.searchData.currentApprover,
  1666. nodeId: this.searchData.nodeId
  1667. }
  1668. api.getRohsList(params).then(({data}) => {
  1669. if (data && data.code === 0) {
  1670. const list = data.page.list || []
  1671. this.dataList = list.map(item => {
  1672. return {
  1673. applicantName: '',
  1674. pmName: '',
  1675. npdEngineerName: '',
  1676. technicalPlanName: '',
  1677. buyerName: '',
  1678. endCustomerName: '',
  1679. projectName: '',
  1680. nodeId: '',
  1681. nodeName: '',
  1682. currentApprover: '',
  1683. commGroup1Desc: '',
  1684. commGroup2Desc: '',
  1685. commGroup3Desc: '',
  1686. ...item
  1687. }
  1688. })
  1689. this.totalPage = data.page.totalCount
  1690. this.$nextTick(() => {
  1691. if (this.$refs.rohsTable && this.dataList.length > 0) {
  1692. this.$refs.rohsTable.setCurrentRow(this.dataList[0])
  1693. } else if (this.$refs.rohsTable) {
  1694. this.$refs.rohsTable.setCurrentRow()
  1695. }
  1696. })
  1697. } else {
  1698. this.dataList = []
  1699. this.totalPage = 0
  1700. this.currentRow = {}
  1701. this.approvalList = []
  1702. }
  1703. this.dataListLoading = false
  1704. }).catch(() => {
  1705. this.currentRow = {}
  1706. this.approvalList = []
  1707. this.dataListLoading = false
  1708. })
  1709. },
  1710. // 分页
  1711. sizeChangeHandle (val) {
  1712. this.pageSize = val
  1713. this.pageIndex = 1
  1714. this.getDataList()
  1715. },
  1716. currentChangeHandle (val) {
  1717. this.pageIndex = val
  1718. this.getDataList()
  1719. },
  1720. // 搜索条件点击
  1721. searchHandle () {
  1722. if (!this.authSearch) {
  1723. return
  1724. }
  1725. this.pageIndex = 1
  1726. this.getDataList()
  1727. },
  1728. // 单选可取消
  1729. radioClick (field, value) {
  1730. if (this.modalData[field] === value) {
  1731. this.modalData[field] = ''
  1732. } else {
  1733. this.modalData[field] = value
  1734. }
  1735. },
  1736. // 导出
  1737. exportHandle () {
  1738. if (!this.authSearch) {
  1739. return
  1740. }
  1741. this.$message.info('导出功能开发中')
  1742. },
  1743. // 新增 / 修改
  1744. addOrUpdateHandle (row) {
  1745. if (!row && !this.authUpdate) {
  1746. this.$message.warning('没有新增权限')
  1747. return
  1748. }
  1749. if (row && !this.authUpdate && !this.authDataEntry) {
  1750. this.$message.warning('没有编辑权限')
  1751. return
  1752. }
  1753. this.modalFlag = true
  1754. this.activeName = 'basicInfo'
  1755. this.fileList = []
  1756. this.uploadDialog = false
  1757. this.submitModalFlag = false
  1758. this.rohsRemarkFlag = false
  1759. this.rejectOpinion = ''
  1760. this.rohsRemarkForm = {
  1761. rohsRemark: ''
  1762. }
  1763. this.projectMaterialDialogFlag = false
  1764. this.projectMaterialSelections = []
  1765. this.materialSelections = []
  1766. this.hsfApproverOptionList = []
  1767. this.hsfApproverTransferList = []
  1768. this.hsfApproverFlag = false
  1769. this.plmRohsAuthorityArr = []
  1770. this.nodeAuthorityLoaded = !row
  1771. this.isEditMode = !!row
  1772. this.projectMaterialPageIndex = 1
  1773. this.projectMaterialTotal = 0
  1774. this.projectMaterialList = []
  1775. this.projectMaterialSearchData = {
  1776. testPartNo: '',
  1777. partDesc: '',
  1778. finalPartNo: '',
  1779. customerPartNo: ''
  1780. }
  1781. this.showModalFlag = !!(row && (row.status === '已完成' || !this.authUpdate))
  1782. if (row) {
  1783. this.modalTitle = 'RoHs 编辑'
  1784. api.getRohsDetail(row.site, row.referenceNo).then(({data}) => {
  1785. if (data && data.code === 0) {
  1786. this.modalData = data.data || {}
  1787. this.$set(this.modalData, 'qualificationDocumentsNeededList', this.modalData.qualificationDocumentsNeeded ? this.modalData.qualificationDocumentsNeeded.split(';').filter(item => item) : [])
  1788. this.$set(this.modalData, 'testReportIncludingItemsList', this.modalData.testReportIncludingItems ? this.modalData.testReportIncludingItems.split(';').filter(item => item) : [])
  1789. this.$set(this.modalData, 'materialClassifyList', this.modalData.materialClassify ? this.modalData.materialClassify.split(';').filter(item => item) : [])
  1790. this.$set(this.modalData, 'materialList', Array.isArray(this.modalData.materialList) ? this.modalData.materialList : [])
  1791. this.$set(this.modalData, 'hsfApproverList', this.modalData.hsfApprover ? this.modalData.hsfApprover.split(';').filter(item => item) : [])
  1792. this.$set(this.modalData, 'buNo', this.modalData.buNo || '')
  1793. this.syncHsfApproverFields()
  1794. this.fillDisplayFields(this.modalData, row || {})
  1795. // 编辑时不允许修改最终客户和项目编码
  1796. this.$set(this.modalData, 'endCustomerFlag', true)
  1797. this.$set(this.modalData, 'projectIdFlag', true)
  1798. this.$set(this.modalData, 'createBy2', '')
  1799. this.$set(this.modalData, 'isReject', 'Y')
  1800. this.$set(this.modalData, 'tpProcessControl', 'N')
  1801. this.$set(this.modalData, 'csProcessControl', 'N')
  1802. this.loadModalButtonCondition()
  1803. this.loadHsfApproverByCurrentProject(false)
  1804. 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))
  1805. }
  1806. }).catch(() => {
  1807. this.loadNodeAuthority(row.site, row.stepId !== null && row.stepId !== undefined ? row.stepId : 10)
  1808. })
  1809. } else {
  1810. this.modalTitle = 'RoHs 新增'
  1811. this.showModalFlag = false
  1812. // 生成一个临时ID用于附件上传绑定
  1813. const tempReferenceNo = 'TEMP-' + new Date().getTime() + '-' + Math.floor(Math.random() * 1000)
  1814. this.modalData = {
  1815. site: this.$store.state.user.site,
  1816. referenceNo: tempReferenceNo,
  1817. applicant: '',
  1818. applicantName: '',
  1819. pm: '',
  1820. pmName: '',
  1821. applicationDate: '',
  1822. process: '',
  1823. plannedMassProductionDate: '',
  1824. color: '',
  1825. vendorCode: '',
  1826. vendorMaterialCode: '',
  1827. materialClassify: '',
  1828. materialClassifyList: [],
  1829. otherMaterialClassify: '',
  1830. materialUseFor: '',
  1831. endCustomer: '',
  1832. endCustomerName: '',
  1833. endCustomerFlag: false,
  1834. projectId: '',
  1835. projectName: '',
  1836. projectIdFlag: true,
  1837. commGroup1: '',
  1838. commGroup1Desc: '',
  1839. commGroup2: '',
  1840. commGroup2Desc: '',
  1841. commGroup3: '',
  1842. commGroup3Desc: '',
  1843. needCreateNumber: '',
  1844. npdEngineer: '',
  1845. npdEngineerName: '',
  1846. materialValidityTime: '',
  1847. materialValidityComments: '',
  1848. needDeviation: '',
  1849. technicalPlan: '',
  1850. wmRequiredSpec: '',
  1851. isFiberMaterial: '',
  1852. materialThickness: '',
  1853. buyer: '',
  1854. buyerName: '',
  1855. expectReportTime: 0,
  1856. qualificationDocumentsNeeded: '',
  1857. qualificationDocumentsNeededList: [],
  1858. testReportIncludingItems: '',
  1859. testReportIncludingItemsList: [],
  1860. remark: '',
  1861. rohsRemark: '',
  1862. status: '草稿',
  1863. sgsReportNumber: '',
  1864. expiredDate: '',
  1865. fiberInformation: '',
  1866. hsfStandard: '',
  1867. hsfApprover: '',
  1868. hsfApproverList: [],
  1869. relatedPeople: '',
  1870. buNo: '',
  1871. validUntil: '',
  1872. isMeetRohsRequirement: '',
  1873. isAhGrade: '',
  1874. hsfSupplierClassification: '',
  1875. materialDesc: '',
  1876. npdRemark: '',
  1877. isSameMaterialDiffSize: '',
  1878. ifsPartNo: '',
  1879. materialList: [],
  1880. stepId: 10,
  1881. rejectFlag: 'N',
  1882. rejectStepId: null,
  1883. createBy2: '',
  1884. isReject: 'Y',
  1885. tpProcessControl: 'N',
  1886. csProcessControl: 'N'
  1887. }
  1888. this.nodeAuthorityLoaded = true
  1889. }
  1890. },
  1891. // 表单提交
  1892. dataFormSubmit () {
  1893. if (!this.canSaveAction()) {
  1894. this.$message.warning('当前状态不允许保存')
  1895. return
  1896. }
  1897. this.normalizeHsfStandardByCustomer(this.modalData)
  1898. this.syncHsfApproverFields()
  1899. this.modalData.qualificationDocumentsNeeded = this.modalData.qualificationDocumentsNeededList.join(';')
  1900. this.modalData.testReportIncludingItems = this.modalData.testReportIncludingItemsList.join(';')
  1901. this.modalData.materialClassify = this.modalData.materialClassifyList.join(';')
  1902. this.modalData.materialList = (this.modalData.materialList || []).map((item, index) => {
  1903. return {
  1904. ...item,
  1905. lineNo: index + 1,
  1906. projectId: this.modalData.projectId
  1907. }
  1908. })
  1909. const submitMethod = this.modalTitle === 'RoHs 新增' ? api.saveRohs : api.updateRohs
  1910. submitMethod(this.modalData).then(({data}) => {
  1911. if (data && data.code === 0) {
  1912. this.$message.success('操作成功')
  1913. this.modalFlag = false
  1914. this.getDataList()
  1915. } else {
  1916. this.$message.error(data.msg || '操作失败')
  1917. }
  1918. })
  1919. },
  1920. // 同意
  1921. agreeSubmit () {
  1922. if (!this.canAgreeAction()) {
  1923. this.$message.warning('当前状态不允许同意')
  1924. return
  1925. }
  1926. this.$confirm('确认同意该申请单?', '提示', {
  1927. confirmButtonText: '确定',
  1928. cancelButtonText: '取消',
  1929. type: 'warning'
  1930. }).then(() => {
  1931. this.submitRohs('Y')
  1932. })
  1933. },
  1934. openRejectModal () {
  1935. if (!this.canRejectAction()) {
  1936. this.$message.warning('当前状态不允许驳回')
  1937. return
  1938. }
  1939. this.rejectOpinion = ''
  1940. this.submitModalFlag = true
  1941. },
  1942. // 驳回
  1943. rejectSubmit () {
  1944. if (!this.rejectOpinion || !this.rejectOpinion.trim()) {
  1945. this.$message.warning('请填写驳回意见')
  1946. return
  1947. }
  1948. this.submitRohs('N')
  1949. },
  1950. submitRohs (nodeConclusion) {
  1951. if (nodeConclusion === 'Y' && !this.canAgreeAction()) {
  1952. this.$message.warning('当前状态不允许同意')
  1953. return
  1954. }
  1955. if (nodeConclusion === 'N' && !this.canRejectAction()) {
  1956. this.$message.warning('当前状态不允许驳回')
  1957. return
  1958. }
  1959. if (!this.modalData.site || !this.modalData.referenceNo) {
  1960. this.$message.warning('单据主键信息缺失,无法提交审批')
  1961. return
  1962. }
  1963. this.normalizeHsfStandardByCustomer(this.modalData)
  1964. this.syncHsfApproverFields()
  1965. if (!this.nodeAuthorityLoaded) {
  1966. this.$message.warning('节点权限加载中,请稍后重试')
  1967. return
  1968. }
  1969. if (!this.validateSubmitRequiredFields()) {
  1970. return
  1971. }
  1972. const submitMaterialList = this.normalizeMaterialListForSave(this.modalData.materialList || [])
  1973. this.submitLoading = true
  1974. let params = {
  1975. ...this.modalData,
  1976. site: this.modalData.site,
  1977. referenceNo: this.modalData.referenceNo,
  1978. materialClassify: (this.modalData.materialClassifyList || []).join(';'),
  1979. qualificationDocumentsNeeded: (this.modalData.qualificationDocumentsNeededList || []).join(';'),
  1980. testReportIncludingItems: (this.modalData.testReportIncludingItemsList || []).join(';'),
  1981. materialList: submitMaterialList,
  1982. nodeConclusion: nodeConclusion,
  1983. rejectOpinion: nodeConclusion === 'N' ? this.rejectOpinion : '',
  1984. menuId: this.menuId,
  1985. documentNo: this.modalData.referenceNo
  1986. }
  1987. api.submitRohs(params).then(({data}) => {
  1988. if (data && data.code === 0) {
  1989. this.$message.success(nodeConclusion === 'Y' ? '同意成功' : '驳回成功')
  1990. this.submitModalFlag = false
  1991. this.modalFlag = false
  1992. this.getDataList()
  1993. } else {
  1994. this.$message.error(data.msg || '提交失败')
  1995. }
  1996. this.submitLoading = false
  1997. }).catch(() => {
  1998. this.submitLoading = false
  1999. })
  2000. },
  2001. // 下达
  2002. issueModal (row) {
  2003. if (!this.authIssue) {
  2004. this.$message.warning('没有下达权限')
  2005. return
  2006. }
  2007. this.$confirm('确认下达该申请单?', '提示', {
  2008. confirmButtonText: '确定',
  2009. cancelButtonText: '取消',
  2010. type: 'warning'
  2011. }).then(() => {
  2012. let params = {
  2013. site: row.site,
  2014. referenceNo: row.referenceNo,
  2015. menuId: this.menuId
  2016. }
  2017. api.issueRohs(params).then(({data}) => {
  2018. if (data && data.code === 0) {
  2019. this.$message.success('下达成功')
  2020. if (this.modalFlag && this.modalData.referenceNo === row.referenceNo) {
  2021. this.modalData.status = '审批中'
  2022. }
  2023. this.getDataList()
  2024. } else {
  2025. this.$message.error(data.msg || '下达失败')
  2026. }
  2027. })
  2028. })
  2029. },
  2030. openProjectMaterialDialog () {
  2031. if (!this.canEditRohsMaterial()) {
  2032. this.$message.warning('当前状态不允许编辑材料')
  2033. return
  2034. }
  2035. if (!this.modalData.projectId) {
  2036. this.$message.warning('请先选择项目编码')
  2037. return
  2038. }
  2039. if (!this.modalData.endCustomer) {
  2040. this.$message.warning('请先选择最终客户')
  2041. return
  2042. }
  2043. this.projectMaterialDialogFlag = true
  2044. this.projectMaterialPageIndex = 1
  2045. this.searchProjectMaterialList()
  2046. },
  2047. searchProjectMaterialList () {
  2048. if (!this.modalData.projectId) {
  2049. this.projectMaterialList = []
  2050. this.projectMaterialTotal = 0
  2051. return
  2052. }
  2053. this.projectMaterialLoading = true
  2054. const params = {
  2055. page: this.projectMaterialPageIndex,
  2056. limit: this.projectMaterialPageSize,
  2057. site: this.$store.state.user.site,
  2058. projectId: this.modalData.projectId,
  2059. endCustomer: this.modalData.endCustomer,
  2060. testPartNo: this.projectMaterialSearchData.testPartNo,
  2061. partDesc: this.projectMaterialSearchData.partDesc,
  2062. finalPartNo: this.projectMaterialSearchData.finalPartNo,
  2063. customerPartNo: this.projectMaterialSearchData.customerPartNo
  2064. }
  2065. api.getRohsProjectMaterialList(params).then(({data}) => {
  2066. if (data && data.code === 0 && data.page) {
  2067. this.projectMaterialList = data.page.list || []
  2068. this.projectMaterialTotal = data.page.totalCount || 0
  2069. this.$nextTick(() => {
  2070. if (this.$refs.projectMaterialTable) {
  2071. this.$refs.projectMaterialTable.clearSelection()
  2072. }
  2073. })
  2074. } else {
  2075. this.projectMaterialList = []
  2076. this.projectMaterialTotal = 0
  2077. this.$message.error(data.msg || '项目物料查询失败')
  2078. }
  2079. this.projectMaterialLoading = false
  2080. }).catch(() => {
  2081. this.projectMaterialList = []
  2082. this.projectMaterialTotal = 0
  2083. this.projectMaterialLoading = false
  2084. })
  2085. },
  2086. projectMaterialSelectionChange (rows) {
  2087. this.projectMaterialSelections = rows || []
  2088. },
  2089. projectMaterialSizeChangeHandle (val) {
  2090. this.projectMaterialPageSize = val
  2091. this.projectMaterialPageIndex = 1
  2092. this.searchProjectMaterialList()
  2093. },
  2094. projectMaterialCurrentChangeHandle (val) {
  2095. this.projectMaterialPageIndex = val
  2096. this.searchProjectMaterialList()
  2097. },
  2098. confirmProjectMaterialSelection () {
  2099. if (!this.canEditRohsMaterial()) {
  2100. this.$message.warning('当前状态不允许编辑材料')
  2101. return
  2102. }
  2103. if (!this.projectMaterialSelections || this.projectMaterialSelections.length === 0) {
  2104. this.$message.warning('请至少选择一条项目物料')
  2105. return
  2106. }
  2107. const appendResult = this.appendMaterialRows(this.projectMaterialSelections)
  2108. if (!appendResult.appendedCount) {
  2109. this.$message.warning('所选物料已存在,未新增数据')
  2110. return
  2111. }
  2112. if (!this.shouldPersistMaterialsImmediately()) {
  2113. this.$set(this.modalData, 'materialList', appendResult.materialList)
  2114. this.projectMaterialDialogFlag = false
  2115. this.$message.success('已加入材料列表,保存单据后写入数据库')
  2116. return
  2117. }
  2118. this.$confirm('确认新增选中材料?', '提示', {
  2119. confirmButtonText: '确定',
  2120. cancelButtonText: '取消',
  2121. type: 'warning'
  2122. }).then(() => {
  2123. this.persistMaterialList(appendResult.materialList, '新增材料成功', () => {
  2124. this.projectMaterialDialogFlag = false
  2125. this.projectMaterialSelections = []
  2126. if (this.$refs.projectMaterialTable) {
  2127. this.$refs.projectMaterialTable.clearSelection()
  2128. }
  2129. })
  2130. }).catch(() => {})
  2131. },
  2132. appendMaterialRows (rows) {
  2133. const materialList = Array.isArray(this.modalData.materialList) ? [...this.modalData.materialList] : []
  2134. const exists = new Set(materialList.map(item => item.testPartNo))
  2135. let appendedCount = 0
  2136. rows.forEach(row => {
  2137. const testPartNo = row.testPartNo || row.test_part_no
  2138. if (!testPartNo || exists.has(testPartNo)) {
  2139. return
  2140. }
  2141. exists.add(testPartNo)
  2142. appendedCount++
  2143. materialList.push({
  2144. site: this.modalData.site,
  2145. referenceNo: this.modalData.referenceNo,
  2146. projectId: this.modalData.projectId,
  2147. testPartNo: testPartNo,
  2148. finalPartNo: row.finalPartNo || row.final_part_no || '',
  2149. customerPartNo: row.customerPartNo || row.customer_part_no || '',
  2150. partDesc: row.partDesc || row.part_desc || '',
  2151. partSpec: row.partSpec || row.part_spec || ''
  2152. })
  2153. })
  2154. return {
  2155. materialList,
  2156. appendedCount
  2157. }
  2158. },
  2159. materialSelectionChange (rows) {
  2160. this.materialSelections = rows || []
  2161. },
  2162. shouldPersistMaterialsImmediately () {
  2163. return this.modalTitle === 'RoHs 编辑' && this.modalData && this.modalData.referenceNo && !String(this.modalData.referenceNo).startsWith('TEMP-')
  2164. },
  2165. normalizeMaterialListForSave (materialList) {
  2166. return (materialList || []).map((item, index) => {
  2167. return {
  2168. ...item,
  2169. lineNo: index + 1,
  2170. projectId: item.projectId || this.modalData.projectId || ''
  2171. }
  2172. })
  2173. },
  2174. persistMaterialList (materialList, successMsg, successCallback) {
  2175. const normalizedList = this.normalizeMaterialListForSave(materialList)
  2176. const payload = {
  2177. site: this.modalData.site,
  2178. referenceNo: this.modalData.referenceNo,
  2179. projectId: this.modalData.projectId,
  2180. materialList: normalizedList
  2181. }
  2182. api.updateRohsMaterials(payload).then(({data}) => {
  2183. if (data && data.code === 0) {
  2184. this.$set(this.modalData, 'materialList', normalizedList)
  2185. this.materialSelections = []
  2186. if (this.currentRow && this.currentRow.referenceNo === this.modalData.referenceNo) {
  2187. this.$set(this.currentRow, 'materialList', normalizedList)
  2188. }
  2189. this.$message.success(successMsg || '保存成功')
  2190. if (typeof successCallback === 'function') {
  2191. successCallback()
  2192. }
  2193. } else {
  2194. this.$message.error((data && data.msg) || '保存失败')
  2195. }
  2196. }).catch(() => {
  2197. this.$message.error('保存失败')
  2198. })
  2199. },
  2200. removeSelectedMaterialRows () {
  2201. if (!this.canEditRohsMaterial()) {
  2202. this.$message.warning('当前状态不允许编辑材料')
  2203. return
  2204. }
  2205. if (!this.materialSelections || this.materialSelections.length === 0) {
  2206. this.$message.warning('请先选择要删除的材料')
  2207. return
  2208. }
  2209. const removeSet = new Set(this.materialSelections.map(item => item.testPartNo))
  2210. const materialList = (this.modalData.materialList || []).filter(item => !removeSet.has(item.testPartNo))
  2211. if (!this.shouldPersistMaterialsImmediately()) {
  2212. this.$set(this.modalData, 'materialList', materialList)
  2213. this.materialSelections = []
  2214. this.$message.success('已删除材料,保存单据后写入数据库')
  2215. return
  2216. }
  2217. this.$confirm('确认删除选中材料?', '提示', {
  2218. confirmButtonText: '确定',
  2219. cancelButtonText: '取消',
  2220. type: 'warning'
  2221. }).then(() => {
  2222. this.persistMaterialList(materialList, '删除材料成功')
  2223. }).catch(() => {})
  2224. },
  2225. // ======== chooseList相关方法 ========
  2226. // 获取基础数据列表
  2227. getBaseList (val, type) {
  2228. this.tagNo = val
  2229. this.tagNo1 = type
  2230. this.$nextTick(() => {
  2231. let strVal = ''
  2232. let conSql = ''
  2233. if (val === 102) {
  2234. if (type === 1) {
  2235. strVal = this.modalData.endCustomer
  2236. }
  2237. }
  2238. if (val === 103) {
  2239. if (type === 1) {
  2240. strVal = this.modalData.applicant
  2241. } else if (type === 3) {
  2242. strVal = this.modalData.npdEngineer
  2243. } else if (type === 4) {
  2244. strVal = this.modalData.technicalPlan
  2245. } else if (type === 5) {
  2246. strVal = this.modalData.pm
  2247. }
  2248. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  2249. }
  2250. if (val === 2000) {
  2251. strVal = this.modalData.buyer
  2252. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  2253. }
  2254. if (val === 110) {
  2255. strVal = this.modalData.commGroup1
  2256. }
  2257. if (val === 111) {
  2258. strVal = this.modalData.commGroup2
  2259. }
  2260. if (val === 130) {
  2261. strVal = this.modalData.commGroup3
  2262. }
  2263. this.$refs.baseList.init(val, strVal, conSql)
  2264. })
  2265. },
  2266. // 列表方法的回调
  2267. getBaseData (val) {
  2268. if (this.tagNo === 102) {
  2269. if (this.tagNo1 === 1) {
  2270. if (val.Customer_no === this.modalData.endCustomer) {
  2271. return
  2272. }
  2273. if (this.modalData.projectIdFlag) {
  2274. this.modalData.projectIdFlag = false
  2275. }
  2276. this.modalData.endCustomer = val.Customer_no
  2277. this.modalData.endCustomerName = val.Customer_desc
  2278. this.modalData.projectId = ''
  2279. this.modalData.projectName = ''
  2280. this.modalData.buNo = ''
  2281. this.$set(this.modalData, 'materialList', [])
  2282. this.clearHsfApproverFields(false)
  2283. }
  2284. }
  2285. if (this.tagNo === 103) {
  2286. if (this.tagNo1 === 1) {
  2287. this.modalData.applicant = val.username
  2288. this.modalData.applicantName = val.user_display
  2289. } else if (this.tagNo1 === 3) {
  2290. this.modalData.npdEngineer = val.username
  2291. this.modalData.npdEngineerName = val.user_display
  2292. } else if (this.tagNo1 === 4) {
  2293. this.modalData.technicalPlan = val.username
  2294. this.modalData.technicalPlanName = val.user_display
  2295. } else if (this.tagNo1 === 5) {
  2296. this.modalData.pm = val.username
  2297. this.modalData.pmName = val.user_display
  2298. }
  2299. }
  2300. if (this.tagNo === 110) {
  2301. this.modalData.commGroup1 = val.product_group_id
  2302. this.modalData.commGroup1Desc = val.product_group_name
  2303. }
  2304. if (this.tagNo === 111) {
  2305. this.modalData.commGroup2 = val.product_group_id
  2306. this.modalData.commGroup2Desc = val.product_group_name
  2307. }
  2308. if (this.tagNo === 130) {
  2309. this.modalData.commGroup3 = val.product_group_id
  2310. this.modalData.commGroup3Desc = val.product_group_name
  2311. }
  2312. if (this.tagNo === 2000) {
  2313. this.modalData.buyer = val.username
  2314. this.modalData.buyerName = val.user_display
  2315. }
  2316. },
  2317. handleQueryCustomer() {
  2318. if (!this.modalData.endCustomer) {
  2319. this.modalData.endCustomerName = ''
  2320. this.modalData.projectId = ''
  2321. this.modalData.projectName = ''
  2322. this.modalData.buNo = ''
  2323. this.modalData.projectIdFlag = true
  2324. this.$set(this.modalData, 'materialList', [])
  2325. this.clearHsfApproverFields(false)
  2326. return
  2327. }
  2328. let params = {
  2329. site: this.$store.state.user.site,
  2330. customerNo: this.modalData.endCustomer
  2331. }
  2332. queryCustomer(params).then(({data}) => {
  2333. if (data && data.code === 0) {
  2334. if (data.rows && data.rows.length === 1) {
  2335. const customer = data.rows[0]
  2336. this.modalData.endCustomerName = customer.customerDesc || customer.Customer_desc || customer.customerName || ''
  2337. this.modalData.projectIdFlag = !!this.modalData.endCustomerFlag
  2338. } else {
  2339. this.modalData.endCustomerName = ''
  2340. this.modalData.projectId = ''
  2341. this.modalData.projectName = ''
  2342. this.modalData.buNo = ''
  2343. this.modalData.projectIdFlag = true
  2344. this.$set(this.modalData, 'materialList', [])
  2345. this.clearHsfApproverFields(false)
  2346. }
  2347. } else {
  2348. this.modalData.endCustomerName = ''
  2349. this.modalData.projectId = ''
  2350. this.modalData.projectName = ''
  2351. this.modalData.buNo = ''
  2352. this.modalData.projectIdFlag = true
  2353. this.$set(this.modalData, 'materialList', [])
  2354. this.clearHsfApproverFields(false)
  2355. }
  2356. }).catch((error) => {
  2357. this.modalData.endCustomerName = ''
  2358. this.modalData.projectId = ''
  2359. this.modalData.projectName = ''
  2360. this.modalData.buNo = ''
  2361. this.modalData.projectIdFlag = true
  2362. this.$set(this.modalData, 'materialList', [])
  2363. this.clearHsfApproverFields(false)
  2364. })
  2365. },
  2366. handleQueryProjectByCustomer() {
  2367. if (!this.modalData.projectId) {
  2368. this.modalData.projectName = ''
  2369. this.modalData.buNo = ''
  2370. this.clearHsfApproverFields(false)
  2371. return
  2372. }
  2373. let params = {
  2374. site: this.$store.state.user.site,
  2375. projectId: this.modalData.projectId
  2376. }
  2377. if (this.modalData.endCustomer) {
  2378. params.customerId = this.modalData.endCustomer
  2379. }
  2380. queryProjectByCustomer(params).then(({data}) => {
  2381. if (data && data.code === 0) {
  2382. if (data.rows && data.rows.length === 1) {
  2383. const project = data.rows[0]
  2384. this.modalData.projectName = project.projectName || project.Project_name || ''
  2385. this.modalData.buNo = project.buNo || project.bu_no || ''
  2386. const forceSelectAll = !this.isEditMode
  2387. this.loadHsfApproverByCurrentProject(forceSelectAll)
  2388. } else {
  2389. this.modalData.projectName = ''
  2390. this.modalData.buNo = ''
  2391. this.clearHsfApproverFields(false)
  2392. }
  2393. } else {
  2394. this.modalData.projectName = ''
  2395. this.modalData.buNo = ''
  2396. this.clearHsfApproverFields(false)
  2397. }
  2398. }).catch((error) => {
  2399. this.modalData.projectName = ''
  2400. this.modalData.buNo = ''
  2401. this.clearHsfApproverFields(false)
  2402. })
  2403. },
  2404. projectClickRow(row) {
  2405. const oldProjectId = this.modalData.projectId
  2406. this.modalData.projectId = row.projectId
  2407. this.modalData.projectName = row.projectName
  2408. this.modalData.buNo = row.buNo || row.bu_no || ''
  2409. if (this.modalData.endCustomer && this.modalData.endCustomer !== '') {
  2410. // do nothing
  2411. } else {
  2412. this.modalData.endCustomer = row.customerId
  2413. this.modalData.endCustomerName = row.customerName
  2414. }
  2415. if (oldProjectId && oldProjectId !== row.projectId) {
  2416. this.$set(this.modalData, 'materialList', [])
  2417. }
  2418. this.loadHsfApproverByCurrentProject(!this.isEditMode)
  2419. this.chooseProjectListFlag = false
  2420. },
  2421. searchProjectInfoList() {
  2422. this.projectList = [];
  2423. if (this.modalData.endCustomer && this.modalData.endCustomer !== '') {
  2424. this.searchProjectData.customerId = this.modalData.endCustomer
  2425. } else {
  2426. this.searchProjectData.customerId = undefined
  2427. }
  2428. this.searchProjectData.site = this.$store.state.user.site
  2429. searchProjectInfoList(this.searchProjectData).then(({data}) => {
  2430. if (data && data.code === 0) {
  2431. const rows = data.rows || []
  2432. this.projectList = rows
  2433. if ((!this.modalData.endCustomer || this.modalData.endCustomer === '') && rows.length > 0) {
  2434. this.modalData.projectId = rows[0].projectId
  2435. this.modalData.projectName = rows[0].projectName
  2436. this.modalData.endCustomer = rows[0].customerId
  2437. this.modalData.endCustomerName = rows[0].customerName
  2438. this.modalData.buNo = rows[0].buNo || rows[0].bu_no || ''
  2439. this.loadHsfApproverByCurrentProject(!this.isEditMode)
  2440. }
  2441. } else {
  2442. this.projectList = []
  2443. }
  2444. }).catch((error) => {
  2445. this.$message.error('查询项目信息失败')
  2446. })
  2447. },
  2448. closeProjectInfoDialog() {
  2449. if(this.$refs.closeProjectInfoForm) {
  2450. this.$refs.closeProjectInfoForm.resetFields();
  2451. }
  2452. this.searchProjectData = {
  2453. site: this.$store.state.user.site,
  2454. projectId: undefined,
  2455. projectName: undefined,
  2456. customerId: undefined,
  2457. }
  2458. },
  2459. // 申请人输入校验
  2460. applicantBlur (tagNo) {
  2461. if (this.modalData.applicant != null && this.modalData.applicant !== '') {
  2462. let tempData = {
  2463. tagno: tagNo,
  2464. conditionSql: " and a.username = '" + this.modalData.applicant + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  2465. }
  2466. verifyData(tempData).then(({data}) => {
  2467. if (data && data.code === 0) {
  2468. if (data.baseListData.length > 0) {
  2469. this.modalData.applicant = data.baseListData[0].username
  2470. this.modalData.applicantName = data.baseListData[0].user_display
  2471. return
  2472. }
  2473. }
  2474. this.modalData.applicantName = ''
  2475. })
  2476. } else {
  2477. this.modalData.applicantName = ''
  2478. }
  2479. },
  2480. // PM输入校验
  2481. pmBlur (tagNo) {
  2482. if (this.modalData.pm != null && this.modalData.pm !== '') {
  2483. let tempData = {
  2484. tagno: tagNo,
  2485. conditionSql: " and a.username = '" + this.modalData.pm + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  2486. }
  2487. verifyData(tempData).then(({data}) => {
  2488. if (data && data.code === 0) {
  2489. if (data.baseListData.length > 0) {
  2490. this.modalData.pm = data.baseListData[0].username
  2491. this.modalData.pmName = data.baseListData[0].user_display
  2492. return
  2493. }
  2494. }
  2495. this.modalData.pmName = ''
  2496. })
  2497. } else {
  2498. this.modalData.pmName = ''
  2499. }
  2500. },
  2501. // NPD工程师输入校验
  2502. npdEngineerBlur (tagNo) {
  2503. if (this.modalData.npdEngineer != null && this.modalData.npdEngineer !== '') {
  2504. let tempData = {
  2505. tagno: tagNo,
  2506. conditionSql: " and a.username = '" + this.modalData.npdEngineer + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  2507. }
  2508. verifyData(tempData).then(({data}) => {
  2509. if (data && data.code === 0) {
  2510. if (data.baseListData.length > 0) {
  2511. this.modalData.npdEngineer = data.baseListData[0].username
  2512. this.modalData.npdEngineerName = data.baseListData[0].user_display
  2513. return
  2514. }
  2515. }
  2516. this.modalData.npdEngineerName = ''
  2517. })
  2518. } else {
  2519. this.modalData.npdEngineerName = ''
  2520. }
  2521. },
  2522. // 技术计划输入校验
  2523. technicalPlanBlur (tagNo) {
  2524. if (this.modalData.technicalPlan != null && this.modalData.technicalPlan !== '') {
  2525. let tempData = {
  2526. tagno: tagNo,
  2527. conditionSql: " and a.username = '" + this.modalData.technicalPlan + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  2528. }
  2529. verifyData(tempData).then(({data}) => {
  2530. if (data && data.code === 0) {
  2531. if (data.baseListData.length > 0) {
  2532. this.modalData.technicalPlan = data.baseListData[0].username
  2533. this.modalData.technicalPlanName = data.baseListData[0].user_display
  2534. return
  2535. }
  2536. }
  2537. this.modalData.technicalPlanName = ''
  2538. })
  2539. } else {
  2540. this.modalData.technicalPlanName = ''
  2541. }
  2542. },
  2543. // 采购输入校验
  2544. buyerBlur (tagNo) {
  2545. if (this.modalData.buyer != null && this.modalData.buyer !== '') {
  2546. let tempData = {
  2547. tagno: tagNo,
  2548. conditionSql: " and a.username = '" + this.modalData.buyer + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  2549. }
  2550. verifyData(tempData).then(({data}) => {
  2551. if (data && data.code === 0) {
  2552. if (data.baseListData.length > 0) {
  2553. this.modalData.buyer = data.baseListData[0].username
  2554. this.modalData.buyerName = data.baseListData[0].user_display
  2555. return
  2556. }
  2557. }
  2558. this.modalData.buyerName = ''
  2559. })
  2560. } else {
  2561. this.modalData.buyerName = ''
  2562. }
  2563. },
  2564. // 商品组1输入校验
  2565. commGroup1Blur (tagNo) {
  2566. if (this.modalData.commGroup1 != null && this.modalData.commGroup1 !== '') {
  2567. let tempData = {
  2568. tagno: tagNo,
  2569. conditionSql: " and product_group_id = '" + this.modalData.commGroup1 + "'" + " and site = '" + this.$store.state.user.site + "'"
  2570. }
  2571. verifyData(tempData).then(({data}) => {
  2572. if (data && data.code === 0 && data.baseListData.length > 0) {
  2573. this.modalData.commGroup1 = data.baseListData[0].product_group_id
  2574. this.modalData.commGroup1Desc = data.baseListData[0].product_group_name
  2575. } else {
  2576. this.modalData.commGroup1Desc = ''
  2577. }
  2578. })
  2579. } else {
  2580. this.modalData.commGroup1Desc = ''
  2581. }
  2582. },
  2583. // 商品组2输入校验
  2584. commGroup2Blur (tagNo) {
  2585. if (this.modalData.commGroup2 != null && this.modalData.commGroup2 !== '') {
  2586. let tempData = {
  2587. tagno: tagNo,
  2588. conditionSql: " and product_group_id = '" + this.modalData.commGroup2 + "'" + " and site = '" + this.$store.state.user.site + "'"
  2589. }
  2590. verifyData(tempData).then(({data}) => {
  2591. if (data && data.code === 0 && data.baseListData.length > 0) {
  2592. this.modalData.commGroup2 = data.baseListData[0].product_group_id
  2593. this.modalData.commGroup2Desc = data.baseListData[0].product_group_name
  2594. } else {
  2595. this.modalData.commGroup2Desc = ''
  2596. }
  2597. })
  2598. } else {
  2599. this.modalData.commGroup2Desc = ''
  2600. }
  2601. },
  2602. // 商品组3输入校验
  2603. commGroup3Blur (tagNo) {
  2604. if (this.modalData.commGroup3 != null && this.modalData.commGroup3 !== '') {
  2605. let tempData = {
  2606. tagno: tagNo,
  2607. conditionSql: " and product_group_id = '" + this.modalData.commGroup3 + "'" + " and site = '" + this.$store.state.user.site + "'"
  2608. }
  2609. verifyData(tempData).then(({data}) => {
  2610. if (data && data.code === 0 && data.baseListData.length > 0) {
  2611. this.modalData.commGroup3 = data.baseListData[0].product_group_id
  2612. this.modalData.commGroup3Desc = data.baseListData[0].product_group_name
  2613. } else {
  2614. this.modalData.commGroup3Desc = ''
  2615. }
  2616. })
  2617. } else {
  2618. this.modalData.commGroup3Desc = ''
  2619. }
  2620. }
  2621. }
  2622. }
  2623. </script>
  2624. <style scoped lang="scss">
  2625. /deep/ .customer-tab .el-tabs__content {
  2626. padding: 0 !important;
  2627. }
  2628. /deep/ .rohs-material-table .el-table__header-wrapper th > .cell {
  2629. white-space: nowrap;
  2630. word-break: keep-all;
  2631. }
  2632. /deep/ .rohs-multiple-ellipsis.el-select .el-select__tags,
  2633. /deep/ .rohs-multiple-ellipsis .el-select .el-select__tags {
  2634. max-width: calc(100% - 34px) !important;
  2635. overflow: hidden;
  2636. white-space: nowrap;
  2637. }
  2638. /deep/ .rohs-multiple-ellipsis.el-select .el-select__tags > span,
  2639. /deep/ .rohs-multiple-ellipsis .el-select .el-select__tags > span {
  2640. display: block;
  2641. max-width: 100%;
  2642. overflow: hidden;
  2643. white-space: nowrap;
  2644. text-overflow: ellipsis;
  2645. }
  2646. /deep/ .rohs-multiple-ellipsis.el-select .el-select__tags .el-tag,
  2647. /deep/ .rohs-multiple-ellipsis .el-select .el-select__tags .el-tag {
  2648. display: inline-flex;
  2649. max-width: 120px;
  2650. margin-right: 4px;
  2651. overflow: hidden;
  2652. vertical-align: middle;
  2653. }
  2654. /deep/ .rohs-multiple-ellipsis.el-select .el-select__tags .el-tag .el-select__tags-text,
  2655. /deep/ .rohs-multiple-ellipsis .el-select .el-select__tags .el-tag .el-select__tags-text {
  2656. overflow: hidden;
  2657. text-overflow: ellipsis;
  2658. white-space: nowrap;
  2659. }
  2660. </style>