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.

2014 lines
67 KiB

​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <template>
  2. <div class="customer-css">
  3. <!-- 查询条件 -->
  4. <el-form :inline="true" label-position="top" class="search-form-inline">
  5. <div class="search-row">
  6. <el-form-item class="search-item">
  7. <span slot="label" class="choose-label" @click="getBaseList(520)">供应商编码</span>
  8. <el-input v-model="searchData.supplierNo" style="width: 120px" @keyup.enter.native="getMainData"/>
  9. </el-form-item>
  10. <el-form-item label="供应商名称" class="search-item">
  11. <el-input v-model="searchData.supplierName" style="width: 180px" @keyup.enter.native="getMainData"/>
  12. </el-form-item>
  13. <el-form-item label="反馈单号" class="search-item">
  14. <el-input v-model="searchData.issueNo" style="width: 120px" @keyup.enter.native="getMainData"/>
  15. </el-form-item>
  16. <el-form-item label="问题日期" class="search-item">
  17. <el-date-picker
  18. v-model="searchData.issueDate"
  19. type="date"
  20. value-format="yyyy-MM-dd"
  21. placeholder="选择日期"
  22. style="width: 150px"
  23. clearable>
  24. </el-date-picker>
  25. </el-form-item>
  26. <el-form-item label="状态" class="search-item">
  27. <el-select v-model="searchData.status" clearable placeholder="全部" style="width: 70%">
  28. <el-option label="全部" value="" />
  29. <el-option label="已确认" value="已确认" />
  30. <el-option label="已分析" value="已分析" />
  31. <el-option label="已关闭" value="已关闭" />
  32. <el-option label="已取消" value="已取消" />
  33. </el-select>
  34. </el-form-item>
  35. </div>
  36. <div class="search-row">
  37. <el-form-item label="Claim No" class="search-item">
  38. <el-input v-model="searchData.claimNo" style="width: 120px" @keyup.enter.native="getMainData"/>
  39. </el-form-item>
  40. <el-form-item label="Plant" class="search-item">
  41. <el-select v-model="searchData.plant" clearable placeholder="全部" style="width: 180px">
  42. <el-option label="Mx : Mexico" value="Mx"></el-option>
  43. <el-option label="IR : Ireland" value="IR"></el-option>
  44. <el-option label="TN : Tennessee" value="TN"></el-option>
  45. </el-select>
  46. </el-form-item>
  47. <el-form-item label="Product Category" class="search-item">
  48. <el-select v-model="searchData.productCategory" clearable placeholder="全部" style="width: 120px">
  49. <el-option label="Metal Pen" value="Metal Pen"></el-option>
  50. <el-option label="CUP" value="CUP"></el-option>
  51. </el-select>
  52. </el-form-item>
  53. <el-form-item label="PO No" class="search-item">
  54. <el-input v-model="searchData.poNo" style="width: 150px" @keyup.enter.native="getMainData"/>
  55. </el-form-item>
  56. <el-form-item class="search-item">
  57. <span slot="label" class="choose-label" @click="getBaseList(2017)">Part No</span>
  58. <el-input v-model="searchData.partNo" style="width: 120px" @keyup.enter.native="getMainData"/>
  59. </el-form-item>
  60. </div>
  61. <div class="search-row">
  62. <el-form-item label=" " class="search-item search-btn-item">
  63. <el-button type="primary" @click="getMainData" class="customer-bun-min">查询</el-button>
  64. <el-button type="primary" @click="addQualityIssue" class="customer-bun-min">新增</el-button>
  65. <el-button type="primary" @click="exportExcel" class="customer-bun-min">导出</el-button>
  66. </el-form-item>
  67. </div>
  68. </el-form>
  69. <el-table
  70. :height="height"
  71. :data="mainDataList"
  72. border
  73. ref="mainTable"
  74. highlight-current-row
  75. @row-click="changeData"
  76. v-loading="dataListLoading"
  77. style="margin-top: 0px; width: 100%;">
  78. <el-table-column
  79. v-for="(item,index) in columnArray1" :key="index"
  80. :sortable="item.columnSortable"
  81. :prop="item.columnProp"
  82. :header-align="item.headerAlign"
  83. :show-overflow-tooltip="item.showOverflowTooltip"
  84. :align="item.align"
  85. :fixed="item.fixed==''?false:item.fixed"
  86. :min-width="item.columnWidth"
  87. :label="item.columnLabel">
  88. <template slot-scope="scope">
  89. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  90. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  91. style="width: 100px; height: 100px"/></span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column fixed="right" header-align="center" align="center" width="240" label="操作">
  95. <template slot-scope="scope">
  96. <!-- 编辑:已确认 或 已赔偿 -->
  97. <a v-if="scope.row.status === '已确认' || scope.row.status === '已赔偿'"
  98. class="customer-a"
  99. @click="editQualityIssue(scope.row)">编辑 </a>
  100. <!-- 删除:已确认 或 已赔偿 -->
  101. <a v-if="scope.row.status === '已确认' || scope.row.status === '已赔偿'"
  102. class="customer-a"
  103. @click="deleteQualityIssue(scope.row)">删除 </a>
  104. <!-- 回复:已确认 或 已赔偿 -->
  105. <a v-if="scope.row.status === '已确认' || scope.row.status === '已赔偿'"
  106. class="customer-a"
  107. @click="replyQualityIssue(scope.row)">回复 </a>
  108. <!-- 赔偿:已确认 或 已分析,但不能是已赔偿(已赔偿状态不显示赔偿按钮)-->
  109. <a v-if="(scope.row.status === '已确认' || scope.row.status === '已分析') && scope.row.status !== '已赔偿'"
  110. class="customer-a"
  111. @click="compensationQualityIssue(scope.row)">赔偿 </a>
  112. <!-- 关闭:仅已分析 -->
  113. <a v-if="scope.row.status === '已分析'"
  114. class="customer-a"
  115. @click="closeQualityIssueAction(scope.row)">关闭</a>
  116. </template>
  117. </el-table-column>
  118. </el-table>
  119. <!-- 分页插件 -->
  120. <el-pagination style="margin-top: 0px"
  121. @size-change="sizeChangeHandle"
  122. @current-change="currentChangeHandle"
  123. :current-page="pageIndex"
  124. :page-sizes="[20, 50, 100, 200, 500]"
  125. :page-size="pageSize"
  126. :total="totalPage"
  127. layout="total, sizes, prev, pager, next, jumper">
  128. </el-pagination>
  129. <!-- 详情页签 -->
  130. <el-tabs v-model="activeTab" :style="{marginTop: '10px', width: '100%'}" @tab-click="handleTabClick" class="customer-tab" type="border-card">
  131. <!-- 详情 -->
  132. <el-tab-pane label="详情" name="detail">
  133. <quality-issue-detail :detail-data="currentRow" />
  134. </el-tab-pane>
  135. <!--PO列表-->
  136. <el-tab-pane label="PO列表" name="po">
  137. <quality-issue-po-list
  138. ref="qualityIssuePo"
  139. :issue-no="currentRow.issueNo"
  140. :site="currentRow.site"
  141. :supplier-no="currentRow.supplierNo" />
  142. </el-tab-pane>
  143. <!-- 附件 -->
  144. <el-tab-pane label="附件" name="attachment">
  145. <quality-issue-attachment :detail-data="currentRow" :table-height="detailHeight" />
  146. </el-tab-pane>
  147. </el-tabs>
  148. <!-- 新增弹窗 -->
  149. <el-dialog
  150. title="质量问题 - 新增"
  151. :visible.sync="addDialogVisible"
  152. width="70%"
  153. top="5vh"
  154. :close-on-click-modal="false"
  155. @close="handleCloseAddDialog">
  156. <el-form :model="addFormData" :rules="addRules" ref="addFormData" label-width="110px" size="mini" class="add-dialog-form">
  157. <!-- 第一行 -->
  158. <el-row :gutter="10">
  159. <el-col :span="6">
  160. <el-form-item label="反馈单号">
  161. <el-input v-model="addFormData.issueNo" placeholder="自动生成" disabled size="mini"></el-input>
  162. </el-form-item>
  163. </el-col>
  164. <el-col :span="6">
  165. <el-form-item label="问题日期" prop="issueDate">
  166. <el-date-picker
  167. v-model="addFormData.issueDate"
  168. type="date"
  169. value-format="yyyy-MM-dd"
  170. placeholder="选择日期"
  171. size="mini"
  172. style="width: 100%">
  173. </el-date-picker>
  174. </el-form-item>
  175. </el-col>
  176. <el-col :span="6">
  177. <el-form-item label="要求回复日期" prop="requireReplyDate">
  178. <el-date-picker
  179. v-model="addFormData.requireReplyDate"
  180. type="date"
  181. value-format="yyyy-MM-dd"
  182. placeholder="选择日期"
  183. size="mini"
  184. style="width: 100%">
  185. </el-date-picker>
  186. </el-form-item>
  187. </el-col>
  188. <el-col :span="6">
  189. <el-form-item label="状态">
  190. <el-input v-model="addFormData.status" value="已确认" disabled size="mini"></el-input>
  191. </el-form-item>
  192. </el-col>
  193. </el-row>
  194. <!-- 新增行:PO No、批次数量、拒收批次数量、投诉接收日期、样品接收日期 -->
  195. <el-row :gutter="10">
  196. <el-col :span="6">
  197. <el-form-item label="批次数量">
  198. <el-input v-model="addFormData.batchQty" placeholder="请输入" size="mini" type="number"></el-input>
  199. </el-form-item>
  200. </el-col>
  201. <el-col :span="6">
  202. <el-form-item label="拒收批次数量">
  203. <el-input v-model="addFormData.rejectBatchQty" placeholder="请输入" size="mini" type="number"></el-input>
  204. </el-form-item>
  205. </el-col>
  206. <el-col :span="6">
  207. <el-form-item label="投诉接收日期">
  208. <el-date-picker
  209. v-model="addFormData.receiveComplaintDate"
  210. type="date"
  211. value-format="yyyy-MM-dd"
  212. placeholder="选择日期"
  213. size="mini"
  214. style="width: 100%">
  215. </el-date-picker>
  216. </el-form-item>
  217. </el-col>
  218. <el-col :span="6">
  219. <el-form-item label="样品接收日期">
  220. <el-date-picker
  221. v-model="addFormData.receiveSampleDate"
  222. type="date"
  223. value-format="yyyy-MM-dd"
  224. placeholder="选择日期"
  225. size="mini"
  226. style="width: 100%">
  227. </el-date-picker>
  228. </el-form-item>
  229. </el-col>
  230. </el-row>
  231. <!-- 第二行 -->
  232. <el-row :gutter="10">
  233. <el-col :span="6">
  234. <el-form-item prop="supplierNo"><span slot="label" class="choose-label" @click="getBaseList(520)">供应商编码</span>
  235. <el-input
  236. v-model="addFormData.supplierNo"
  237. readonly
  238. size="mini">
  239. </el-input>
  240. </el-form-item>
  241. </el-col>
  242. <el-col :span="12">
  243. <el-form-item label="供应商名称">
  244. <el-input v-model="addFormData.supplierName" disabled size="mini"></el-input>
  245. </el-form-item>
  246. </el-col>
  247. <el-col :span="6">
  248. <el-form-item><span slot="label" class="choose-label" @click="getBaseList(2016)">供应商负责人</span>
  249. <el-input
  250. v-model="addFormData.supplierResponsible"
  251. readonly
  252. size="mini">
  253. </el-input>
  254. </el-form-item>
  255. </el-col>
  256. </el-row>
  257. <!-- 第三行 -->
  258. <el-row :gutter="10">
  259. <el-col :span="6">
  260. <el-form-item label="Plant">
  261. <el-select v-model="addFormData.plant" placeholder="请选择" size="mini" style="width: 100%">
  262. <el-option label="Mx : Mexico" value="Mx"></el-option>
  263. <el-option label="IR : Ireland" value="IR"></el-option>
  264. <el-option label="TN : Tennessee" value="TN"></el-option>
  265. </el-select>
  266. </el-form-item>
  267. </el-col>
  268. <el-col :span="6">
  269. <el-form-item label="Claim No">
  270. <el-input v-model="addFormData.claimNo" placeholder="请输入" size="mini"></el-input>
  271. </el-form-item>
  272. </el-col>
  273. <el-col :span="6">
  274. <el-form-item label="Product Category">
  275. <el-select v-model="addFormData.productCategory" placeholder="请选择" size="mini" style="width: 100%">
  276. <el-option label="Metal Pen" value="Metal Pen"></el-option>
  277. <el-option label="CUP" value="CUP"></el-option>
  278. </el-select>
  279. </el-form-item>
  280. </el-col>
  281. <el-col :span="6">
  282. <el-form-item><span slot="label" class="choose-label" @click="getBaseList(2017)">Part No</span>
  283. <el-input
  284. v-model="addFormData.partNo"
  285. readonly
  286. size="mini">
  287. </el-input>
  288. </el-form-item>
  289. </el-col>
  290. </el-row>
  291. <!-- 第四行 -->
  292. <el-row :gutter="10">
  293. <el-col :span="18">
  294. <el-form-item label="问题简述" prop="issueSummary">
  295. <el-input v-model="addFormData.issueSummary" placeholder="请输入问题简述" size="mini"></el-input>
  296. </el-form-item>
  297. </el-col>
  298. <el-col :span="6">
  299. <el-form-item label="Inspector">
  300. <el-input v-model="addFormData.inspector" placeholder="请输入" size="mini"></el-input>
  301. </el-form-item>
  302. </el-col>
  303. </el-row>
  304. <!-- 第五行 -->
  305. <el-row :gutter="10">
  306. <el-col :span="18">
  307. <el-form-item label="问题详细描述">
  308. <el-input
  309. v-model="addFormData.issueDescription"
  310. type="textarea"
  311. :rows="4"
  312. placeholder="请输入问题详细描述"
  313. size="mini">
  314. </el-input>
  315. </el-form-item>
  316. </el-col>
  317. </el-row>
  318. <!-- 第六行 -->
  319. <el-row :gutter="10">
  320. <el-col :span="6">
  321. <el-form-item label="Level">
  322. <el-input v-model="addFormData.levelNo" placeholder="请输入" size="mini"></el-input>
  323. </el-form-item>
  324. </el-col>
  325. <el-col :span="6">
  326. <el-form-item label="Mode 1">
  327. <el-select v-model="addFormData.mode1" placeholder="请选择" size="mini" style="width: 100%">
  328. <el-option label="Appearance" value="Appearance"></el-option>
  329. <el-option label="Function" value="Function"></el-option>
  330. </el-select>
  331. </el-form-item>
  332. </el-col>
  333. <el-col :span="6">
  334. <el-form-item label="Mode 2">
  335. <el-select v-model="addFormData.mode2" placeholder="请选择" size="mini" style="width: 100%">
  336. <el-option label="Loose part" value="Loose part"></el-option>
  337. <el-option label="Others" value="Others"></el-option>
  338. <el-option label="Contamination" value="Contamination"></el-option>
  339. </el-select>
  340. </el-form-item>
  341. </el-col>
  342. <el-col :span="6">
  343. <el-form-item label="Mode 3">
  344. <el-select v-model="addFormData.mode3" placeholder="请选择" size="mini" style="width: 100%">
  345. <el-option label="Part Missing" value="Part Missing"></el-option>
  346. <el-option label="Glue" value="Glue"></el-option>
  347. </el-select>
  348. </el-form-item>
  349. </el-col>
  350. </el-row>
  351. </el-form>
  352. <div slot="footer" class="dialog-footer">
  353. <el-button type="primary" @click="handleSaveAdd" class="customer-bun-min">保存</el-button>
  354. <el-button @click="handleCloseAddDialog" class="customer-bun-min">关闭</el-button>
  355. </div>
  356. </el-dialog>
  357. <!-- 编辑弹窗 -->
  358. <el-dialog
  359. title="质量问题 - 编辑"
  360. :visible.sync="editDialogVisible"
  361. width="70%"
  362. top="5vh"
  363. :close-on-click-modal="false"
  364. @close="handleCloseEditDialog">
  365. <el-form :model="editFormData" :rules="editRules" ref="editFormData" label-width="110px" size="mini" class="add-dialog-form">
  366. <!-- 第一行 -->
  367. <el-row :gutter="10">
  368. <el-col :span="6">
  369. <el-form-item label="反馈单号">
  370. <el-input v-model="editFormData.issueNo" placeholder="自动生成" disabled size="mini"></el-input>
  371. </el-form-item>
  372. </el-col>
  373. <el-col :span="6">
  374. <el-form-item label="问题日期" prop="issueDate">
  375. <el-date-picker
  376. v-model="editFormData.issueDate"
  377. type="date"
  378. value-format="yyyy-MM-dd"
  379. placeholder="选择日期"
  380. size="mini"
  381. style="width: 100%">
  382. </el-date-picker>
  383. </el-form-item>
  384. </el-col>
  385. <el-col :span="6">
  386. <el-form-item label="要求回复日期" prop="requireReplyDate">
  387. <el-date-picker
  388. v-model="editFormData.requireReplyDate"
  389. type="date"
  390. value-format="yyyy-MM-dd"
  391. placeholder="选择日期"
  392. size="mini"
  393. style="width: 100%">
  394. </el-date-picker>
  395. </el-form-item>
  396. </el-col>
  397. <el-col :span="6">
  398. <el-form-item label="状态">
  399. <el-input v-model="editFormData.status" disabled size="mini"></el-input>
  400. </el-form-item>
  401. </el-col>
  402. </el-row>
  403. <!-- 批次数量、拒收批次数量、投诉接收日期、样品接收日期 -->
  404. <el-row :gutter="10">
  405. <el-col :span="6">
  406. <el-form-item label="批次数量">
  407. <el-input v-model="editFormData.batchQty" placeholder="请输入" size="mini" type="number"></el-input>
  408. </el-form-item>
  409. </el-col>
  410. <el-col :span="6">
  411. <el-form-item label="拒收批次数量">
  412. <el-input v-model="editFormData.rejectBatchQty" placeholder="请输入" size="mini" type="number"></el-input>
  413. </el-form-item>
  414. </el-col>
  415. <el-col :span="6">
  416. <el-form-item label="投诉接收日期">
  417. <el-date-picker
  418. v-model="editFormData.receiveComplaintDate"
  419. type="date"
  420. value-format="yyyy-MM-dd"
  421. placeholder="选择日期"
  422. size="mini"
  423. style="width: 100%">
  424. </el-date-picker>
  425. </el-form-item>
  426. </el-col>
  427. <el-col :span="6">
  428. <el-form-item label="样品接收日期">
  429. <el-date-picker
  430. v-model="editFormData.receiveSampleDate"
  431. type="date"
  432. value-format="yyyy-MM-dd"
  433. placeholder="选择日期"
  434. size="mini"
  435. style="width: 100%">
  436. </el-date-picker>
  437. </el-form-item>
  438. </el-col>
  439. </el-row>
  440. <!-- 第二行:供应商编码、供应商名称、供应商负责人 -->
  441. <el-row :gutter="10">
  442. <el-col :span="6">
  443. <el-form-item prop="supplierNo">
  444. <span slot="label" class="choose-label" @click="getBaseList(520)">供应商编码</span>
  445. <el-input v-model="editFormData.supplierNo" readonly size="mini"></el-input>
  446. </el-form-item>
  447. </el-col>
  448. <el-col :span="12">
  449. <el-form-item label="供应商名称">
  450. <el-input v-model="editFormData.supplierName" disabled size="mini"></el-input>
  451. </el-form-item>
  452. </el-col>
  453. <el-col :span="6">
  454. <el-form-item>
  455. <span slot="label" class="choose-label" @click="getBaseList(2016)">供应商负责人</span>
  456. <el-input v-model="editFormData.supplierResponsible" readonly size="mini"></el-input>
  457. </el-form-item>
  458. </el-col>
  459. </el-row>
  460. <!-- 第三行:Plant、Claim No、Product Category、Part No -->
  461. <el-row :gutter="10">
  462. <el-col :span="6">
  463. <el-form-item label="Plant">
  464. <el-select v-model="editFormData.plant" placeholder="请选择" size="mini" style="width: 100%">
  465. <el-option label="Mx : Mexico" value="Mx"></el-option>
  466. <el-option label="IR : Ireland" value="IR"></el-option>
  467. <el-option label="TN : Tennessee" value="TN"></el-option>
  468. </el-select>
  469. </el-form-item>
  470. </el-col>
  471. <el-col :span="6">
  472. <el-form-item label="Claim No">
  473. <el-input v-model="editFormData.claimNo" placeholder="请输入" size="mini"></el-input>
  474. </el-form-item>
  475. </el-col>
  476. <el-col :span="6">
  477. <el-form-item label="Product Category">
  478. <el-select v-model="editFormData.productCategory" placeholder="请选择" size="mini" style="width: 100%">
  479. <el-option label="Metal Pen" value="Metal Pen"></el-option>
  480. <el-option label="CUP" value="CUP"></el-option>
  481. </el-select>
  482. </el-form-item>
  483. </el-col>
  484. <el-col :span="6">
  485. <el-form-item>
  486. <span slot="label" class="choose-label" @click="getBaseList(2017)">Part No</span>
  487. <el-input v-model="editFormData.partNo" readonly size="mini"></el-input>
  488. </el-form-item>
  489. </el-col>
  490. </el-row>
  491. <!-- 第四行:问题简述、Inspector -->
  492. <el-row :gutter="10">
  493. <el-col :span="18">
  494. <el-form-item label="问题简述" prop="issueSummary">
  495. <el-input v-model="editFormData.issueSummary" placeholder="请输入问题简述" size="mini"></el-input>
  496. </el-form-item>
  497. </el-col>
  498. <el-col :span="6">
  499. <el-form-item label="Inspector">
  500. <el-input v-model="editFormData.inspector" placeholder="请输入" size="mini"></el-input>
  501. </el-form-item>
  502. </el-col>
  503. </el-row>
  504. <!-- 第五行:问题详细描述 -->
  505. <el-row :gutter="10">
  506. <el-col :span="18">
  507. <el-form-item label="问题详细描述">
  508. <el-input
  509. v-model="editFormData.issueDescription"
  510. type="textarea"
  511. :rows="4"
  512. placeholder="请输入问题详细描述"
  513. size="mini">
  514. </el-input>
  515. </el-form-item>
  516. </el-col>
  517. </el-row>
  518. <!-- 第六行:Level、Mode1-3 -->
  519. <el-row :gutter="10">
  520. <el-col :span="6">
  521. <el-form-item label="Level">
  522. <el-input v-model="editFormData.levelNo" placeholder="请输入" size="mini"></el-input>
  523. </el-form-item>
  524. </el-col>
  525. <el-col :span="6">
  526. <el-form-item label="Mode 1">
  527. <el-select v-model="editFormData.mode1" placeholder="请选择" size="mini" style="width: 100%">
  528. <el-option label="Appearance" value="Appearance"></el-option>
  529. <el-option label="Function" value="Function"></el-option>
  530. </el-select>
  531. </el-form-item>
  532. </el-col>
  533. <el-col :span="6">
  534. <el-form-item label="Mode 2">
  535. <el-select v-model="editFormData.mode2" placeholder="请选择" size="mini" style="width: 100%">
  536. <el-option label="Loose part" value="Loose part"></el-option>
  537. <el-option label="Others" value="Others"></el-option>
  538. <el-option label="Contamination" value="Contamination"></el-option>
  539. </el-select>
  540. </el-form-item>
  541. </el-col>
  542. <el-col :span="6">
  543. <el-form-item label="Mode 3">
  544. <el-select v-model="editFormData.mode3" placeholder="请选择" size="mini" style="width: 100%">
  545. <el-option label="Part Missing" value="Part Missing"></el-option>
  546. <el-option label="Glue" value="Glue"></el-option>
  547. </el-select>
  548. </el-form-item>
  549. </el-col>
  550. </el-row>
  551. </el-form>
  552. <div slot="footer" class="dialog-footer">
  553. <el-button type="primary" @click="handleSaveEdit" class="customer-bun-min">保存</el-button>
  554. <el-button @click="handleCloseEditDialog" class="customer-bun-min">关闭</el-button>
  555. </div>
  556. </el-dialog>
  557. <!-- 回复弹窗 -->
  558. <el-dialog
  559. title="质量问题 - 回复"
  560. :visible.sync="replyDialogVisible"
  561. width="50%"
  562. top="10vh"
  563. :close-on-click-modal="false"
  564. @close="handleCloseReplyDialog">
  565. <div class="reply-dialog-info">
  566. <el-row :gutter="20">
  567. <el-col :span="8">
  568. <div class="info-item">
  569. <span class="info-label">反馈单号:</span>
  570. <span class="info-value">{{ replyFormData.issueNo }}</span>
  571. </div>
  572. </el-col>
  573. <el-col :span="8">
  574. <div class="info-item">
  575. <span class="info-label">回复日期:</span>
  576. <span class="info-value">{{ replyFormData.replyTime }}</span>
  577. </div>
  578. </el-col>
  579. <el-col :span="8">
  580. <div class="info-item">
  581. <span class="info-label">回复人:</span>
  582. <span class="info-value">{{ replyFormData.replyBy }}</span>
  583. </div>
  584. </el-col>
  585. </el-row>
  586. </div>
  587. <el-form :model="replyFormData" :rules="replyRules" ref="replyFormData" label-position="top" size="mini" class="reply-dialog-form">
  588. <!-- Why Escape 下拉框 -->
  589. <el-form-item label="Why Escape" prop="whyEscape">
  590. <el-select v-model="replyFormData.whyEscape" placeholder="请选择流出原因" size="mini" style="width: 30%" clearable>
  591. <el-option label="AQL" value="AQL"></el-option>
  592. <el-option label="Transportation" value="Transportation"></el-option>
  593. </el-select>
  594. </el-form-item>
  595. <!-- 原因分析 -->
  596. <el-form-item label="原因分析" prop="analysis">
  597. <el-input
  598. v-model="replyFormData.analysis"
  599. type="textarea"
  600. :rows="4"
  601. placeholder="请输入原因分析"
  602. size="mini">
  603. </el-input>
  604. </el-form-item>
  605. <!-- 后续措施 -->
  606. <el-form-item label="后续措施" prop="correctiveAction">
  607. <el-input
  608. v-model="replyFormData.correctiveAction"
  609. type="textarea"
  610. :rows="4"
  611. placeholder="请输入后续措施"
  612. size="mini">
  613. </el-input>
  614. </el-form-item>
  615. </el-form>
  616. <div slot="footer" class="dialog-footer">
  617. <el-button type="primary" @click="handleSaveReply" class="customer-bun-min">保存</el-button>
  618. <el-button @click="handleCloseReplyDialog" class="customer-bun-min">关闭</el-button>
  619. </div>
  620. </el-dialog>
  621. <!-- 赔偿弹窗 -->
  622. <el-dialog
  623. title="质量问题 - 赔偿"
  624. :visible.sync="compensationDialogVisible"
  625. width="40%"
  626. top="10vh"
  627. :close-on-click-modal="false"
  628. @close="handleCloseCompensationDialog">
  629. <el-form :model="compensationFormData" :rules="compensationRules" ref="compensationFormData" label-position="top" size="mini" class="compensation-dialog-form">
  630. <!-- 反馈单号、索赔信息和被索赔金额 -->
  631. <el-row :gutter="5">
  632. <el-col :span="6">
  633. <el-form-item label="反馈单号">
  634. <el-input v-model="compensationFormData.issueNo" disabled></el-input>
  635. </el-form-item>
  636. </el-col>
  637. <el-col :span="6">
  638. <el-form-item label="索赔信息">
  639. <el-checkbox v-model="compensationFormData.isClaimed">是否被索赔</el-checkbox>
  640. </el-form-item>
  641. </el-col>
  642. <el-col :span="6">
  643. <el-form-item label="被索赔金额" prop="claimAmount">
  644. <el-input v-model="compensationFormData.claimAmount" placeholder="请输入被索赔金额"></el-input>
  645. </el-form-item>
  646. </el-col>
  647. </el-row>
  648. <!-- 处置备注 -->
  649. <el-form-item label="处置备注">
  650. <el-input
  651. v-model="compensationFormData.disposalRemark"
  652. type="textarea"
  653. :rows="3"
  654. placeholder="请输入处置备注"
  655. size="mini">
  656. </el-input>
  657. </el-form-item>
  658. </el-form>
  659. <div slot="footer" class="dialog-footer">
  660. <el-button type="primary" @click="handleSaveCompensation" class="customer-bun-min">保存</el-button>
  661. <el-button @click="handleCloseCompensationDialog" class="customer-bun-min">关闭</el-button>
  662. </div>
  663. </el-dialog>
  664. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  665. </div>
  666. </template>
  667. <script>
  668. import { queryQualityIssuePage, saveQualityIssue, deleteQualityIssue as deleteQualityIssueApi, updateQualityIssue, saveReply, saveClaim, closeQualityIssue } from '@/api/quality/qualityIssue.js'
  669. import Chooselist from '@/views/modules/common/Chooselist_eam'
  670. import ComQualityIssueDetail from './com_qualityIssueDetail.vue'
  671. import ComQualityIssueAttachment from './com_qualityIssueAttachment.vue'
  672. import ComQualityIssuePo from './com_qualityIssuePoList.vue'
  673. import excel from '@/utils/excel-util.js'
  674. export default {
  675. components: {
  676. Chooselist,
  677. QualityIssueDetail: ComQualityIssueDetail,
  678. QualityIssueAttachment: ComQualityIssueAttachment,
  679. QualityIssuePoList: ComQualityIssuePo
  680. },
  681. data () {
  682. return {
  683. functionId: this.$route.meta.menuId,
  684. height: 400,
  685. detailHeight: 400,
  686. currentRow: {},
  687. activeTab: 'detail',
  688. // 新增弹窗相关数据
  689. addDialogVisible: false,
  690. addFormData: {
  691. supplierResponsible: '',
  692. partNo: '',
  693. issueNo: '',
  694. issueDate: '',
  695. requireReplyDate: '',
  696. supplierNo: '',
  697. supplierName: '',
  698. plant: '',
  699. claimNo: '',
  700. productCategory: '',
  701. poNo: '',
  702. batchQty: '',
  703. rejectBatchQty: '',
  704. receiveComplaintDate: '',
  705. receiveSampleDate: '',
  706. issueCategory: '',
  707. issueSummary: '',
  708. issueDescription: '',
  709. inspector: '',
  710. levelNo: '',
  711. mode1: '',
  712. mode2: '',
  713. mode3: '',
  714. status: '已确认'
  715. },
  716. addRules: {
  717. issueDate: [
  718. { required: true, message: '请选择问题日期', trigger: 'change' }
  719. ],
  720. requireReplyDate: [
  721. { required: true, message: '请选择要求回复日期', trigger: 'change' }
  722. ],
  723. supplierNo: [
  724. { required: true, message: '请选择供应商', trigger: 'change' }
  725. ],
  726. issueCategory: [
  727. { required: true, message: '请选择问题分类', trigger: 'change' }
  728. ],
  729. issueSummary: [
  730. { required: true, message: '请输入问题简述', trigger: 'blur' }
  731. ]
  732. },
  733. // 编辑弹窗相关数据
  734. editDialogVisible: false,
  735. editFormData: {
  736. issueNo: '',
  737. issueDate: '',
  738. requireReplyDate: '',
  739. supplierNo: '',
  740. supplierName: '',
  741. plant: '',
  742. claimNo: '',
  743. productCategory: '',
  744. partNo: '',
  745. poNo: '',
  746. batchQty: '',
  747. rejectBatchQty: '',
  748. receiveComplaintDate: '',
  749. receiveSampleDate: '',
  750. issueCategory: '',
  751. issueSummary: '',
  752. issueDescription: '',
  753. inspector: '',
  754. levelNo: '',
  755. mode1: '',
  756. mode2: '',
  757. mode3: '',
  758. status: '',
  759. site: ''
  760. },
  761. editRules: {
  762. issueDate: [
  763. { required: true, message: '请选择问题日期', trigger: 'change' }
  764. ],
  765. requireReplyDate: [
  766. { required: true, message: '请选择要求回复日期', trigger: 'change' }
  767. ],
  768. issueCategory: [
  769. { required: true, message: '请选择问题分类', trigger: 'change' }
  770. ],
  771. issueSummary: [
  772. { required: true, message: '请输入问题简述', trigger: 'blur' }
  773. ]
  774. },
  775. // 回复弹窗相关数据
  776. replyDialogVisible: false,
  777. replyFormData: {
  778. site: '',
  779. issueNo: '',
  780. analysis: '',
  781. correctiveAction: '',
  782. whyEscape:'',
  783. replyBy: '',
  784. replyTime: ''
  785. },
  786. replyRules: {
  787. analysis: [
  788. { required: true, message: '请输入原因分析', trigger: 'blur' }
  789. ],
  790. correctiveAction: [
  791. { required: true, message: '请输入后续措施', trigger: 'blur' }
  792. ]
  793. },
  794. // 赔偿弹窗相关数据
  795. compensationDialogVisible: false,
  796. compensationFormData: {
  797. site: '',
  798. issueNo: '',
  799. isClaimed: false,
  800. claimAmount: '',
  801. disposalRemark: ''
  802. },
  803. compensationRules: {
  804. claimAmount: [
  805. { required: true, message: '请输入被索赔金额', trigger: 'blur' }
  806. ]
  807. },
  808. tagNo: '',
  809. searchData: {
  810. issueNo: '',
  811. supplierNo: '',
  812. claimNo:'',
  813. supplierName: '',
  814. issueCategory: '',
  815. status: '',
  816. issueDate: '',
  817. plant: '',
  818. productCategory: '',
  819. poNo: '',
  820. partNo: '',
  821. page: 1,
  822. limit: 50
  823. },
  824. searchType: '',
  825. pageIndex: 1,
  826. pageSize: 50,
  827. totalPage: 0,
  828. mainDataList: [],
  829. dataListLoading: false,
  830. columnArray1: [
  831. {
  832. userId: this.$store.state.user.name,
  833. functionId: this.functionId,
  834. serialNumber: 'QualityIssueTable1IssueNo',
  835. tableId: 'QualityIssueTable1',
  836. tableName: '质量问题',
  837. columnProp: 'issueNo',
  838. headerAlign: 'center',
  839. align: 'left',
  840. columnLabel: '反馈单号',
  841. columnWidth: '120',
  842. columnHidden: false,
  843. columnImage: false,
  844. columnSortable: false,
  845. sortLv: 0,
  846. status: true,
  847. fixed: false
  848. },
  849. {
  850. userId: this.$store.state.user.name,
  851. functionId: this.functionId,
  852. serialNumber: 'QualityIssueTable1IssueDate',
  853. tableId: 'QualityIssueTable1',
  854. tableName: '质量问题',
  855. columnProp: 'issueDate',
  856. headerAlign: 'center',
  857. align: 'center',
  858. columnLabel: '问题日期',
  859. columnWidth: '120',
  860. columnHidden: false,
  861. columnImage: false,
  862. columnSortable: false,
  863. sortLv: 0,
  864. status: true,
  865. fixed: false
  866. },
  867. {
  868. userId: this.$store.state.user.name,
  869. functionId: this.functionId,
  870. serialNumber: 'QualityIssueTable1SupplierNo',
  871. tableId: 'QualityIssueTable1',
  872. tableName: '质量问题',
  873. columnProp: 'supplierNo',
  874. headerAlign: 'center',
  875. align: 'left',
  876. columnLabel: '供应商编码',
  877. columnWidth: '120',
  878. columnHidden: false,
  879. columnImage: false,
  880. columnSortable: false,
  881. sortLv: 0,
  882. status: true,
  883. fixed: false
  884. },
  885. {
  886. userId: this.$store.state.user.name,
  887. functionId: this.functionId,
  888. serialNumber: 'QualityIssueTable1SupplierName',
  889. tableId: 'QualityIssueTable1',
  890. tableName: '质量问题',
  891. columnProp: 'supplierName',
  892. headerAlign: 'center',
  893. align: 'left',
  894. columnLabel: '供应商名称',
  895. columnWidth: '150',
  896. columnHidden: false,
  897. columnImage: false,
  898. columnSortable: false,
  899. sortLv: 0,
  900. status: true,
  901. fixed: false
  902. },
  903. {
  904. userId: this.$store.state.user.name,
  905. functionId: this.functionId,
  906. serialNumber: 'QualityIssueTable1IssueCategory',
  907. tableId: 'QualityIssueTable1',
  908. tableName: '质量问题',
  909. columnProp: 'issueCategory',
  910. headerAlign: 'center',
  911. align: 'left',
  912. columnLabel: '问题分类',
  913. columnWidth: '120',
  914. columnHidden: false,
  915. columnImage: false,
  916. columnSortable: false,
  917. sortLv: 0,
  918. status: true,
  919. fixed: false
  920. },
  921. {
  922. userId: this.$store.state.user.name,
  923. functionId: this.functionId,
  924. serialNumber: 'QualityIssueTable1IssueSummary',
  925. tableId: 'QualityIssueTable1',
  926. tableName: '质量问题',
  927. columnProp: 'issueSummary',
  928. headerAlign: 'center',
  929. align: 'left',
  930. columnLabel: '问题简述',
  931. columnWidth: '200',
  932. columnHidden: false,
  933. columnImage: false,
  934. columnSortable: false,
  935. sortLv: 0,
  936. status: true,
  937. fixed: false
  938. },
  939. {
  940. userId: this.$store.state.user.name,
  941. functionId: this.functionId,
  942. serialNumber: 'QualityIssueTable1Status',
  943. tableId: 'QualityIssueTable1',
  944. tableName: '质量问题',
  945. columnProp: 'status',
  946. headerAlign: 'center',
  947. align: 'center',
  948. columnLabel: '状态',
  949. columnWidth: '100',
  950. columnHidden: false,
  951. columnImage: false,
  952. columnSortable: false,
  953. sortLv: 0,
  954. status: true,
  955. fixed: false
  956. },
  957. {
  958. userId: this.$store.state.user.name,
  959. functionId: this.functionId,
  960. serialNumber: 'QualityIssueTable1CreateBy',
  961. tableId: 'QualityIssueTable1',
  962. tableName: '质量问题',
  963. columnProp: 'createBy',
  964. headerAlign: 'center',
  965. align: 'left',
  966. columnLabel: '录入人',
  967. columnWidth: '100',
  968. columnHidden: false,
  969. columnImage: false,
  970. columnSortable: false,
  971. sortLv: 0,
  972. status: true,
  973. fixed: false
  974. },
  975. {
  976. userId: this.$store.state.user.name,
  977. functionId: this.functionId,
  978. serialNumber: 'QualityIssueTable1CreateDate',
  979. tableId: 'QualityIssueTable1',
  980. tableName: '质量问题',
  981. columnProp: 'createDate',
  982. headerAlign: 'center',
  983. align: 'center',
  984. columnLabel: '录入时间',
  985. columnWidth: '150',
  986. columnHidden: false,
  987. columnImage: false,
  988. columnSortable: false,
  989. sortLv: 0,
  990. status: true,
  991. fixed: false
  992. }
  993. ]
  994. }
  995. },
  996. mounted () {
  997. this.$nextTick(() => {
  998. // 计算查询区域和分页的高度
  999. const queryHeight = 220 // 查询条件大约高度
  1000. const paginationHeight = 40 // 分页大约高度
  1001. const availableHeight = window.innerHeight - queryHeight - paginationHeight - 40 // 40为余量
  1002. // 主表格和页签各占一半
  1003. this.height = availableHeight * 0.5
  1004. this.detailHeight = availableHeight * 0.5
  1005. this.getMainData()
  1006. })
  1007. },
  1008. methods: {
  1009. // 获取当前页面的 site 与当前登录用户名,新增/删除/修改统一由前端传给后端
  1010. getCurrentOperator (actionText) {
  1011. const site = this.$store.state.user.site
  1012. const userName = this.$store.state.user.name
  1013. if (!site || !userName) {
  1014. this.$message.error('未获取到当前用户的站点或用户名,请重新登录后再' + actionText)
  1015. return null
  1016. }
  1017. return { site: site, userName: userName }
  1018. },
  1019. // 获取基础数据列表
  1020. getBaseList (val, type) {
  1021. this.tagNo = val
  1022. this.searchType = type || ''
  1023. this.$nextTick(() => {
  1024. let strVal = ''
  1025. let conSql = ''
  1026. if (val === 520) {
  1027. // 供应商编码
  1028. if (this.addDialogVisible) {
  1029. strVal = this.addFormData.supplierNo || ''
  1030. } else if (this.editDialogVisible) {
  1031. strVal = this.editFormData.supplierNo || ''
  1032. } else {
  1033. strVal = this.searchData.supplierNo || ''
  1034. }
  1035. conSql = " and site = '" + this.$store.state.user.site + "'"
  1036. } else if (val === 2016) {
  1037. // 供应商负责人
  1038. if (this.addDialogVisible) {
  1039. strVal = this.addFormData.supplierResponsible || ''
  1040. } else if (this.editDialogVisible) {
  1041. strVal = this.editFormData.supplierResponsible || ''
  1042. }
  1043. conSql = " and username <> '' "
  1044. } else if (val === 2017) {
  1045. // Part No
  1046. if (this.addDialogVisible) {
  1047. strVal = this.addFormData.partNo || ''
  1048. } else if (this.editDialogVisible) {
  1049. strVal = this.editFormData.partNo || ''
  1050. } else {
  1051. strVal = this.searchData.partNo || ''
  1052. }
  1053. conSql = " and part_no <> '' "
  1054. }
  1055. this.$refs.baseList.init(val, strVal, conSql)
  1056. })
  1057. },
  1058. /* 列表方法的回调 */
  1059. getBaseData (val) {
  1060. console.log('ChooseList 返回数据:', val)
  1061. console.log('当前 tagNo:', this.tagNo)
  1062. if (this.tagNo === 520) {
  1063. // SQL返回: supplier_no, supplier_name
  1064. const supplierNoVal = val.supplier_no || ''
  1065. const supplierNameVal = val.supplier_name || ''
  1066. if (this.addDialogVisible) {
  1067. this.$set(this.addFormData, 'supplierNo', supplierNoVal)
  1068. this.$set(this.addFormData, 'supplierName', supplierNameVal)
  1069. console.log('供应商编码赋值:', supplierNoVal, '供应商名称赋值:', supplierNameVal)
  1070. } else if (this.editDialogVisible) {
  1071. this.$set(this.editFormData, 'supplierNo', supplierNoVal)
  1072. this.$set(this.editFormData, 'supplierName', supplierNameVal)
  1073. console.log('供应商编码赋值:', supplierNoVal, '供应商名称赋值:', supplierNameVal)
  1074. } else {
  1075. this.$set(this.searchData, 'supplierNo', supplierNoVal)
  1076. console.log('供应商编码赋值:', supplierNoVal)
  1077. }
  1078. }
  1079. // 供应商负责人
  1080. else if (this.tagNo === 2016) {
  1081. const userName = val.user_display || ''
  1082. if (this.addDialogVisible) {
  1083. this.$set(this.addFormData, 'supplierResponsible', userName)
  1084. } else if (this.editDialogVisible) {
  1085. this.$set(this.editFormData, 'supplierResponsible', userName)
  1086. }
  1087. }
  1088. // Part No
  1089. else if (this.tagNo === 2017) {
  1090. const partNo = val.part_no || val.partNo || ''
  1091. if (this.addDialogVisible) {
  1092. this.$set(this.addFormData, 'partNo', partNo)
  1093. } else if (this.editDialogVisible) {
  1094. this.$set(this.editFormData, 'partNo', partNo)
  1095. } else {
  1096. this.$set(this.searchData, 'partNo', partNo)
  1097. }
  1098. }
  1099. },
  1100. // 选择供应商负责人
  1101. selectSupplierResponsible () {
  1102. this.tagNo = 2016
  1103. this.$nextTick(() => {
  1104. this.$refs.baseList.init(
  1105. 2016,
  1106. this.addFormData.supplierResponsible || '',
  1107. ''
  1108. )
  1109. })
  1110. },
  1111. // 选择 Part No
  1112. selectPartNo () {
  1113. this.tagNo = 2017
  1114. this.$nextTick(() => {
  1115. this.$refs.baseList.init(
  1116. 2017,
  1117. this.addFormData.partNo || '',
  1118. ''
  1119. )
  1120. })
  1121. },
  1122. // 查询数据
  1123. getMainData () {
  1124. this.searchData.limit = this.pageSize
  1125. this.searchData.page = this.pageIndex
  1126. this.searchData.site = this.$store.state.user.site
  1127. this.dataListLoading = true
  1128. queryQualityIssuePage(this.searchData).then(({ data }) => {
  1129. if (data.code === 0) {
  1130. this.mainDataList = data.page.list
  1131. this.pageIndex = data.page.currPage
  1132. this.pageSize = data.page.pageSize
  1133. this.totalPage = data.page.totalCount
  1134. this.$nextTick(() => {
  1135. if (this.$refs.mainTable) {
  1136. this.$refs.mainTable.clearSelection()
  1137. }
  1138. })
  1139. // 判断是否有数据
  1140. if (this.mainDataList.length > 0) {
  1141. this.$refs.mainTable.setCurrentRow(this.mainDataList[0])
  1142. this.changeData(this.mainDataList[0])
  1143. } else {
  1144. this.changeData(null)
  1145. }
  1146. }
  1147. this.dataListLoading = false
  1148. }).catch(() => {
  1149. this.dataListLoading = false
  1150. })
  1151. },
  1152. // 每页数
  1153. sizeChangeHandle (val) {
  1154. this.pageSize = val
  1155. this.pageIndex = 1
  1156. this.getMainData()
  1157. },
  1158. // 当前页
  1159. currentChangeHandle (val) {
  1160. this.pageIndex = val
  1161. this.getMainData()
  1162. },
  1163. // 页签点击事件
  1164. handleTabClick (tab) {
  1165. // 每次点击页签都触发对应页签的查询
  1166. if (tab.name === 'detail') {
  1167. // 详情页签
  1168. } else if (tab.name === 'attachment') {
  1169. // 附件页签
  1170. this.$nextTick(() => {
  1171. if (this.$refs.attachmentTab) {
  1172. this.$refs.attachmentTab.loadAttachmentList()
  1173. }
  1174. })
  1175. }else if(tab.name === 'po') {
  1176. this.$nextTick(() => {
  1177. if (this.$refs.qualityIssuePo) {
  1178. this.$refs.qualityIssuePo.loadData()
  1179. }
  1180. })
  1181. }
  1182. },
  1183. // 行点击事件
  1184. changeData (row) {
  1185. this.currentRow = row ? JSON.parse(JSON.stringify(row)) : {}
  1186. },
  1187. // 新增质量问题
  1188. addQualityIssue () {
  1189. this.addDialogVisible = true
  1190. this.resetAddForm()
  1191. },
  1192. // 关闭新增弹窗
  1193. handleCloseAddDialog () {
  1194. this.addDialogVisible = false
  1195. this.resetAddForm()
  1196. },
  1197. // 关闭编辑弹窗
  1198. handleCloseEditDialog () {
  1199. this.editDialogVisible = false
  1200. this.resetEditForm()
  1201. },
  1202. // 重置表单
  1203. resetAddForm () {
  1204. const today = new Date()
  1205. const year = today.getFullYear()
  1206. const month = String(today.getMonth() + 1).padStart(2, '0')
  1207. const day = String(today.getDate()).padStart(2, '0')
  1208. const todayStr = `${year}-${month}-${day}`
  1209. this.addFormData = {
  1210. issueNo: '',
  1211. issueDate: todayStr,
  1212. requireReplyDate: '',
  1213. supplierNo: '',
  1214. supplierName: '',
  1215. supplierResponsible: '',
  1216. plant: '',
  1217. claimNo: '',
  1218. productCategory: '',
  1219. partNo: '',
  1220. poNo: '',
  1221. batchQty: '',
  1222. rejectBatchQty: '',
  1223. receiveComplaintDate: '',
  1224. receiveSampleDate: '',
  1225. issueCategory: '',
  1226. issueSummary: '',
  1227. issueDescription: '',
  1228. inspector: '',
  1229. levelNo: '',
  1230. mode1: '',
  1231. mode2: '',
  1232. mode3: '',
  1233. status: '已确认'
  1234. }
  1235. if (this.$refs.addFormData) {
  1236. this.$refs.addFormData.clearValidate()
  1237. }
  1238. },
  1239. // 重置编辑表单
  1240. resetEditForm () {
  1241. this.editFormData = {
  1242. issueNo: '',
  1243. issueDate: '',
  1244. requireReplyDate: '',
  1245. supplierNo: '',
  1246. supplierName: '',
  1247. plant: '',
  1248. claimNo: '',
  1249. productCategory: '',
  1250. partNo: '',
  1251. poNo: '',
  1252. batchQty: '',
  1253. rejectBatchQty: '',
  1254. receiveComplaintDate: '',
  1255. receiveSampleDate: '',
  1256. issueCategory: '',
  1257. issueSummary: '',
  1258. issueDescription: '',
  1259. inspector: '',
  1260. levelNo: '',
  1261. mode1: '',
  1262. mode2: '',
  1263. mode3: '',
  1264. status: '',
  1265. site: ''
  1266. }
  1267. if (this.$refs.editFormData) {
  1268. this.$refs.editFormData.clearValidate()
  1269. }
  1270. },
  1271. // 选择供应商(仅新增模式)
  1272. selectSupplier () {
  1273. this.tagNo = 520
  1274. this.$nextTick(() => {
  1275. const conSql = " and site = '" + this.$store.state.user.site + "'"
  1276. this.$refs.baseList.init(520, this.addFormData.supplierNo || '', conSql)
  1277. })
  1278. },
  1279. // 保存新增
  1280. handleSaveAdd () {
  1281. this.$refs.addFormData.validate((valid) => {
  1282. if (valid) {
  1283. // 当前页面的 site 与当前用户名
  1284. const operator = this.getCurrentOperator('新增')
  1285. if (!operator) {
  1286. return
  1287. }
  1288. // 构建提交数据
  1289. const submitData = {
  1290. issueDate: this.addFormData.issueDate,
  1291. requireReplyDate: this.addFormData.requireReplyDate,
  1292. supplierNo: this.addFormData.supplierNo,
  1293. supplierName: this.addFormData.supplierName,
  1294. plant: this.addFormData.plant,
  1295. claimNo: this.addFormData.claimNo,
  1296. productCategory: this.addFormData.productCategory,
  1297. partNo: this.addFormData.partNo,
  1298. poNo: this.addFormData.poNo,
  1299. batchQty: this.addFormData.batchQty ? parseFloat(this.addFormData.batchQty) : null,
  1300. rejectBatchQty: this.addFormData.rejectBatchQty ? parseFloat(this.addFormData.rejectBatchQty) : null,
  1301. receiveComplaintDate: this.addFormData.receiveComplaintDate,
  1302. receiveSampleDate: this.addFormData.receiveSampleDate,
  1303. issueCategory: this.addFormData.issueCategory,
  1304. issueSummary: this.addFormData.issueSummary,
  1305. issueDescription: this.addFormData.issueDescription,
  1306. supplierResponsible: this.addFormData.supplierResponsible,
  1307. inspector: this.addFormData.inspector,
  1308. levelNo: this.addFormData.levelNo,
  1309. mode1: this.addFormData.mode1,
  1310. mode2: this.addFormData.mode2,
  1311. mode3: this.addFormData.mode3,
  1312. status: this.addFormData.status,
  1313. site: operator.site,
  1314. createBy: operator.userName,
  1315. updateBy: operator.userName
  1316. }
  1317. console.log('提交数据:', submitData)
  1318. saveQualityIssue(submitData).then(({ data }) => {
  1319. console.log('保存接口返回:', data)
  1320. if (data.code === 0) {
  1321. this.$message.success('保存成功')
  1322. this.handleCloseAddDialog()
  1323. this.getMainData()
  1324. } else {
  1325. this.$message.error(data.msg || '保存失败')
  1326. }
  1327. }).catch((error) => {
  1328. console.error('保存接口错误:', error)
  1329. this.$message.error('保存失败,请稍后重试')
  1330. })
  1331. } else {
  1332. console.log('表单验证失败')
  1333. this.$message.warning('请填写完整的表单信息')
  1334. }
  1335. })
  1336. },
  1337. // 保存编辑
  1338. handleSaveEdit () {
  1339. this.$refs.editFormData.validate((valid) => {
  1340. if (valid) {
  1341. // 当前页面的 site 与当前用户名
  1342. const operator = this.getCurrentOperator('修改')
  1343. if (!operator) {
  1344. return
  1345. }
  1346. // 构建提交数据
  1347. const submitData = {
  1348. site: operator.site,
  1349. updateBy: operator.userName,
  1350. issueNo: this.editFormData.issueNo,
  1351. issueDate: this.editFormData.issueDate,
  1352. requireReplyDate: this.editFormData.requireReplyDate,
  1353. plant: this.editFormData.plant,
  1354. claimNo: this.editFormData.claimNo,
  1355. productCategory: this.editFormData.productCategory,
  1356. partNo: this.editFormData.partNo,
  1357. poNo: this.editFormData.poNo,
  1358. batchQty: this.editFormData.batchQty ? parseFloat(this.editFormData.batchQty) : null,
  1359. rejectBatchQty: this.editFormData.rejectBatchQty ? parseFloat(this.editFormData.rejectBatchQty) : null,
  1360. receiveComplaintDate: this.editFormData.receiveComplaintDate,
  1361. receiveSampleDate: this.editFormData.receiveSampleDate,
  1362. issueCategory: this.editFormData.issueCategory,
  1363. issueSummary: this.editFormData.issueSummary,
  1364. issueDescription: this.editFormData.issueDescription,
  1365. inspector: this.editFormData.inspector,
  1366. levelNo: this.editFormData.levelNo,
  1367. mode1: this.editFormData.mode1,
  1368. mode2: this.editFormData.mode2,
  1369. mode3: this.editFormData.mode3,
  1370. status: this.editFormData.status,
  1371. supplierResponsible: this.editFormData.supplierResponsible
  1372. }
  1373. console.log('更新数据:', submitData)
  1374. updateQualityIssue(submitData).then(({ data }) => {
  1375. console.log('更新接口返回:', data)
  1376. if (data.code === 0) {
  1377. this.$message.success('更新成功')
  1378. this.handleCloseEditDialog()
  1379. this.getMainData()
  1380. } else {
  1381. this.$message.error(data.msg || '更新失败')
  1382. }
  1383. }).catch((error) => {
  1384. console.error('更新接口错误:', error)
  1385. this.$message.error('更新失败,请稍后重试')
  1386. })
  1387. } else {
  1388. console.log('表单验证失败')
  1389. this.$message.warning('请填写完整的表单信息')
  1390. }
  1391. })
  1392. },
  1393. // 编辑质量问题
  1394. editQualityIssue (row) {
  1395. this.editDialogVisible = true
  1396. this.editFormData = {
  1397. ...row, // 展开所有字段,确保不缺字段
  1398. site: row.site || this.$store.state.user.site,
  1399. issueDate: row.issueDate || '',
  1400. requireReplyDate: row.requireReplyDate || '',
  1401. supplierNo: row.supplierNo || '',
  1402. supplierName: row.supplierName || '',
  1403. supplierResponsible: row.supplierResponsible || '', // 确保有
  1404. plant: row.plant || '',
  1405. claimNo: row.claimNo || '',
  1406. productCategory: row.productCategory || '',
  1407. partNo: row.partNo || '',
  1408. poNo: row.poNo || '',
  1409. batchQty: row.batchQty || '',
  1410. rejectBatchQty: row.rejectBatchQty || '',
  1411. receiveComplaintDate: row.receiveComplaintDate || '',
  1412. receiveSampleDate: row.receiveSampleDate || '',
  1413. issueCategory: row.issueCategory || '',
  1414. issueSummary: row.issueSummary || '',
  1415. issueDescription: row.issueDescription || '',
  1416. inspector: row.inspector || '',
  1417. levelNo: row.levelNo || '',
  1418. mode1: row.mode1 || '',
  1419. mode2: row.mode2 || '',
  1420. mode3: row.mode3 || '',
  1421. status: row.status || ''
  1422. }
  1423. this.$nextTick(() => {
  1424. if (this.$refs.editFormData) {
  1425. this.$refs.editFormData.clearValidate()
  1426. }
  1427. })
  1428. },
  1429. // 删除质量问题
  1430. deleteQualityIssue(row) {
  1431. this.$confirm('确定要删除该质量问题吗?删除后无法恢复!', '提示', {
  1432. confirmButtonText: '确定删除',
  1433. cancelButtonText: '取消',
  1434. type: 'warning',
  1435. dangerouslyUseHTMLString: true
  1436. }).then(() => {
  1437. // 当前页面的 site 与当前用户名
  1438. const operator = this.getCurrentOperator('删除')
  1439. if (!operator) {
  1440. return
  1441. }
  1442. // 显示加载中
  1443. const loading = this.$loading({
  1444. lock: true,
  1445. text: '删除中...',
  1446. spinner: 'el-icon-loading',
  1447. background: 'rgba(0, 0, 0, 0.7)'
  1448. });
  1449. // 构建删除参数
  1450. const deleteParams = {
  1451. site: operator.site,
  1452. issueNo: row.issueNo,
  1453. updateBy: operator.userName
  1454. };
  1455. console.log('删除参数:', deleteParams);
  1456. // 调用删除接口
  1457. deleteQualityIssueApi(deleteParams).then(({ data }) => {
  1458. loading.close();
  1459. if (data.code === 0) {
  1460. this.$message.success('删除成功');
  1461. // 判断当前页是否还有数据
  1462. const isLastItem = this.mainDataList.length === 1;
  1463. // 刷新列表
  1464. if (isLastItem && this.pageIndex > 1) {
  1465. // 如果是最后一页的最后一条数据,跳转到上一页
  1466. this.pageIndex--;
  1467. }
  1468. this.getMainData();
  1469. } else {
  1470. this.$message.error(data.msg || '删除失败');
  1471. }
  1472. }).catch((error) => {
  1473. loading.close();
  1474. console.error('删除接口错误:', error);
  1475. this.$message.error('删除失败,请稍后重试');
  1476. });
  1477. }).catch(() => {
  1478. this.$message.info('已取消删除');
  1479. });
  1480. },
  1481. // 回复质量问题
  1482. replyQualityIssue (row) {
  1483. this.replyDialogVisible = true
  1484. // 自动填充表格中的数据
  1485. const now = new Date()
  1486. const year = now.getFullYear()
  1487. const month = String(now.getMonth() + 1).padStart(2, '0')
  1488. const day = String(now.getDate()).padStart(2, '0')
  1489. const currentDate = `${year}-${month}-${day}`
  1490. this.replyFormData = {
  1491. site: row.site || this.$store.state.user.site,
  1492. issueNo: row.issueNo || '',
  1493. analysis: row.analysis || '', // 从行数据中获取已有值
  1494. correctiveAction: row.correctiveAction || '', // 从行数据中获取已有值
  1495. whyEscape: row.whyEscape || '', // 添加这行:从行数据中获取已有值
  1496. replyBy: this.$store.state.user.name || '',
  1497. replyTime: currentDate
  1498. }
  1499. // 清除验证状态
  1500. this.$nextTick(() => {
  1501. if (this.$refs.replyFormData) {
  1502. this.$refs.replyFormData.clearValidate()
  1503. }
  1504. })
  1505. },
  1506. // 关闭回复弹窗
  1507. handleCloseReplyDialog () {
  1508. this.replyDialogVisible = false
  1509. this.resetReplyForm()
  1510. },
  1511. // 重置回复表单
  1512. resetReplyForm () {
  1513. this.replyFormData = {
  1514. site: '',
  1515. issueNo: '',
  1516. analysis: '',
  1517. correctiveAction: '',
  1518. replyBy: '',
  1519. replyTime: ''
  1520. }
  1521. if (this.$refs.replyFormData) {
  1522. this.$refs.replyFormData.clearValidate()
  1523. }
  1524. },
  1525. // 保存回复
  1526. handleSaveReply () {
  1527. this.$refs.replyFormData.validate((valid) => {
  1528. if (valid) {
  1529. // 构建提交数据 - 添加 whyEscape
  1530. const submitData = {
  1531. site: this.replyFormData.site,
  1532. issueNo: this.replyFormData.issueNo,
  1533. analysis: this.replyFormData.analysis,
  1534. correctiveAction: this.replyFormData.correctiveAction,
  1535. whyEscape: this.replyFormData.whyEscape // 添加这个字段
  1536. }
  1537. console.log('回复数据:', submitData)
  1538. saveReply(submitData).then(({ data }) => {
  1539. console.log('回复接口返回:', data)
  1540. if (data.code === 0) {
  1541. this.$message.success('回复成功')
  1542. this.handleCloseReplyDialog()
  1543. this.getMainData()
  1544. } else {
  1545. this.$message.error(data.msg || '回复失败')
  1546. }
  1547. }).catch((error) => {
  1548. console.error('回复接口错误:', error)
  1549. this.$message.error('回复失败,请稍后重试')
  1550. })
  1551. } else {
  1552. console.log('表单验证失败')
  1553. this.$message.warning('请填写完整的回复信息')
  1554. }
  1555. })
  1556. },
  1557. // 赔偿质量问题
  1558. compensationQualityIssue (row) {
  1559. this.compensationDialogVisible = true
  1560. // 自动填充表格中的数据
  1561. this.compensationFormData = {
  1562. site: row.site || this.$store.state.user.site,
  1563. issueNo: row.issueNo || '',
  1564. isClaimed: row.claimFlag === 'Y' ? true : false,
  1565. claimAmount: row.claimAmount || '',
  1566. disposalRemark: row.disposalRemark || ''
  1567. }
  1568. // 清除验证状态
  1569. this.$nextTick(() => {
  1570. if (this.$refs.compensationFormData) {
  1571. this.$refs.compensationFormData.clearValidate()
  1572. }
  1573. })
  1574. },
  1575. // 关闭赔偿弹窗
  1576. handleCloseCompensationDialog () {
  1577. this.compensationDialogVisible = false
  1578. this.resetCompensationForm()
  1579. },
  1580. // 重置赔偿表单
  1581. resetCompensationForm () {
  1582. this.compensationFormData = {
  1583. site: '',
  1584. issueNo: '',
  1585. isClaimed: false,
  1586. claimAmount: '',
  1587. disposalRemark: ''
  1588. }
  1589. if (this.$refs.compensationFormData) {
  1590. this.$refs.compensationFormData.clearValidate()
  1591. }
  1592. },
  1593. // 保存赔偿
  1594. handleSaveCompensation () {
  1595. this.$refs.compensationFormData.validate((valid) => {
  1596. if (valid) {
  1597. // 构建提交数据 - 将前端的isClaimed转换为后端的claimFlag(Y/N)
  1598. const submitData = {
  1599. site: this.compensationFormData.site,
  1600. issueNo: this.compensationFormData.issueNo,
  1601. claimFlag: this.compensationFormData.isClaimed ? 'Y' : 'N',
  1602. claimAmount: this.compensationFormData.claimAmount ? parseFloat(this.compensationFormData.claimAmount) : null,
  1603. disposalRemark: this.compensationFormData.disposalRemark
  1604. }
  1605. console.log('赔偿数据:', submitData)
  1606. // 调用后端赔偿接口
  1607. saveClaim(submitData).then(({ data }) => {
  1608. if (data.code === 0) {
  1609. this.$message.success('保存成功')
  1610. this.handleCloseCompensationDialog()
  1611. this.getMainData()
  1612. } else {
  1613. this.$message.error(data.msg || '保存失败')
  1614. }
  1615. }).catch((error) => {
  1616. console.error('赔偿接口错误:', error)
  1617. this.$message.error('保存失败,请稍后重试')
  1618. })
  1619. } else {
  1620. console.log('表单验证失败')
  1621. this.$message.warning('请填写完整的赔偿信息')
  1622. }
  1623. })
  1624. },
  1625. // 关闭质量问题
  1626. closeQualityIssueAction (row) {
  1627. this.$confirm('确定要关闭该质量问题吗?关闭后将无法修改!', '提示', {
  1628. confirmButtonText: '确定关闭',
  1629. cancelButtonText: '取消',
  1630. type: 'warning',
  1631. dangerouslyUseHTMLString: true
  1632. }).then(() => {
  1633. // 显示加载中
  1634. const loading = this.$loading({
  1635. lock: true,
  1636. text: '关闭中...',
  1637. spinner: 'el-icon-loading',
  1638. background: 'rgba(0, 0, 0, 0.7)'
  1639. });
  1640. // 构建关闭参数
  1641. const closeParams = {
  1642. site: row.site || this.$store.state.user.site,
  1643. issueNo: row.issueNo
  1644. };
  1645. console.log('关闭参数:', closeParams);
  1646. // 调用关闭接口
  1647. closeQualityIssue(closeParams).then(({ data }) => {
  1648. loading.close();
  1649. if (data.code === 0) {
  1650. this.$message.success('关闭成功');
  1651. this.getMainData();
  1652. } else {
  1653. this.$message.error(data.msg || '关闭失败');
  1654. }
  1655. }).catch((error) => {
  1656. loading.close();
  1657. console.error('关闭接口错误:', error);
  1658. this.$message.error('关闭失败,请稍后重试');
  1659. });
  1660. }).catch(() => {
  1661. this.$message.info('已取消关闭');
  1662. });
  1663. },
  1664. // 导出
  1665. exportExcel () {
  1666. console.log('开始导出...')
  1667. // 生成文件名(使用原生 Date)
  1668. const now = new Date()
  1669. const year = now.getFullYear()
  1670. const month = String(now.getMonth() + 1).padStart(2, '0')
  1671. const day = String(now.getDate()).padStart(2, '0')
  1672. const hour = String(now.getHours()).padStart(2, '0')
  1673. const minute = String(now.getMinutes()).padStart(2, '0')
  1674. const second = String(now.getSeconds()).padStart(2, '0')
  1675. const exportName = `质量问题${year}${month}${day}${hour}${minute}${second}`
  1676. console.log('导出参数:', this.searchData)
  1677. // 获取当前查询条件
  1678. const exportParams = {
  1679. ...this.searchData,
  1680. limit: -1, // 导出全部数据
  1681. page: 1
  1682. }
  1683. try {
  1684. excel.exportTable({
  1685. url: '/srm/qualityIssue/queryPage',
  1686. columnMapping: this.columnArray1,
  1687. mergeSetting: [],
  1688. params: exportParams,
  1689. fileName: exportName + '.xlsx',
  1690. rowFetcher: res => {
  1691. console.log('导出数据响应:', res)
  1692. return res.data.page.list
  1693. },
  1694. columnFormatter: [],
  1695. dropColumns: []
  1696. })
  1697. console.log('导出请求已发送')
  1698. } catch (error) {
  1699. console.error('导出失败:', error)
  1700. this.$message.error('导出失败: ' + error.message)
  1701. }
  1702. }
  1703. },
  1704. created () {
  1705. this.getMainData()
  1706. }
  1707. }
  1708. </script>
  1709. <style scoped lang="scss">
  1710. .search-form-inline {
  1711. background: #fff;
  1712. padding: 0;
  1713. margin-bottom: 0;
  1714. }
  1715. .search-row {
  1716. display: flex;
  1717. align-items: flex-end;
  1718. flex-wrap: wrap;
  1719. gap: 0;
  1720. margin-bottom: 0;
  1721. }
  1722. .search-item {
  1723. flex: none;
  1724. margin-bottom: 0;
  1725. margin-right: 12px;
  1726. }
  1727. /* 统一标签样式:使用 Element UI 默认字体大小(14px),移除自定义颜色 */
  1728. .search-item /deep/ .el-form-item__label {
  1729. padding-bottom: 5px;
  1730. line-height: 1;
  1731. height: auto;
  1732. }
  1733. .search-btn-item {
  1734. flex: none;
  1735. margin-bottom: 0;
  1736. margin-right: 0;
  1737. }
  1738. .search-item /deep/ .el-form-item__content {
  1739. line-height: normal;
  1740. }
  1741. .date-range {
  1742. display: flex;
  1743. align-items: center;
  1744. }
  1745. .split {
  1746. padding: 0 6px;
  1747. color: #606266;
  1748. font-size: 13px;
  1749. }
  1750. /deep/ .customer-tab {
  1751. overflow: hidden;
  1752. margin-top: 10px !important;
  1753. height: calc(60vh - 100px);
  1754. display: flex;
  1755. flex-direction: column;
  1756. }
  1757. /deep/ .customer-tab .el-tabs__content {
  1758. padding: 0 !important;
  1759. flex: 1;
  1760. overflow: hidden;
  1761. display: flex;
  1762. flex-direction: column;
  1763. }
  1764. /deep/ .customer-tab .el-tab-pane {
  1765. height: 100%;
  1766. overflow-y: auto;
  1767. }
  1768. .add-dialog-form /deep/ .el-form-item {
  1769. margin-bottom: 8px;
  1770. }
  1771. .add-dialog-form /deep/ .el-form-item__label {
  1772. text-align: left;
  1773. float: none;
  1774. display: block;
  1775. padding: 0 0 3px 0;
  1776. line-height: 1;
  1777. font-size: 12px;
  1778. }
  1779. .add-dialog-form /deep/ .el-form-item__content {
  1780. margin-left: 0 !important;
  1781. }
  1782. .dialog-footer {
  1783. text-align: center;
  1784. }
  1785. /* 回复弹窗样式 - 取消灰色背景 */
  1786. .reply-dialog-info {
  1787. margin-bottom: 20px;
  1788. padding: 0;
  1789. background: transparent;
  1790. border-radius: 0;
  1791. }
  1792. .reply-dialog-info .info-item {
  1793. display: flex;
  1794. align-items: center;
  1795. margin-bottom: 10px;
  1796. }
  1797. .reply-dialog-info .info-item:last-child {
  1798. margin-bottom: 0;
  1799. }
  1800. .reply-dialog-info .info-label {
  1801. font-size: 13px;
  1802. color: #606266;
  1803. font-weight: 500;
  1804. min-width: 80px;
  1805. }
  1806. .reply-dialog-info .info-value {
  1807. font-size: 13px;
  1808. color: #303133;
  1809. flex: 1;
  1810. }
  1811. /* 赔偿弹窗样式 */
  1812. .compensation-dialog-info {
  1813. margin-bottom: 20px;
  1814. padding: 0;
  1815. background: transparent;
  1816. border-radius: 0;
  1817. }
  1818. .compensation-dialog-info .info-item {
  1819. display: flex;
  1820. align-items: center;
  1821. margin-bottom: 10px;
  1822. }
  1823. .compensation-dialog-info .info-item:last-child {
  1824. margin-bottom: 0;
  1825. }
  1826. .compensation-dialog-info .info-label {
  1827. font-size: 13px;
  1828. color: #606266;
  1829. font-weight: 500;
  1830. min-width: 80px;
  1831. }
  1832. .compensation-dialog-info .info-value {
  1833. font-size: 13px;
  1834. color: #303133;
  1835. flex: 1;
  1836. }
  1837. .compensation-dialog-form /deep/ .el-form-item {
  1838. margin-bottom: 15px;
  1839. }
  1840. .compensation-dialog-form /deep/ .el-form-item__label {
  1841. font-size: 13px;
  1842. color: #606266;
  1843. font-weight: 500;
  1844. padding-bottom: 5px;
  1845. line-height: 1;
  1846. height: auto;
  1847. }
  1848. .compensation-dialog-form /deep/ .el-form-item__content {
  1849. line-height: normal;
  1850. }
  1851. .click-label {
  1852. color: #2ec7c9;
  1853. cursor: pointer;
  1854. font-weight: 500;
  1855. }
  1856. .click-label:hover {
  1857. text-decoration: underline;
  1858. }
  1859. .choose-label {
  1860. color: #2ec7c9;
  1861. cursor: pointer;
  1862. font-weight: 500;
  1863. }
  1864. .choose-label:hover {
  1865. text-decoration: underline;
  1866. }
  1867. /* 新增和编辑弹窗中的日期选择器图标样式修复 */
  1868. .add-dialog-form /deep/ .el-date-editor.el-input {
  1869. width: 100%;
  1870. }
  1871. .add-dialog-form /deep/ .el-date-editor .el-input__inner {
  1872. padding-left: 35px !important;
  1873. }
  1874. .add-dialog-form /deep/ .el-date-editor .el-input__prefix {
  1875. left: 8px;
  1876. top: 50%;
  1877. transform: translateY(-50%);
  1878. display: flex;
  1879. align-items: center;
  1880. }
  1881. .add-dialog-form /deep/ .el-date-editor .el-input__icon {
  1882. line-height: 28px;
  1883. height: 28px;
  1884. font-size: 14px;
  1885. }
  1886. </style>