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.

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