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.

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