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.

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