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.

1238 lines
58 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 @click="getDataList">查询</el-button>
  13. <el-button @click="addOrUpdateHandle()">新增</el-button>
  14. <el-button @click="exportHandle()">导出</el-button>
  15. <el-button @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="applicationDate" header-align="center" align="center" label="申请日期/Application Date" width="165"></el-table-column>
  33. <el-table-column prop="process" header-align="center" align="center" label="工艺/Process" width="120"></el-table-column>
  34. <el-table-column prop="vendorCode" header-align="center" align="center" label="供应商代码/Vendor Code" width="160"></el-table-column>
  35. <el-table-column prop="vendorMaterialCode" header-align="center" align="center" label="供应商材料编号/Vendor Material Code" width="200" :show-overflow-tooltip="true"></el-table-column>
  36. <el-table-column prop="materialClassify" header-align="center" align="center" label="材料分类/Material Classify" width="200" :show-overflow-tooltip="true"></el-table-column>
  37. <el-table-column prop="otherMaterialClassify" header-align="center" align="center" label="其他材料分类/Other Material Classify" width="210" :show-overflow-tooltip="true"></el-table-column>
  38. <el-table-column prop="materialUseFor" header-align="center" align="center" label="辅材用途/Material Use For" width="180" :show-overflow-tooltip="true"></el-table-column>
  39. <el-table-column prop="endCustomer" header-align="center" align="center" label="最终客户/End Customer" width="150"></el-table-column>
  40. <el-table-column prop="projectId" header-align="center" align="center" label="项目编码/Project ID" width="140"></el-table-column>
  41. <el-table-column prop="isMacallanMaterial" header-align="center" align="center" label="Macallan材料/Macallan Material" width="180"></el-table-column>
  42. <el-table-column prop="needCreateNumber" header-align="center" align="center" label="需创建内部编号/Need Create No." width="200"></el-table-column>
  43. <el-table-column prop="npdEngineer" header-align="center" align="center" label="NPD工程师/NPD Engineer" width="170"></el-table-column>
  44. <el-table-column prop="materialValidityTime" header-align="center" align="center" label="材料有效期/Material Validity Time" width="200"></el-table-column>
  45. <el-table-column prop="needDeviation" header-align="center" align="center" label="是否需偏差许可/Need Deviation" width="190"></el-table-column>
  46. <el-table-column prop="technicalPlan" header-align="center" align="center" label="技术计划/Technical Plan" width="170"></el-table-column>
  47. <el-table-column prop="buyer" header-align="center" align="center" label="采购/Buyer" width="130"></el-table-column>
  48. <el-table-column prop="expectReportTime" header-align="center" align="center" label="报告时间(月)/Expect Report Time" width="200"></el-table-column>
  49. <el-table-column prop="sgsReportNumber" header-align="center" align="center" label="SGS报告编号/SGS Report Number" width="190" :show-overflow-tooltip="true"></el-table-column>
  50. <el-table-column prop="expiredDate" header-align="center" align="center" label="报告有效期/Expired Date" width="165"></el-table-column>
  51. <el-table-column prop="isMeetRohsRequirement" header-align="center" align="center" label="符合RoHS/Meet RoHS Req" width="170"></el-table-column>
  52. <el-table-column prop="hsfSupplierClassification" header-align="center" align="center" label="HSF供应商等级/Supplier Class" width="220"></el-table-column>
  53. <el-table-column prop="isSameMaterialDiffSize" header-align="center" align="center" label="同材不同规格/Same Material Diff Size" width="220"></el-table-column>
  54. <el-table-column prop="ifsPartNo" header-align="center" align="center" label="IFS编号/IFS Part No." width="150"></el-table-column>
  55. <el-table-column prop="remark" header-align="center" align="center" label="备注/Remark" width="220" :show-overflow-tooltip="true"></el-table-column>
  56. <el-table-column fixed="right" header-align="center" align="center" width="130" label="操作/Operation">
  57. <template slot-scope="scope">
  58. <el-link style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">编辑</el-link>
  59. <el-link v-if="scope.row.status === '草稿'" style="cursor: pointer; margin-left: 10px;" @click="issueModal(scope.row)">下达</el-link>
  60. </template>
  61. </el-table-column>
  62. </el-table>
  63. <!-- 分页 -->
  64. <el-pagination style="margin-top: 0px"
  65. @size-change="sizeChangeHandle"
  66. @current-change="currentChangeHandle"
  67. :current-page="pageIndex"
  68. :page-sizes="[20, 50, 100, 200, 500]"
  69. :page-size="pageSize"
  70. :total="totalPage"
  71. layout="total, sizes, prev, pager, next, jumper">
  72. </el-pagination>
  73. <!-- 编辑模态框 -->
  74. <el-dialog
  75. :title="modalTitle"
  76. :visible.sync="modalFlag"
  77. width="1010px"
  78. top="10vh"
  79. v-drag
  80. :close-on-click-modal="false"
  81. :showClose="false">
  82. <el-tabs tab-position="left" type="border-card" v-model="activeName" style="width: 100%;height: 565px;">
  83. <!-- 基本信息 -->
  84. <el-tab-pane label="基本信息" name="basicInfo">
  85. <div style="height: 550px">
  86. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  87. <el-form-item>
  88. <span style="cursor: pointer" slot="label" @click="getBaseList(103, 1)"><a herf="#">申请人/Applicant</a></span>
  89. <el-input v-model="modalData.applicant" @blur="applicantBlur(103)" style="width: 150px"></el-input>
  90. <el-input v-model="modalData.applicantName" disabled style="width: 240px"></el-input>
  91. </el-form-item>
  92. <el-form-item label="申请日期/Application Date">
  93. <el-date-picker v-model="modalData.applicationDate" type="date" value-format="yyyy-MM-dd" style="width: 190px" :editable=false></el-date-picker>
  94. </el-form-item>
  95. <el-form-item label="工艺/Process">
  96. <dict-data-select v-model="modalData.process" clearable style="width: 190px" dict-type="rohs_process"></dict-data-select>
  97. </el-form-item>
  98. </el-form>
  99. <el-form :inline="true" label-position="top" :model="modalData">
  100. <el-form-item label="供应商代码/Vendor Code">
  101. <el-input v-model="modalData.vendorCode" style="width: 150px"></el-input>
  102. </el-form-item>
  103. <el-form-item label="供应商材料编号/Vendor Material Code" style="margin-left: -10px">
  104. <el-input v-model="modalData.vendorMaterialCode" style="width: 240px"></el-input>
  105. </el-form-item>
  106. <el-form-item label="辅材用途/Material Use For">
  107. <el-input v-model="modalData.materialUseFor" style="width: 190px"></el-input>
  108. </el-form-item>
  109. </el-form>
  110. <el-form :inline="true" label-position="top" :model="modalData">
  111. <el-form-item label="材料分类/Material Classify">
  112. <dict-data-select v-model="modalData.materialClassifyList" multiple :collapse-tags="true" style="width: 394px" dict-type="rohs_material_classify"></dict-data-select>
  113. </el-form-item>
  114. <el-form-item label="其他材料分类/Other Material Classify" v-if="modalData.materialClassifyList && modalData.materialClassifyList.includes('Other其他')">
  115. <el-input v-model="modalData.otherMaterialClassify" 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>
  120. <span slot="label" v-if="!modalData.endCustomerFlag" @click="getBaseList(102, 1)"><a herf="#">最终客户/End Customer</a></span>
  121. <span slot="label" v-else>最终客户/End Customer</span>
  122. <el-input :disabled="modalData.endCustomerFlag" readonly v-model="modalData.endCustomer" @blur="handleQueryCustomer" style="width: 150px"></el-input>
  123. <el-input disabled v-model="modalData.endCustomerName" style="width: 240px"></el-input>
  124. </el-form-item>
  125. <el-form-item label="Macallan材料/Macallan Material">
  126. <el-radio-group v-model="modalData.isMacallanMaterial" style="width: 190px">
  127. <el-radio label="Y" @click.native.prevent="radioClick('isMacallanMaterial', 'Y')"></el-radio>
  128. <el-radio label="N" @click.native.prevent="radioClick('isMacallanMaterial', 'N')"></el-radio>
  129. </el-radio-group>
  130. </el-form-item>
  131. </el-form>
  132. <el-form :inline="true" label-position="top" :model="modalData">
  133. <el-form-item>
  134. <span slot="label" v-if="!modalData.projectIdFlag" @click="chooseProjectListFlag = true"><a herf="#">项目编码/Project ID</a></span>
  135. <span slot="label" v-else>项目编码/Project ID</span>
  136. <el-input :disabled="modalData.projectIdFlag" readonly v-model="modalData.projectId" @blur="handleQueryProjectByCustomer" style="width: 150px"></el-input>
  137. <el-input disabled v-model="modalData.projectName" style="width: 240px"></el-input>
  138. </el-form-item>
  139. <el-form-item label="需创建内部编号/Need Create No.">
  140. <el-radio-group v-model="modalData.needCreateNumber" style="width: 190px">
  141. <el-radio label="Y" @click.native.prevent="radioClick('needCreateNumber', 'Y')"></el-radio>
  142. <el-radio label="N" @click.native.prevent="radioClick('needCreateNumber', 'N')"></el-radio>
  143. </el-radio-group>
  144. </el-form-item>
  145. </el-form>
  146. <el-form :inline="true" label-position="top" :model="modalData">
  147. <el-form-item>
  148. <span style="cursor: pointer" slot="label" @click="getBaseList(103, 3)"><a herf="#">NPD工程师/NPD Engineer</a></span>
  149. <el-input v-model="modalData.npdEngineer" @blur="npdEngineerBlur(103)" style="width: 150px"></el-input>
  150. <el-input v-model="modalData.npdEngineerName" disabled style="width: 240px"></el-input>
  151. </el-form-item>
  152. <el-form-item label="是否需偏差许可/Need Deviation">
  153. <el-radio-group v-model="modalData.needDeviation" style="width: 190px">
  154. <el-radio label="Y" @click.native.prevent="radioClick('needDeviation', 'Y')"></el-radio>
  155. <el-radio label="N" @click.native.prevent="radioClick('needDeviation', 'N')"></el-radio>
  156. </el-radio-group>
  157. </el-form-item>
  158. </el-form>
  159. <el-form :inline="true" label-position="top" :model="modalData">
  160. <el-form-item label="材料有效期/Material Validity Time">
  161. <el-date-picker v-model="modalData.materialValidityTime" type="date" value-format="yyyy-MM-dd" style="width: 190px" :editable=false></el-date-picker>
  162. </el-form-item>
  163. <el-form-item label="有效期备注/Validity Comments">
  164. <el-input v-model="modalData.materialValidityComments" style="width: 190px"></el-input>
  165. </el-form-item>
  166. <el-form-item label="是否Fiber材料/Fiber Material">
  167. <el-radio-group v-model="modalData.isFiberMaterial" style="width: 190px">
  168. <el-radio label="Y" @click.native.prevent="radioClick('isFiberMaterial', 'Y')"></el-radio>
  169. <el-radio label="N" @click.native.prevent="radioClick('isFiberMaterial', 'N')"></el-radio>
  170. </el-radio-group>
  171. </el-form-item>
  172. </el-form>
  173. <el-form :inline="true" label-position="top" :model="modalData">
  174. <el-form-item>
  175. <span style="cursor: pointer" slot="label" @click="getBaseList(103, 4)"><a herf="#">技术计划/Technical Plan</a></span>
  176. <el-input v-model="modalData.technicalPlan" @blur="technicalPlanBlur(103)" style="width: 150px"></el-input>
  177. <el-input v-model="modalData.technicalPlanName" disabled style="width: 240px"></el-input>
  178. </el-form-item>
  179. <el-form-item label="WM所需求规格/WM Required Spec">
  180. <el-input v-model="modalData.wmRequiredSpec" style="width: 190px"></el-input>
  181. </el-form-item>
  182. <el-form-item label="材料厚度/Material Thickness">
  183. <el-input v-model="modalData.materialThickness" style="width: 190px"></el-input>
  184. </el-form-item>
  185. </el-form>
  186. <el-form :inline="true" label-position="top" :model="modalData">
  187. <el-form-item>
  188. <span style="cursor: pointer" slot="label" @click="getBaseList(2000, 2)"><a herf="#">采购/Buyer</a></span>
  189. <el-input v-model="modalData.buyer" @blur="buyerBlur(2000)" style="width: 150px"></el-input>
  190. <el-input v-model="modalData.buyerName" disabled style="width: 240px"></el-input>
  191. </el-form-item>
  192. <el-form-item label="报告时间(月)/Expect Report Time">
  193. <el-input class="inlineNumber numInput" v-model="modalData.expectReportTime" type="number" style="width: 190px"></el-input>
  194. </el-form-item>
  195. <el-form-item label=" " style="margin-top: -2px;margin-left: 2px">
  196. <el-button type="primary" icon="el-icon-upload" @click="uploadDialog = true">上传附件</el-button>
  197. </el-form-item>
  198. </el-form>
  199. <el-form :inline="true" label-position="top" :model="modalData">
  200. <el-form-item label="所需审批文件/Docs Needed" >
  201. <dict-data-select v-model="modalData.qualificationDocumentsNeededList" multiple :collapse-tags="true" style="width: 394px" dict-type="rohs_qualification_docs"></dict-data-select>
  202. </el-form-item>
  203. <el-form-item label="测试报告必测项/Test Items">
  204. <dict-data-select v-model="modalData.testReportIncludingItemsList" multiple :collapse-tags="true" style="width: 394px" dict-type="rohs_test_report_items"></dict-data-select>
  205. </el-form-item>
  206. </el-form>
  207. <el-form :inline="true" label-position="top" :model="modalData">
  208. <el-form-item label="备注说明/Remark" style="display: block;">
  209. <el-input type="textarea" :rows="3" v-model="modalData.remark" resize="none" style="width: 802px;height: 30px"></el-input>
  210. </el-form-item>
  211. </el-form>
  212. </div>
  213. </el-tab-pane>
  214. <!-- HSF 填写信息 -->
  215. <el-tab-pane label="HSF 填写信息" name="hsfInfo">
  216. <div style="height: 550px">
  217. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  218. <!-- <el-form-item label="单据状态/Doc Status">-->
  219. <!-- <el-input v-model="modalData.status" disabled style="width: 205px"></el-input>-->
  220. <!-- </el-form-item>-->
  221. <el-form-item label="SGS报告编号/SGS Report Number">
  222. <el-input v-model="modalData.sgsReportNumber" style="width: 230px"></el-input>
  223. </el-form-item>
  224. <el-form-item label="报告有效期/Expired Date">
  225. <el-date-picker v-model="modalData.expiredDate" type="date" value-format="yyyy-MM-dd" style="width: 150px" :editable=false></el-date-picker>
  226. </el-form-item>
  227. <el-form-item label="是否符合RoHS/Meet RoHS Req">
  228. <el-radio-group v-model="modalData.isMeetRohsRequirement" style="width: 180px">
  229. <el-radio label="Y" @click.native.prevent="radioClick('isMeetRohsRequirement', 'Y')"></el-radio>
  230. <el-radio label="N" @click.native.prevent="radioClick('isMeetRohsRequirement', 'N')"></el-radio>
  231. </el-radio-group>
  232. </el-form-item>
  233. <el-form-item label="HSF供应商等级/Supplier Class">
  234. <el-radio-group v-model="modalData.hsfSupplierClassification" style="width: 200px">
  235. <el-radio label="A类" @click.native.prevent="radioClick('hsfSupplierClassification', 'A类')">A类</el-radio>
  236. <el-radio label="B类" @click.native.prevent="radioClick('hsfSupplierClassification', 'B类')">B类</el-radio>
  237. <el-radio label="C类" @click.native.prevent="radioClick('hsfSupplierClassification', 'C类')">C类</el-radio>
  238. </el-radio-group>
  239. </el-form-item>
  240. </el-form>
  241. <el-form :inline="true" label-position="top" :model="modalData">
  242. <el-form-item label="Fiber报告信息/Fiber Information" style="display: block;">
  243. <el-input type="textarea" :rows="3" v-model="modalData.fiberInformation" resize="none" style="width: 802px;height: 30px"></el-input>
  244. </el-form-item>
  245. </el-form>
  246. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 50px">
  247. <el-form-item label="HSF标准/HSF Standard" style="display: block;">
  248. <el-input type="textarea" :rows="3" v-model="modalData.hsfStandard" resize="none" style="width: 802px;height: 30px"></el-input>
  249. </el-form-item>
  250. </el-form>
  251. </div>
  252. </el-tab-pane>
  253. <!-- NPD 信息 -->
  254. <el-tab-pane label="NPD 信息" name="npdInfo">
  255. <div style="height: 550px">
  256. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  257. <el-form-item label="现有材料不同规格/Same Material Diff Size">
  258. <el-radio-group v-model="modalData.isSameMaterialDiffSize" style="width: 190px">
  259. <el-radio label="Y" @click.native.prevent="radioClick('isSameMaterialDiffSize', 'Y')"></el-radio>
  260. <el-radio label="N" @click.native.prevent="radioClick('isSameMaterialDiffSize', 'N')"></el-radio>
  261. </el-radio-group>
  262. </el-form-item>
  263. </el-form>
  264. <el-form :inline="true" label-position="top" :model="modalData">
  265. <el-form-item label="材料描述/Material Desc." style="display: block;">
  266. <el-input type="textarea" :rows="3" v-model="modalData.materialDesc" resize="none" style="width: 802px;height: 30px"></el-input>
  267. </el-form-item>
  268. </el-form>
  269. </div>
  270. </el-tab-pane>
  271. <!-- 材料信息 -->
  272. <el-tab-pane label="材料信息" name="materialInfo">
  273. <div style="height: 550px">
  274. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  275. <el-form-item label="材料IFS编号/IFS Part No.">
  276. <el-input v-model="modalData.ifsPartNo" style="width: 190px"></el-input>
  277. </el-form-item>
  278. </el-form>
  279. </div>
  280. </el-tab-pane>
  281. </el-tabs>
  282. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  283. <el-button type="primary" v-if="modalData.status === '草稿'" @click="dataFormSubmit()">保存</el-button>
  284. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  285. <!-- 走OA流程按钮预留 -->
  286. <el-button type="primary" v-if="modalData.status === '审批中'" @click="agreeSubmit">同意</el-button>
  287. <el-button type="primary" v-if="modalData.status === '审批中'" @click="rejectSubmit">驳回</el-button>
  288. </el-footer>
  289. </el-dialog>
  290. <upload-file-list
  291. v-if="modalFlag"
  292. folder="rohs"
  293. title="RoHs 附件上传"
  294. :label="'序列号'"
  295. :file-list.sync="fileList"
  296. :no="modalData.referenceNo"
  297. :upload-dialog.sync="uploadDialog"
  298. path="/upload/test">
  299. </upload-file-list>
  300. <!--选择项目模态框-->
  301. <el-dialog title="选择-项目" :close-on-click-modal="false" @close="closeProjectInfoDialog"
  302. @open="searchProjectInfoList" :visible.sync="chooseProjectListFlag" width="35%">
  303. <el-form label-position="top" :model="searchProjectData" ref="closeProjectInfoForm">
  304. <el-row :gutter="10">
  305. <el-col :span="6">
  306. <el-form-item label="项目号">
  307. <el-input v-model="searchProjectData.projectId"></el-input>
  308. </el-form-item>
  309. </el-col>
  310. <el-col :span="6">
  311. <el-form-item label="项目名称">
  312. <el-input v-model="searchProjectData.projectName"></el-input>
  313. </el-form-item>
  314. </el-col>
  315. <el-col :span="6">
  316. <el-form-item label=" ">
  317. <el-button type="primary" @click="searchProjectInfoList">查询</el-button>
  318. </el-form-item>
  319. </el-col>
  320. </el-row>
  321. <el-table :height="223"
  322. :data="projectList"
  323. border
  324. @row-click="projectClickRow">
  325. <el-table-column label="项目号" prop="projectId"/>
  326. <el-table-column label="项目名称" prop="projectName"/>
  327. </el-table>
  328. </el-form>
  329. </el-dialog>
  330. <!-- 底部附件页签 -->
  331. <el-tabs v-model="activeTable" style="width: 100%; height: 100%;" type="border-card" class="customer-tab">
  332. <el-tab-pane label="基本信息" name="basicInfo">
  333. <div :style="{height: secondHeight - 25 + 'px'}" style="margin-left: 5px;margin-top: 0px; overflow-y: auto;">
  334. <el-form :inline="true" label-position="top" :model="currentRow">
  335. <el-form-item>
  336. <span slot="label">申请人/Applicant</span>
  337. <el-input :value="currentRow.applicant || ''" disabled style="width: 150px"></el-input>
  338. <el-input :value="currentRow.applicantName || ''" disabled style="width: 240px"></el-input>
  339. </el-form-item>
  340. <el-form-item label="申请日期/Application Date">
  341. <el-date-picker :value="currentRow.applicationDate" disabled type="date" value-format="yyyy-MM-dd" style="width: 190px"></el-date-picker>
  342. </el-form-item>
  343. <el-form-item label="工艺/Process">
  344. <el-input :value="currentRow.process || ''" disabled style="width: 190px"></el-input>
  345. </el-form-item>
  346. </el-form>
  347. <el-form :inline="true" label-position="top" :model="currentRow">
  348. <el-form-item label="供应商代码/Vendor Code">
  349. <el-input :value="currentRow.vendorCode || ''" disabled style="width: 150px"></el-input>
  350. </el-form-item>
  351. <el-form-item label="供应商材料编号/Vendor Material Code" style="margin-left: -10px">
  352. <el-input :value="currentRow.vendorMaterialCode || ''" disabled style="width: 240px"></el-input>
  353. </el-form-item>
  354. <el-form-item label="辅材用途/Material Use For">
  355. <el-input :value="currentRow.materialUseFor || ''" disabled style="width: 190px"></el-input>
  356. </el-form-item>
  357. </el-form>
  358. <el-form :inline="true" label-position="top" :model="currentRow">
  359. <el-form-item label="材料分类/Material Classify">
  360. <el-input :value="currentRow.materialClassify || ''" disabled style="width: 394px"></el-input>
  361. </el-form-item>
  362. <el-form-item label="其他材料分类/Other Material Classify" v-if="currentRow.materialClassify && currentRow.materialClassify.includes('Other其他')">
  363. <el-input :value="currentRow.otherMaterialClassify || ''" disabled style="width: 190px"></el-input>
  364. </el-form-item>
  365. </el-form>
  366. <el-form :inline="true" label-position="top" :model="currentRow">
  367. <el-form-item>
  368. <span slot="label">最终客户/End Customer</span>
  369. <el-input :value="currentRow.endCustomer || ''" disabled style="width: 150px"></el-input>
  370. <el-input :value="currentRow.endCustomerName || ''" disabled style="width: 240px"></el-input>
  371. </el-form-item>
  372. <el-form-item label="Macallan材料/Macallan Material">
  373. <el-input :value="displayYesNo(currentRow.isMacallanMaterial)" disabled style="width: 190px"></el-input>
  374. </el-form-item>
  375. </el-form>
  376. <el-form :inline="true" label-position="top" :model="currentRow">
  377. <el-form-item>
  378. <span slot="label">项目编码/Project ID</span>
  379. <el-input :value="currentRow.projectId || ''" disabled style="width: 150px"></el-input>
  380. <el-input :value="currentRow.projectName || ''" disabled style="width: 240px"></el-input>
  381. </el-form-item>
  382. <el-form-item label="需创建内部编号/Need Create No.">
  383. <el-input :value="displayYesNo(currentRow.needCreateNumber)" disabled style="width: 190px"></el-input>
  384. </el-form-item>
  385. </el-form>
  386. <el-form :inline="true" label-position="top" :model="currentRow">
  387. <el-form-item>
  388. <span slot="label">NPD工程师/NPD Engineer</span>
  389. <el-input :value="currentRow.npdEngineer || ''" disabled style="width: 150px"></el-input>
  390. <el-input :value="currentRow.npdEngineerName || ''" disabled style="width: 240px"></el-input>
  391. </el-form-item>
  392. <el-form-item label="是否需偏差许可/Need Deviation">
  393. <el-input :value="displayYesNo(currentRow.needDeviation)" disabled style="width: 190px"></el-input>
  394. </el-form-item>
  395. </el-form>
  396. <el-form :inline="true" label-position="top" :model="currentRow">
  397. <el-form-item label="材料有效期/Material Validity Time">
  398. <el-date-picker :value="currentRow.materialValidityTime" disabled type="date" value-format="yyyy-MM-dd" style="width: 190px"></el-date-picker>
  399. </el-form-item>
  400. <el-form-item label="有效期备注/Validity Comments">
  401. <el-input :value="currentRow.materialValidityComments || ''" disabled style="width: 190px"></el-input>
  402. </el-form-item>
  403. <el-form-item label="是否Fiber材料/Fiber Material">
  404. <el-input :value="displayYesNo(currentRow.isFiberMaterial)" disabled style="width: 190px"></el-input>
  405. </el-form-item>
  406. </el-form>
  407. <el-form :inline="true" label-position="top" :model="currentRow">
  408. <el-form-item>
  409. <span slot="label">技术计划/Technical Plan</span>
  410. <el-input :value="currentRow.technicalPlan || ''" disabled style="width: 150px"></el-input>
  411. <el-input :value="currentRow.technicalPlanName || ''" disabled style="width: 240px"></el-input>
  412. </el-form-item>
  413. <el-form-item label="WM所需求规格/WM Required Spec">
  414. <el-input :value="currentRow.wmRequiredSpec || ''" disabled style="width: 190px"></el-input>
  415. </el-form-item>
  416. <el-form-item label="材料厚度/Material Thickness">
  417. <el-input :value="currentRow.materialThickness || ''" disabled style="width: 190px"></el-input>
  418. </el-form-item>
  419. </el-form>
  420. <el-form :inline="true" label-position="top" :model="currentRow">
  421. <el-form-item>
  422. <span slot="label">采购/Buyer</span>
  423. <el-input :value="currentRow.buyer || ''" disabled style="width: 150px"></el-input>
  424. <el-input :value="currentRow.buyerName || ''" disabled style="width: 240px"></el-input>
  425. </el-form-item>
  426. <el-form-item label="报告时间(月)/Expect Report Time">
  427. <el-input :value="currentRow.expectReportTime" disabled style="width: 190px"></el-input>
  428. </el-form-item>
  429. </el-form>
  430. <el-form :inline="true" label-position="top" :model="currentRow">
  431. <el-form-item label="所需审批文件/Docs Needed">
  432. <el-input :value="currentRow.qualificationDocumentsNeeded || ''" disabled style="width: 394px"></el-input>
  433. </el-form-item>
  434. <el-form-item label="测试报告必测项/Test Items">
  435. <el-input :value="currentRow.testReportIncludingItems || ''" disabled style="width: 394px"></el-input>
  436. </el-form-item>
  437. </el-form>
  438. <el-form :inline="true" label-position="top" :model="currentRow">
  439. <el-form-item label="备注说明/Remark" style="display: block;">
  440. <el-input type="textarea" :rows="3" :value="currentRow.remark || ''" disabled resize="none" style="width: 802px;height: 30px"></el-input>
  441. </el-form-item>
  442. </el-form>
  443. </div>
  444. </el-tab-pane>
  445. <el-tab-pane label="HSF 填写信息" name="hsfInfo">
  446. <div :style="{height: secondHeight - 25 + 'px'}" style="margin-left: 5px;margin-top: 0px; overflow-y: auto;">
  447. <el-form :inline="true" label-position="top" :model="currentRow">
  448. <!-- <el-form-item label="单据状态/Doc Status"><el-input :value="currentRow.status || ''" disabled style="width: 205px"></el-input></el-form-item>-->
  449. <el-form-item label="SGS报告编号/SGS Report Number"><el-input :value="currentRow.sgsReportNumber || ''" disabled style="width: 205px"></el-input></el-form-item>
  450. <el-form-item label="报告有效期/Expired Date"><el-date-picker :value="currentRow.expiredDate" disabled type="date" value-format="yyyy-MM-dd" style="width: 205px"></el-date-picker></el-form-item>
  451. <el-form-item label="Fiber报告信息/Fiber Information"><el-input :value="currentRow.fiberInformation || ''" disabled style="width: 205px"></el-input></el-form-item>
  452. <el-form-item label="是否符合RoHS/Meet RoHS Req"><el-input :value="displayYesNo(currentRow.isMeetRohsRequirement)" disabled style="width: 205px"></el-input></el-form-item>
  453. <el-form-item label="HSF供应商等级/Supplier Class"><el-input :value="currentRow.hsfSupplierClassification || ''" disabled style="width: 205px"></el-input></el-form-item>
  454. <el-form-item label="HSF标准/HSF Standard" style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.hsfStandard || ''" disabled resize="none" style="width: 636px;height: 30px"></el-input></el-form-item>
  455. </el-form>
  456. </div>
  457. </el-tab-pane>
  458. <el-tab-pane label="NPD 信息" name="npdInfo">
  459. <div :style="{height: secondHeight - 25 + 'px'}" style="margin-left: 5px;margin-top: 0px; overflow-y: auto;">
  460. <el-form :inline="true" label-position="top" :model="currentRow">
  461. <el-form-item label="现有材料不同规格/Same Material Diff Size"><el-input :value="displayYesNo(currentRow.isSameMaterialDiffSize)" disabled style="width: 205px"></el-input></el-form-item>
  462. <el-form-item label="材料描述/Material Desc." style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.materialDesc || ''" disabled resize="none" style="width: 636px;height: 30px"></el-input></el-form-item>
  463. </el-form>
  464. </div>
  465. </el-tab-pane>
  466. <el-tab-pane label="材料信息" name="materialInfo">
  467. <div :style="{height: secondHeight - 25 + 'px'}" style="margin-left: 5px;margin-top: 0px; overflow-y: auto;">
  468. <el-form :inline="true" label-position="top" :model="currentRow">
  469. <el-form-item label="材料IFS编号/IFS Part No."><el-input :value="currentRow.ifsPartNo || ''" disabled style="width: 205px"></el-input></el-form-item>
  470. </el-form>
  471. </div>
  472. </el-tab-pane>
  473. <el-tab-pane label="附件信息" name="attachment">
  474. <oss-components
  475. :save-visible="authFileSave"
  476. :download-visible="authFileDownLoad"
  477. :remove-visible="authFileRemove"
  478. :preview-visible="authFilePreview"
  479. :disabled="currentRow.status === '已完成'"
  480. label="序列号"
  481. :height="secondHeight - 25"
  482. style="margin-top: 2px"
  483. :columns="fileColumnList"
  484. :order-ref1="currentRow.site"
  485. :order-ref2="currentRow.referenceNo">
  486. </oss-components>
  487. </el-tab-pane>
  488. </el-tabs>
  489. <ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
  490. </div>
  491. </template>
  492. <script>
  493. import * as api from '@/api/rohs/rohs'
  494. import { checkSuperAdmin } from "@/api/changeManagement/changeManagement"
  495. import { verifyData } from "@/api/chooselist/chooselist.js"
  496. import { searchProjectInfoList } from "@/api/quotation/quotationInformation.js"
  497. import { queryCustomer } from "@/api/customer/customerInformation"
  498. import { queryProjectByCustomer } from "@/api/project/project"
  499. import uploadFileList from '../common/uploadFileList'
  500. import ossComponents from '../oss/ossComponents.vue'
  501. import ChooseList from '@/views/modules/common/Chooselist'
  502. import DictDataSelect from "../sys/dict-data-select.vue"
  503. export default {
  504. components: {
  505. uploadFileList,
  506. ossComponents,
  507. ChooseList,
  508. DictDataSelect
  509. },
  510. data () {
  511. return {
  512. searchData: {
  513. site: this.$store.state.user.site,
  514. referenceNo: '',
  515. applicant: ''
  516. },
  517. dataList: [],
  518. pageIndex: 1,
  519. pageSize: 20,
  520. totalPage: 0,
  521. dataListLoading: false,
  522. activeTable: 'basicInfo',
  523. menuId: '108006', // 暂定ROHS菜单ID
  524. authSearch: false,
  525. authUpdate: false,
  526. authIssue: false,
  527. authSubmit: false,
  528. authReject: false,
  529. authFileSave: false,
  530. authFileDownLoad: false,
  531. authFileRemove: false,
  532. authFilePreview: false,
  533. authDelete: false,
  534. superAdmin: false,
  535. height: 400,
  536. secondHeight: 200,
  537. currentRow: {},
  538. currentRowNameSeq: 0,
  539. fileColumnList: [
  540. {columnLabel: '文件名称', columnProp: 'fileName', headerAlign: 'center', align: 'left', columnWidth: '100'},
  541. {columnLabel: '上传人', columnProp: 'createBy', headerAlign: 'center', align: 'left', columnWidth: '100'},
  542. {columnLabel: '上传日期', columnProp: 'createDate', headerAlign: 'center', align: 'center', columnWidth: '100'}
  543. ],
  544. modalFlag: false,
  545. uploadDialog: false,
  546. chooseProjectListFlag: false,
  547. searchProjectData: {
  548. site: '',
  549. projectId: undefined,
  550. projectName: undefined,
  551. customerId: undefined,
  552. },
  553. projectList: [],
  554. fileList: [],
  555. modalTitle: 'RoHs 新增',
  556. activeName: 'basicInfo',
  557. modalData: {
  558. site: 'DEFAULT',
  559. referenceNo: '',
  560. applicant: '',
  561. applicationDate: '',
  562. process: '',
  563. vendorCode: '',
  564. vendorMaterialCode: '',
  565. materialClassify: '',
  566. otherMaterialClassify: '',
  567. materialUseFor: '',
  568. endCustomer: '',
  569. projectId: '',
  570. isMacallanMaterial: '',
  571. needCreateNumber: '',
  572. npdEngineer: '',
  573. materialValidityTime: '',
  574. materialValidityComments: '',
  575. needDeviation: '',
  576. technicalPlan: '',
  577. wmRequiredSpec: '',
  578. isFiberMaterial: '',
  579. materialThickness: '',
  580. buyer: '',
  581. expectReportTime: 0,
  582. qualificationDocumentsNeeded: '',
  583. qualificationDocumentsNeededList: [],
  584. testReportIncludingItems: '',
  585. testReportIncludingItemsList: [],
  586. remark: '',
  587. status: '',
  588. sgsReportNumber: '',
  589. expiredDate: '',
  590. fiberInformation: '',
  591. hsfStandard: '',
  592. isMeetRohsRequirement: '',
  593. hsfSupplierClassification: '',
  594. materialDesc: '',
  595. isSameMaterialDiffSize: '',
  596. ifsPartNo: ''
  597. }
  598. }
  599. },
  600. created () {
  601. this.menuId = this.$route.meta.menuId
  602. this.getButtonAuthData()
  603. this.checkSuperAdmin()
  604. },
  605. mounted () {
  606. this.getDataList()
  607. this.$nextTick(() => {
  608. this.height = window.innerHeight / 2 - 30
  609. /*第二个表格高度的动态调整*/
  610. this.secondHeight = window.innerHeight / 2 - 186
  611. })
  612. },
  613. methods: {
  614. displayYesNo (value) {
  615. if (value === 'Y') {
  616. return '是'
  617. }
  618. if (value === 'N') {
  619. return '否'
  620. }
  621. return value || ''
  622. },
  623. // 列表行选中变色
  624. rowStyle ({row}) {
  625. if (this.currentRow && this.currentRow.referenceNo === row.referenceNo) {
  626. return { 'background-color': '#E8F7F6', cursor: 'pointer' }
  627. }
  628. },
  629. // 获取按钮的权限数据
  630. getButtonAuthData () {
  631. this.authSearch = this.isAuth(this.menuId+":search")
  632. this.authUpdate = this.isAuth(this.menuId+":update")
  633. this.authIssue = this.isAuth(this.menuId+":issue")
  634. this.authSubmit = this.isAuth(this.menuId+":submit")
  635. this.authReject = this.isAuth(this.menuId+":reject")
  636. this.authFileSave = this.isAuth(this.menuId+":fileSave")
  637. this.authFileDownLoad = this.isAuth(this.menuId+":fileDownLoad")
  638. this.authFileRemove = this.isAuth(this.menuId+":fileRemove")
  639. this.authFilePreview = this.isAuth(this.menuId+":filePreview")
  640. this.authDelete = this.isAuth(this.menuId+":delete")
  641. },
  642. // 校验是否为超级管理员
  643. checkSuperAdmin () {
  644. checkSuperAdmin().then(({data}) => {
  645. this.superAdmin = data.superAdmin
  646. })
  647. },
  648. changeClickRow (row, column, event) {
  649. // 通过接口或直接赋值,让底部的页签显示当前选中行的数据
  650. api.getRohsDetail(row.site, row.referenceNo).then(({data}) => {
  651. if (data && data.code === 0) {
  652. this.currentRow = data.data || {}
  653. } else {
  654. this.currentRow = row || {}
  655. }
  656. this.loadCurrentRowNames()
  657. }).catch(() => {
  658. this.currentRow = row || {}
  659. this.loadCurrentRowNames()
  660. })
  661. },
  662. currentChange (val) {
  663. this.currentRow = val || {}
  664. this.loadCurrentRowNames()
  665. },
  666. loadCurrentRowNames () {
  667. if (!this.currentRow) {
  668. return
  669. }
  670. const site = this.currentRow.site || this.$store.state.user.site
  671. const requestSeq = ++this.currentRowNameSeq
  672. const setName = (field, value) => {
  673. if (requestSeq !== this.currentRowNameSeq || !this.currentRow) {
  674. return
  675. }
  676. this.$set(this.currentRow, field, value || '')
  677. }
  678. const tasks = []
  679. if (this.currentRow.applicant) {
  680. tasks.push(this.queryUserDisplayName(this.currentRow.applicant, site, 103).then(name => setName('applicantName', name)))
  681. } else {
  682. setName('applicantName', '')
  683. }
  684. if (this.currentRow.npdEngineer) {
  685. tasks.push(this.queryUserDisplayName(this.currentRow.npdEngineer, site, 103).then(name => setName('npdEngineerName', name)))
  686. } else {
  687. setName('npdEngineerName', '')
  688. }
  689. if (this.currentRow.technicalPlan) {
  690. tasks.push(this.queryUserDisplayName(this.currentRow.technicalPlan, site, 103).then(name => setName('technicalPlanName', name)))
  691. } else {
  692. setName('technicalPlanName', '')
  693. }
  694. if (this.currentRow.buyer) {
  695. tasks.push(this.queryUserDisplayName(this.currentRow.buyer, site, 2000).then(name => setName('buyerName', name)))
  696. } else {
  697. setName('buyerName', '')
  698. }
  699. if (this.currentRow.endCustomer) {
  700. tasks.push(this.queryCustomerDisplayName(site, this.currentRow.endCustomer).then(name => setName('endCustomerName', name)))
  701. } else {
  702. setName('endCustomerName', '')
  703. }
  704. if (this.currentRow.projectId) {
  705. tasks.push(this.queryProjectDisplayName(site, this.currentRow.endCustomer, this.currentRow.projectId).then(name => setName('projectName', name)))
  706. } else {
  707. setName('projectName', '')
  708. }
  709. if (tasks.length > 0) {
  710. Promise.all(tasks).catch(() => {})
  711. }
  712. },
  713. queryUserDisplayName (username, site, tagno) {
  714. if (!username) {
  715. return Promise.resolve('')
  716. }
  717. let tempData = {
  718. tagno: tagno,
  719. conditionSql: " and a.username = '" + username + "'" + " and b.site = '" + site + "'"
  720. }
  721. return verifyData(tempData).then(({data}) => {
  722. if (data && data.code === 0 && data.baseListData && data.baseListData.length > 0) {
  723. return data.baseListData[0].user_display || ''
  724. }
  725. return ''
  726. }).catch(() => {
  727. return ''
  728. })
  729. },
  730. queryCustomerDisplayName (site, customerNo) {
  731. if (!customerNo) {
  732. return Promise.resolve('')
  733. }
  734. return queryCustomer({ site, customerNo }).then(({data}) => {
  735. if (data && data.code === 0 && data.rows && data.rows.length > 0) {
  736. const customer = data.rows[0]
  737. return customer.customerDesc || customer.Customer_desc || customer.customerName || ''
  738. }
  739. return ''
  740. }).catch(() => {
  741. return ''
  742. })
  743. },
  744. queryProjectDisplayName (site, customerId, projectId) {
  745. if (!projectId) {
  746. return Promise.resolve('')
  747. }
  748. let params = { site, projectId }
  749. if (customerId) {
  750. params.customerId = customerId
  751. }
  752. return queryProjectByCustomer(params).then(({data}) => {
  753. if (data && data.code === 0 && data.rows && data.rows.length > 0) {
  754. return data.rows[0].projectName || data.rows[0].Project_name || ''
  755. }
  756. return ''
  757. }).catch(() => {
  758. return ''
  759. })
  760. },
  761. // 获取列表
  762. getDataList () {
  763. this.dataListLoading = true
  764. let params = {
  765. page: this.pageIndex,
  766. limit: this.pageSize,
  767. site: this.$store.state.user.site,
  768. referenceNo: this.searchData.referenceNo,
  769. applicant: this.searchData.applicant
  770. }
  771. api.getRohsList(params).then(({data}) => {
  772. if (data && data.code === 0) {
  773. this.dataList = data.page.list
  774. this.totalPage = data.page.totalCount
  775. this.$nextTick(() => {
  776. if (this.$refs.rohsTable && this.dataList.length > 0) {
  777. this.$refs.rohsTable.setCurrentRow(this.dataList[0])
  778. } else if (this.$refs.rohsTable) {
  779. this.$refs.rohsTable.setCurrentRow()
  780. }
  781. })
  782. } else {
  783. this.dataList = []
  784. this.totalPage = 0
  785. this.currentRow = {}
  786. }
  787. this.dataListLoading = false
  788. }).catch(() => {
  789. this.currentRow = {}
  790. this.dataListLoading = false
  791. })
  792. },
  793. // 分页
  794. sizeChangeHandle (val) {
  795. this.pageSize = val
  796. this.pageIndex = 1
  797. this.getDataList()
  798. },
  799. currentChangeHandle (val) {
  800. this.pageIndex = val
  801. this.getDataList()
  802. },
  803. // 搜索条件点击
  804. searchHandle () {
  805. this.pageIndex = 1
  806. this.getDataList()
  807. },
  808. // 单选可取消
  809. radioClick (field, value) {
  810. if (this.modalData[field] === value) {
  811. this.modalData[field] = ''
  812. } else {
  813. this.modalData[field] = value
  814. }
  815. },
  816. // 导出
  817. exportHandle () {
  818. this.$message.info('导出功能开发中')
  819. },
  820. // 新增 / 修改
  821. addOrUpdateHandle (row) {
  822. this.modalFlag = true
  823. this.activeName = 'basicInfo'
  824. this.fileList = []
  825. this.uploadDialog = false
  826. if (row) {
  827. this.modalTitle = 'RoHs 编辑'
  828. api.getRohsDetail(row.site, row.referenceNo).then(({data}) => {
  829. if (data && data.code === 0) {
  830. this.modalData = data.data || {}
  831. this.$set(this.modalData, 'qualificationDocumentsNeededList', this.modalData.qualificationDocumentsNeeded ? this.modalData.qualificationDocumentsNeeded.split(';').filter(item => item) : [])
  832. this.$set(this.modalData, 'testReportIncludingItemsList', this.modalData.testReportIncludingItems ? this.modalData.testReportIncludingItems.split(';').filter(item => item) : [])
  833. this.$set(this.modalData, 'materialClassifyList', this.modalData.materialClassify ? this.modalData.materialClassify.split(';').filter(item => item) : [])
  834. // Initialize names for display if needed
  835. this.$set(this.modalData, 'applicantName', '')
  836. this.$set(this.modalData, 'buyerName', '')
  837. this.$set(this.modalData, 'npdEngineerName', '')
  838. this.$set(this.modalData, 'technicalPlanName', '')
  839. this.$set(this.modalData, 'endCustomerName', '')
  840. this.$set(this.modalData, 'projectName', '')
  841. // 编辑时允许重新选择客户和项目
  842. this.$set(this.modalData, 'endCustomerFlag', false)
  843. this.$set(this.modalData, 'projectIdFlag', !this.modalData.endCustomer)
  844. // Try to trigger verify data on open to fetch names
  845. this.applicantBlur(103)
  846. this.buyerBlur(2000)
  847. this.npdEngineerBlur(103)
  848. this.technicalPlanBlur(103)
  849. this.handleQueryCustomer()
  850. this.handleQueryProjectByCustomer()
  851. }
  852. })
  853. } else {
  854. this.modalTitle = 'RoHs 新增'
  855. // 生成一个临时ID用于附件上传绑定
  856. const tempReferenceNo = 'TEMP-' + new Date().getTime() + '-' + Math.floor(Math.random() * 1000)
  857. this.modalData = {
  858. site: this.$store.state.user.site,
  859. referenceNo: tempReferenceNo,
  860. applicant: '',
  861. applicantName: '',
  862. applicationDate: '',
  863. process: '',
  864. vendorCode: '',
  865. vendorMaterialCode: '',
  866. materialClassify: '',
  867. materialClassifyList: [],
  868. otherMaterialClassify: '',
  869. materialUseFor: '',
  870. endCustomer: '',
  871. endCustomerName: '',
  872. endCustomerFlag: false,
  873. projectId: '',
  874. projectName: '',
  875. projectIdFlag: true,
  876. isMacallanMaterial: '',
  877. needCreateNumber: '',
  878. npdEngineer: '',
  879. npdEngineerName: '',
  880. materialValidityTime: '',
  881. materialValidityComments: '',
  882. needDeviation: '',
  883. technicalPlan: '',
  884. wmRequiredSpec: '',
  885. isFiberMaterial: '',
  886. materialThickness: '',
  887. buyer: '',
  888. buyerName: '',
  889. expectReportTime: 0,
  890. qualificationDocumentsNeeded: '',
  891. qualificationDocumentsNeededList: [],
  892. testReportIncludingItems: '',
  893. testReportIncludingItemsList: [],
  894. remark: '',
  895. status: '草稿',
  896. sgsReportNumber: '',
  897. expiredDate: '',
  898. fiberInformation: '',
  899. hsfStandard: '',
  900. isMeetRohsRequirement: '',
  901. hsfSupplierClassification: '',
  902. materialDesc: '',
  903. isSameMaterialDiffSize: '',
  904. ifsPartNo: ''
  905. }
  906. }
  907. },
  908. // 表单提交
  909. dataFormSubmit () {
  910. this.modalData.qualificationDocumentsNeeded = this.modalData.qualificationDocumentsNeededList.join(';')
  911. this.modalData.testReportIncludingItems = this.modalData.testReportIncludingItemsList.join(';')
  912. this.modalData.materialClassify = this.modalData.materialClassifyList.join(';')
  913. const submitMethod = this.modalTitle === 'RoHs 新增' ? api.saveRohs : api.updateRohs
  914. submitMethod(this.modalData).then(({data}) => {
  915. if (data && data.code === 0) {
  916. this.$message.success('操作成功')
  917. this.modalFlag = false
  918. this.getDataList()
  919. } else {
  920. this.$message.error(data.msg || '操作失败')
  921. }
  922. })
  923. },
  924. // 同意
  925. agreeSubmit () {
  926. this.$message.info('同意(OA流程)待开发')
  927. },
  928. // 驳回
  929. rejectSubmit () {
  930. this.$message.info('驳回(OA流程)待开发')
  931. },
  932. // 下达
  933. issueModal (row) {
  934. this.$confirm('确认下达该申请单?', '提示', {
  935. confirmButtonText: '确定',
  936. cancelButtonText: '取消',
  937. type: 'warning'
  938. }).then(() => {
  939. const data = Object.assign({}, row, { status: '审批中' })
  940. api.updateRohs(data).then(({data}) => {
  941. if (data && data.code === 0) {
  942. this.$message.success('下达成功')
  943. this.getDataList()
  944. } else {
  945. this.$message.error(data.msg || '下达失败')
  946. }
  947. })
  948. })
  949. },
  950. // ======== chooseList相关方法 ========
  951. // 获取基础数据列表
  952. getBaseList (val, type) {
  953. this.tagNo = val
  954. this.tagNo1 = type
  955. this.$nextTick(() => {
  956. let strVal = ''
  957. let conSql = ''
  958. if (val === 102) {
  959. if (type === 1) {
  960. strVal = this.modalData.endCustomer
  961. }
  962. }
  963. if (val === 103) {
  964. if (type === 1) {
  965. strVal = this.modalData.applicant
  966. } else if (type === 3) {
  967. strVal = this.modalData.npdEngineer
  968. } else if (type === 4) {
  969. strVal = this.modalData.technicalPlan
  970. }
  971. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  972. }
  973. if (val === 2000) {
  974. strVal = this.modalData.buyer
  975. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  976. }
  977. this.$refs.baseList.init(val, strVal, conSql)
  978. })
  979. },
  980. // 列表方法的回调
  981. getBaseData (val) {
  982. if (this.tagNo === 102) {
  983. if (this.tagNo1 === 1) {
  984. if (val.Customer_no === this.modalData.endCustomer) {
  985. return
  986. }
  987. if (this.modalData.projectIdFlag) {
  988. this.modalData.projectIdFlag = false
  989. }
  990. this.modalData.endCustomer = val.Customer_no
  991. this.modalData.endCustomerName = val.Customer_desc
  992. this.modalData.projectId = ''
  993. this.modalData.projectName = ''
  994. }
  995. }
  996. if (this.tagNo === 103) {
  997. if (this.tagNo1 === 1) {
  998. this.modalData.applicant = val.username
  999. this.modalData.applicantName = val.user_display
  1000. } else if (this.tagNo1 === 3) {
  1001. this.modalData.npdEngineer = val.username
  1002. this.modalData.npdEngineerName = val.user_display
  1003. } else if (this.tagNo1 === 4) {
  1004. this.modalData.technicalPlan = val.username
  1005. this.modalData.technicalPlanName = val.user_display
  1006. }
  1007. }
  1008. if (this.tagNo === 2000) {
  1009. this.modalData.buyer = val.username
  1010. this.modalData.buyerName = val.user_display
  1011. }
  1012. },
  1013. handleQueryCustomer() {
  1014. if (!this.modalData.endCustomer) {
  1015. this.modalData.endCustomerName = ''
  1016. this.modalData.projectId = ''
  1017. this.modalData.projectName = ''
  1018. this.modalData.projectIdFlag = true
  1019. return
  1020. }
  1021. let params = {
  1022. site: this.$store.state.user.site,
  1023. customerNo: this.modalData.endCustomer
  1024. }
  1025. queryCustomer(params).then(({data}) => {
  1026. if (data && data.code === 0) {
  1027. if (data.rows && data.rows.length === 1) {
  1028. const customer = data.rows[0]
  1029. this.modalData.endCustomerName = customer.customerDesc || customer.Customer_desc || customer.customerName || ''
  1030. this.modalData.projectIdFlag = false
  1031. } else {
  1032. this.modalData.endCustomerName = ''
  1033. this.modalData.projectId = ''
  1034. this.modalData.projectName = ''
  1035. this.modalData.projectIdFlag = true
  1036. }
  1037. } else {
  1038. this.modalData.endCustomerName = ''
  1039. this.modalData.projectId = ''
  1040. this.modalData.projectName = ''
  1041. this.modalData.projectIdFlag = true
  1042. }
  1043. }).catch((error) => {
  1044. this.modalData.endCustomerName = ''
  1045. this.modalData.projectId = ''
  1046. this.modalData.projectName = ''
  1047. this.modalData.projectIdFlag = true
  1048. })
  1049. },
  1050. handleQueryProjectByCustomer() {
  1051. if (!this.modalData.projectId) {
  1052. this.modalData.projectName = ''
  1053. return
  1054. }
  1055. let params = {
  1056. site: this.$store.state.user.site,
  1057. projectId: this.modalData.projectId
  1058. }
  1059. if (this.modalData.endCustomer) {
  1060. params.customerId = this.modalData.endCustomer
  1061. }
  1062. queryProjectByCustomer(params).then(({data}) => {
  1063. if (data && data.code === 0) {
  1064. if (data.rows && data.rows.length === 1) {
  1065. const project = data.rows[0]
  1066. this.modalData.projectName = project.projectName || project.Project_name || ''
  1067. } else {
  1068. this.modalData.projectName = ''
  1069. }
  1070. } else {
  1071. this.modalData.projectName = ''
  1072. }
  1073. }).catch((error) => {
  1074. this.modalData.projectName = ''
  1075. })
  1076. },
  1077. projectClickRow(row) {
  1078. this.modalData.projectId = row.projectId
  1079. this.modalData.projectName = row.projectName
  1080. if (this.modalData.endCustomer && this.modalData.endCustomer !== '') {
  1081. // do nothing
  1082. } else {
  1083. this.modalData.endCustomer = row.customerId
  1084. this.modalData.endCustomerName = row.customerName
  1085. }
  1086. this.chooseProjectListFlag = false
  1087. },
  1088. searchProjectInfoList() {
  1089. this.projectList = [];
  1090. if (this.modalData.endCustomer && this.modalData.endCustomer !== '') {
  1091. this.searchProjectData.customerId = this.modalData.endCustomer
  1092. } else {
  1093. this.searchProjectData.customerId = undefined
  1094. }
  1095. this.searchProjectData.site = this.$store.state.user.site
  1096. searchProjectInfoList(this.searchProjectData).then(({data}) => {
  1097. if (data && data.code === 0) {
  1098. const rows = data.rows || []
  1099. this.projectList = rows
  1100. if ((!this.modalData.endCustomer || this.modalData.endCustomer === '') && rows.length > 0) {
  1101. this.modalData.projectId = rows[0].projectId
  1102. this.modalData.projectName = rows[0].projectName
  1103. this.modalData.endCustomer = rows[0].customerId
  1104. this.modalData.endCustomerName = rows[0].customerName
  1105. }
  1106. } else {
  1107. this.projectList = []
  1108. }
  1109. }).catch((error) => {
  1110. this.$message.error('查询项目信息失败')
  1111. })
  1112. },
  1113. closeProjectInfoDialog() {
  1114. if(this.$refs.closeProjectInfoForm) {
  1115. this.$refs.closeProjectInfoForm.resetFields();
  1116. }
  1117. this.searchProjectData = {
  1118. site: this.$store.state.user.site,
  1119. projectId: undefined,
  1120. projectName: undefined,
  1121. customerId: undefined,
  1122. }
  1123. },
  1124. // 申请人输入校验
  1125. applicantBlur (tagNo) {
  1126. if (this.modalData.applicant != null && this.modalData.applicant !== '') {
  1127. let tempData = {
  1128. tagno: tagNo,
  1129. conditionSql: " and a.username = '" + this.modalData.applicant + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  1130. }
  1131. verifyData(tempData).then(({data}) => {
  1132. if (data && data.code === 0) {
  1133. if (data.baseListData.length > 0) {
  1134. this.modalData.applicant = data.baseListData[0].username
  1135. this.modalData.applicantName = data.baseListData[0].user_display
  1136. return
  1137. }
  1138. }
  1139. this.modalData.applicantName = ''
  1140. })
  1141. } else {
  1142. this.modalData.applicantName = ''
  1143. }
  1144. },
  1145. // NPD工程师输入校验
  1146. npdEngineerBlur (tagNo) {
  1147. if (this.modalData.npdEngineer != null && this.modalData.npdEngineer !== '') {
  1148. let tempData = {
  1149. tagno: tagNo,
  1150. conditionSql: " and a.username = '" + this.modalData.npdEngineer + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  1151. }
  1152. verifyData(tempData).then(({data}) => {
  1153. if (data && data.code === 0) {
  1154. if (data.baseListData.length > 0) {
  1155. this.modalData.npdEngineer = data.baseListData[0].username
  1156. this.modalData.npdEngineerName = data.baseListData[0].user_display
  1157. return
  1158. }
  1159. }
  1160. this.modalData.npdEngineerName = ''
  1161. })
  1162. } else {
  1163. this.modalData.npdEngineerName = ''
  1164. }
  1165. },
  1166. // 技术计划输入校验
  1167. technicalPlanBlur (tagNo) {
  1168. if (this.modalData.technicalPlan != null && this.modalData.technicalPlan !== '') {
  1169. let tempData = {
  1170. tagno: tagNo,
  1171. conditionSql: " and a.username = '" + this.modalData.technicalPlan + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  1172. }
  1173. verifyData(tempData).then(({data}) => {
  1174. if (data && data.code === 0) {
  1175. if (data.baseListData.length > 0) {
  1176. this.modalData.technicalPlan = data.baseListData[0].username
  1177. this.modalData.technicalPlanName = data.baseListData[0].user_display
  1178. return
  1179. }
  1180. }
  1181. this.modalData.technicalPlanName = ''
  1182. })
  1183. } else {
  1184. this.modalData.technicalPlanName = ''
  1185. }
  1186. },
  1187. // 采购输入校验
  1188. buyerBlur (tagNo) {
  1189. if (this.modalData.buyer != null && this.modalData.buyer !== '') {
  1190. let tempData = {
  1191. tagno: tagNo,
  1192. conditionSql: " and a.username = '" + this.modalData.buyer + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  1193. }
  1194. verifyData(tempData).then(({data}) => {
  1195. if (data && data.code === 0) {
  1196. if (data.baseListData.length > 0) {
  1197. this.modalData.buyer = data.baseListData[0].username
  1198. this.modalData.buyerName = data.baseListData[0].user_display
  1199. return
  1200. }
  1201. }
  1202. this.modalData.buyerName = ''
  1203. })
  1204. } else {
  1205. this.modalData.buyerName = ''
  1206. }
  1207. }
  1208. }
  1209. }
  1210. </script>
  1211. <style scoped>
  1212. </style>