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.

1596 lines
52 KiB

2 days ago
1 week ago
1 week 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 style="cursor: pointer" slot="label" @click="getBaseList(501)"><a href="#">供应商编码</a></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: 250px" @keyup.enter.native="getMainData"/>
  12. </el-form-item>
  13. <el-form-item label="申请日期" class="search-item">
  14. <div class="date-range">
  15. <el-date-picker v-model="searchData.requestDateStart" type="date" value-format="yyyy-MM-dd" placeholder="开始" style="width: 150px"/>
  16. <span class="split">-</span>
  17. <el-date-picker v-model="searchData.requestDateEnd" type="date" value-format="yyyy-MM-dd" placeholder="结束" style="width: 150px"/>
  18. </div>
  19. </el-form-item>
  20. <el-form-item label="状态" class="search-item">
  21. <el-select v-model="searchData.status" clearable placeholder="全部" style="width: 60%">
  22. <el-option label="全部" value="" />
  23. <el-option label="草稿" value="Draft" />
  24. <el-option label="待审核" value="Confirmed" />
  25. <el-option label="已下达" value="Audited" />
  26. <el-option label="已排程" value="Scheduled" />
  27. <el-option label="验货中" value="Inspecting" />
  28. <el-option label="验货完成" value="InspectionCompleted" />
  29. <el-option label="已完成" value="Completed" />
  30. <el-option label="已取消" value="Cancelled" />
  31. </el-select>
  32. </el-form-item>
  33. </div>
  34. <div class="search-row">
  35. <el-form-item class="search-item">
  36. <span style="cursor: pointer" slot="label" @click="getBaseList(2016, 'createBy')"><a href="#">申请人员</a></span>
  37. <el-input v-model="searchData.createBy" style="width: 120px" @keyup.enter.native="getMainData"/>
  38. </el-form-item>
  39. <el-form-item class="search-item">
  40. <span style="cursor: pointer" slot="label" @click="getBaseList(2016, 'qcOperator')"><a href="#">QC人员</a></span>
  41. <el-input v-model="searchData.qcOperator" style="width: 120px" @keyup.enter.native="getMainData"/>
  42. </el-form-item>
  43. <el-form-item label="申请单号" class="search-item">
  44. <el-input v-model="searchData.requestNo" style="width: 120px" @keyup.enter.native="getMainData"/>
  45. </el-form-item>
  46. <el-form-item label="建议验货日期" class="search-item">
  47. <div class="date-range">
  48. <el-date-picker v-model="searchData.needInspectDateStart" type="date" value-format="yyyy-MM-dd" placeholder="开始" style="width: 150px"/>
  49. <span class="split">-</span>
  50. <el-date-picker v-model="searchData.needInspectDateEnd" type="date" value-format="yyyy-MM-dd" placeholder="结束" style="width: 150px"/>
  51. </div>
  52. </el-form-item>
  53. <el-form-item label="计划验货日期" class="search-item">
  54. <div class="date-range">
  55. <el-date-picker v-model="searchData.planStartDate" type="date" value-format="yyyy-MM-dd" placeholder="开始" style="width: 150px"/>
  56. <span class="split">-</span>
  57. <el-date-picker v-model="searchData.planEndDate" type="date" value-format="yyyy-MM-dd" placeholder="结束" style="width: 150px"/>
  58. </div>
  59. </el-form-item>
  60. <el-form-item label=" " class="search-item search-btn-item">
  61. <el-button type="primary" @click="getMainData" style="">查询</el-button>
  62. <el-button type="primary" @click="addInspectionRequest" style="margin-left: 2px">新增</el-button>
  63. <el-button type="primary" @click="importExcel" style="margin-left: 2px">Excel导入</el-button>
  64. <el-button type="primary" @click="exportExcel" style="margin-left: 2px">导出</el-button>
  65. </el-form-item>
  66. </div>
  67. </el-form>
  68. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  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="150" label="操作">
  95. <template slot-scope="scope">
  96. <a v-if="scope.row.status === '草稿' || scope.row.statusDb === 'Draft'"
  97. class="customer-a" @click="confirmInspection(scope.row)">确认 |</a>
  98. <a v-if="(scope.row.status === '草稿' || scope.row.statusDb === 'Draft') ||
  99. (scope.row.status === '待审核' || scope.row.statusDb === 'Confirmed') ||
  100. (scope.row.status === '已下达' || scope.row.statusDb === 'Audited')"
  101. class="customer-a" @click="deleteInspectionRequest(scope.row)">删除</a>
  102. <span v-else class="customer-a" style="color: #909399; cursor: default;">{{ scope.row.status }}</span>
  103. </template>
  104. </el-table-column>
  105. </el-table>
  106. <!-- 分页插件 -->
  107. <el-pagination style="margin-top: 0px"
  108. @size-change="sizeChangeHandle"
  109. @current-change="currentChangeHandle"
  110. :current-page="pageIndex"
  111. :page-sizes="[20, 50, 100, 200, 500]"
  112. :page-size="pageSize"
  113. :total="totalPage"
  114. layout="total, sizes, prev, pager, next, jumper">
  115. </el-pagination>
  116. <!-- 详情页签 -->
  117. <el-tabs v-model="activeTab" style="margin-top: 0px; width: 99%;" @tab-click="handleTabClick" class="customer-tab" type="border-card">
  118. <!-- 基本信息 -->
  119. <el-tab-pane label="基本信息" name="base">
  120. <inspection-request-detail :detail-data="currentRow" @update-success="getMainData"/>
  121. </el-tab-pane>
  122. <!-- 验货明细 -->
  123. <el-tab-pane label="验货明细" name="detail">
  124. <inspection-request-detail-tab ref="inspectionDetailTab" :detail-data="currentRow" :table-height="detailHeight" />
  125. </el-tab-pane>
  126. <!-- 验货关联PO明细 -->
  127. <el-tab-pane label="验货关联PO明细" name="poDetail">
  128. <inspection-request-po-detail-tab ref="poDetailTab" :detail-data="currentRow" :table-height="detailHeight" />
  129. </el-tab-pane>
  130. <!-- 验货结果 -->
  131. <el-tab-pane label="验货结果" name="result">
  132. <inspection-result-tab ref="resultTab" :detail-data="currentRow" :table-height="detailHeight" />
  133. </el-tab-pane>
  134. <!-- 费用明细 -->
  135. <el-tab-pane label="费用明细" name="fee">
  136. <inspection-request-fee-tab ref="feeTab" :detail-data="currentRow" :table-height="detailHeight" />
  137. </el-tab-pane>
  138. <!-- 附件管理 -->
  139. <el-tab-pane label="附件管理" name="attachment">
  140. <inspection-request-attachment-tab ref="attachmentTab" :detail-data="currentRow" :table-height="detailHeight" />
  141. </el-tab-pane>
  142. </el-tabs>
  143. <!-- 新增弹窗 -->
  144. <el-dialog
  145. title="新增验货申请"
  146. :visible.sync="addDialogVisible"
  147. width="65%"
  148. top="5vh"
  149. :close-on-click-modal="false"
  150. @close="handleCloseAddDialog">
  151. <el-form :model="addFormData" :rules="addRules" ref="addFormData" label-width="90px" size="mini" class="add-dialog-form">
  152. <div class="form-section">
  153. <el-row :gutter="10">
  154. <el-col :span="6">
  155. <el-form-item label="申请单号" prop="requestNo">
  156. <el-input v-model="addFormData.requestNo" placeholder="自动生成" disabled size="mini"></el-input>
  157. </el-form-item>
  158. </el-col>
  159. <el-col :span="6">
  160. <el-form-item label="申请日期" prop="requestDate">
  161. <el-date-picker
  162. v-model="addFormData.requestDate"
  163. type="date"
  164. value-format="yyyy-MM-dd"
  165. placeholder="选择日期"
  166. size="mini"
  167. style="width: 100%">
  168. </el-date-picker>
  169. </el-form-item>
  170. </el-col>
  171. <el-col :span="12">
  172. <el-form-item label=" " >
  173. <div style="height: 28px;"></div>
  174. </el-form-item>
  175. </el-col>
  176. </el-row>
  177. <el-row :gutter="10">
  178. <el-col :span="6">
  179. <el-form-item prop="supplierNo"><span slot="label" class="choose-label" @click="getBaseList(501)">供应商编码</span>
  180. <el-input
  181. v-model="addFormData.supplierNo"
  182. readonly
  183. size="mini">
  184. </el-input>
  185. </el-form-item>
  186. </el-col>
  187. <el-col :span="10">
  188. <el-form-item label="供应商名称" prop="supplierName">
  189. <el-input v-model="addFormData.supplierName" disabled size="mini"></el-input>
  190. </el-form-item>
  191. </el-col>
  192. <el-col :span="8">
  193. <el-form-item label=" " >
  194. <div style="height: 28px;"></div>
  195. </el-form-item>
  196. </el-col>
  197. </el-row>
  198. <el-row :gutter="10">
  199. <el-col :span="6">
  200. <el-form-item label="建议验货日期" prop="needInspectDate">
  201. <el-date-picker
  202. v-model="addFormData.needInspectDate"
  203. type="date"
  204. value-format="yyyy-MM-dd"
  205. placeholder="选择日期"
  206. size="mini"
  207. style="width: 100%">
  208. </el-date-picker>
  209. </el-form-item>
  210. </el-col>
  211. <el-col :span="10">
  212. <el-form-item label="验货地址" prop="inspectAddress">
  213. <el-input v-model="addFormData.inspectAddress" placeholder="请输入验货地址" size="mini"></el-input>
  214. </el-form-item>
  215. </el-col>
  216. <el-col :span="6">
  217. <el-form-item label="联系人" prop="contact">
  218. <el-input v-model="addFormData.contact" placeholder="请输入联系人及电话" size="mini"></el-input>
  219. </el-form-item>
  220. </el-col>
  221. <el-col :span="2">
  222. <el-form-item label=" " >
  223. <div style="height: 28px;"></div>
  224. </el-form-item>
  225. </el-col>
  226. </el-row>
  227. </div>
  228. <!-- 步骤2批量选择PO -->
  229. <div class="po-section">
  230. <div class="section-title">批量选择PO</div>
  231. <!-- PO号筛选和排序工具栏 -->
  232. <div class="po-toolbar">
  233. <!-- 搜索框 + 按钮组放在一起 -->
  234. <div style="display: flex; align-items: center; gap: 8px; flex: 0 0 auto;">
  235. <!-- 搜索框 -->
  236. <div style="width: 180px;">
  237. <el-input
  238. v-model="poSearchKeyword"
  239. placeholder="请输入PO号筛选"
  240. size="mini"
  241. clearable
  242. @input="filterPoList">
  243. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  244. </el-input>
  245. </div>
  246. <!-- CRD日期排序按钮 -->
  247. <el-button type="primary" icon="el-icon-sort" @click="toggleCrdSort">
  248. CRD日期排序
  249. </el-button>
  250. <!-- 重置筛选按钮 -->
  251. <el-button type="primary" @click="resetPoFilter" v-if="poSearchKeyword || crdSortOrder">
  252. 重置筛选
  253. </el-button>
  254. </div>
  255. </div>
  256. <el-table
  257. :data="filteredPoList"
  258. border
  259. size="small"
  260. table-layout="fixed"
  261. height="400px"
  262. style="width: 100%; margin-top: 10px;"
  263. @selection-change="handleSelectionChange">
  264. <el-table-column type="selection" width="55" align="center" fixed="left" />
  265. <el-table-column prop="orderRef1" label="PO号" header-align="center" align="center" width="120"/>
  266. <el-table-column prop="orderRef2" label="PO行号" header-align="center" align="center" width="60"/>
  267. <el-table-column prop="partNo" label="产品编码" header-align="center" align="left" min-width="100" show-overflow-tooltip/>
  268. <el-table-column prop="partDesc" label="产品名称" header-align="center" align="left" min-width="150" show-overflow-tooltip/>
  269. <el-table-column prop="qty" label="订单数量" header-align="center" align="right" width="80"/>
  270. <el-table-column prop="waitInspectQty" label="未验货数量" header-align="center" align="right" width="80"/>
  271. <el-table-column label="此次验货数量" header-align="center" align="center" width="150">
  272. <template slot-scope="scope">
  273. <el-input-number
  274. v-model="scope.row.inspectQty"
  275. :min="0"
  276. :max="scope.row.waitInspectQty || 999999"
  277. size="mini"
  278. :controls="false"
  279. style="width: 100%; box-sizing: border-box;">
  280. </el-input-number>
  281. </template>
  282. </el-table-column>
  283. <el-table-column prop="shipMethod" label="运输方式" header-align="center" align="center" width="100">
  284. <template slot-scope="scope">
  285. <el-select v-model="scope.row.shipMethod" placeholder="请选择" size="mini" style="width: 100%; box-sizing: border-box;">
  286. <el-option label="空运" value="空运"></el-option>
  287. <el-option label="海运" value="海运"></el-option>
  288. <el-option label="陆运" value="陆运"></el-option>
  289. </el-select>
  290. </template>
  291. </el-table-column>
  292. <el-table-column
  293. prop="crd"
  294. label="CRD日期"
  295. header-align="center"
  296. align="center"
  297. width="160"
  298. sortable
  299. :sort-method="(a, b) => sortCrdDate(a, b)">
  300. <template slot-scope="scope">
  301. <el-date-picker
  302. v-model="scope.row.crd"
  303. type="date"
  304. value-format="yyyy-MM-dd"
  305. format="yyyy-MM-dd"
  306. placeholder="选择日期"
  307. size="mini"
  308. style="width: 100%;"
  309. />
  310. </template>
  311. </el-table-column>
  312. </el-table>
  313. </div>
  314. </el-form>
  315. <div slot="footer" class="dialog-footer">
  316. <el-button type="primary" @click="handleSaveAdd">保存</el-button>
  317. <el-button @click="handleCloseAddDialog">关闭</el-button>
  318. </div>
  319. </el-dialog>
  320. <!-- 导入弹窗 -->
  321. <el-dialog title="验货申请数据导入" :visible.sync="uploadDialogVisible" width="800px">
  322. <!-- 选择文件 -->
  323. <div style="margin-bottom:15px;display:flex;align-items:center">
  324. <span style="margin-right:10px">请选择文件</span>
  325. <el-input v-model="uploadFileName" style="width:400px;margin-right:10px" readonly></el-input>
  326. <el-upload ref="upload" action="/api/inspection/upload"
  327. :show-file-list="false" :on-change="handleFileChange"
  328. :auto-upload="false">
  329. <el-button type="primary">选择文件</el-button>
  330. </el-upload>
  331. <el-button type="success" style="margin-left:10px" @click="previewUpload">上传</el-button>
  332. <el-button type="primary" @click="downloadTemplate" style="margin-left:10px">
  333. <i class="el-icon-download"></i> 下载模板
  334. </el-button>
  335. </div>
  336. <!-- 预览表格 -->
  337. <el-table
  338. :data="uploadPreviewList"
  339. border
  340. height="250"
  341. style="width:100%;margin-top:10px"
  342. >
  343. <el-table-column prop="poNo" label="PO号" align="center" width="auto"></el-table-column>
  344. <el-table-column prop="poItemNo" label="PO行号" align="center" width="auto"></el-table-column>
  345. <el-table-column prop="partNo" label="产品编码" align="center" width="auto"></el-table-column>
  346. <el-table-column prop="qty" label="验货数量" align="center" width="auto"></el-table-column>
  347. <el-table-column prop="shipMethod" label="运输方式" align="center" width="auto"></el-table-column>
  348. <el-table-column prop="crd" label="CRD" align="center" width="auto"></el-table-column>
  349. <el-table-column prop="suggestInspectDate" label="建议验货日期" align="center" width="auto"></el-table-column>
  350. <el-table-column prop="inspectAddress" label="验货地址" align="center" width="auto"></el-table-column>
  351. <el-table-column prop="inspectContract" label="联系人" align="center" width="auto"></el-table-column>
  352. </el-table>
  353. <!-- 按钮 -->
  354. <div style="margin-top:20px;text-align:center">
  355. <el-button type="primary" @click="confirmUpload">保存</el-button>
  356. <el-button @click="uploadDialogVisible=false" style="margin-right:30px">关闭</el-button>
  357. </div>
  358. </el-dialog>
  359. </div>
  360. </template>
  361. <script>
  362. import { searchInspectionRequestHeaderList, queryPoPage, saveInspectionRequest, deleteInspectionRequest, confirmInspectionRequest, downloadTemplate, previewUpload, batchSave } from '@/api/inspection/inspectionRequestHeader.js'
  363. import { searchSrmSupplierList } from '@/api/srm/srmSupplier.js'
  364. import { searchSrmSupplierAddressList } from '@/api/srm/srmSupplier.js'
  365. import Chooselist from '@/views/modules/common/Chooselist_eam'
  366. import ComInspectionRequestDetail from './com_inspectionRequestDetail.vue'
  367. import ComInspectionRequestDetailTab from './com_inspectionRequestDetailTab.vue'
  368. import ComInspectionRequestPoDetailTab from './com_inspectionRequestPoDetailTab.vue'
  369. import ComInspectionResultTab from './com_inspectionResultTab.vue'
  370. import ComInspectionRequestAttachmentTab from './com_inspectionRequestAttachmentTab.vue'
  371. import ComInspectionRequestFeeTab from './com_inspectionRequestFeeTab.vue'
  372. import excel from '@/utils/excel-util.js'
  373. export default {
  374. components: {
  375. Chooselist,
  376. InspectionRequestDetail: ComInspectionRequestDetail,
  377. InspectionRequestDetailTab: ComInspectionRequestDetailTab,
  378. InspectionRequestPoDetailTab: ComInspectionRequestPoDetailTab,
  379. InspectionResultTab: ComInspectionResultTab,
  380. InspectionRequestAttachmentTab: ComInspectionRequestAttachmentTab,
  381. InspectionRequestFeeTab: ComInspectionRequestFeeTab
  382. },
  383. data () {
  384. return {
  385. functionId: this.$route.meta.menuId,
  386. height: 400,
  387. detailHeight: 400,
  388. currentRow: {},
  389. tagNo: '',
  390. searchType: '',
  391. activeTab: 'base',
  392. // 新增弹窗相关数据
  393. addDialogVisible: false,
  394. addFormData: {
  395. requestNo: '',
  396. requestDate: '',
  397. supplierNo: '',
  398. supplierName: '',
  399. inspectAddress: '',
  400. contact: '',
  401. needInspectDate: ''
  402. },
  403. addRules: {
  404. requestDate: [
  405. { required: true, message: '请选择申请日期', trigger: 'change' }
  406. ],
  407. supplierNo: [
  408. { required: true, message: '请选择供应商', trigger: 'change' }
  409. ],
  410. needInspectDate: [
  411. { required: true, message: '请选择建议验货日期', trigger: 'change' }
  412. ]
  413. },
  414. poList: [],
  415. filteredPoList: [],
  416. poSearchKeyword: '',
  417. crdSortOrder: '',
  418. selectedPoList: [],
  419. // 上传相关
  420. uploadDialogVisible: false,
  421. uploadFileName: '',
  422. uploadFile: null,
  423. uploadPreviewList: [],
  424. searchData: {
  425. requestNo: '',
  426. supplierNo: '',
  427. supplierName: '',
  428. status: '',
  429. qcOperator: '',
  430. createBy: '',
  431. requestDateStart: '',
  432. requestDateEnd: '',
  433. needInspectDateStart: '',
  434. needInspectDateEnd: '',
  435. planStartDate: '',
  436. planEndDate: '',
  437. page: 1,
  438. limit: 50
  439. },
  440. pageIndex: 1,
  441. pageSize: 50,
  442. totalPage: 0,
  443. mainDataList: [],
  444. dataListLoading: false,
  445. columnArray1: [
  446. {
  447. userId: this.$store.state.user.name,
  448. functionId: this.functionId,
  449. serialNumber: 'InspectionTable1RequestNo',
  450. tableId: 'InspectionTable1',
  451. tableName: '检验申请单',
  452. columnProp: 'requestNo',
  453. headerAlign: 'center',
  454. align: 'left',
  455. columnLabel: '申请单号',
  456. columnWidth: '120',
  457. columnHidden: false,
  458. columnImage: false,
  459. columnSortable: false,
  460. sortLv: 0,
  461. status: true,
  462. fixed: false
  463. },
  464. {
  465. userId: this.$store.state.user.name,
  466. functionId: this.functionId,
  467. serialNumber: 'InspectionTable1RequestDate',
  468. tableId: 'InspectionTable1',
  469. tableName: '检验申请单',
  470. columnProp: 'requestDate',
  471. headerAlign: 'center',
  472. align: 'center',
  473. columnLabel: '申请日期',
  474. columnWidth: '120',
  475. columnHidden: false,
  476. columnImage: false,
  477. columnSortable: false,
  478. sortLv: 0,
  479. status: true,
  480. fixed: false
  481. },
  482. {
  483. userId: this.$store.state.user.name,
  484. functionId: this.functionId,
  485. serialNumber: 'InspectionTable1PlanStartDate',
  486. tableId: 'InspectionTable1',
  487. tableName: '检验申请单',
  488. columnProp: 'planStartDate',
  489. headerAlign: 'center',
  490. align: 'center',
  491. columnLabel: '计划验货日期',
  492. columnWidth: '120',
  493. columnHidden: false,
  494. columnImage: false,
  495. columnSortable: false,
  496. sortLv: 0,
  497. status: true,
  498. fixed: false
  499. },
  500. {
  501. userId: this.$store.state.user.name,
  502. functionId: this.functionId,
  503. serialNumber: 'InspectionTable1SupplierNo',
  504. tableId: 'InspectionTable1',
  505. tableName: '检验申请单',
  506. columnProp: 'supplierNo',
  507. headerAlign: 'center',
  508. align: 'left',
  509. columnLabel: '供应商编码',
  510. columnWidth: '120',
  511. columnHidden: false,
  512. columnImage: false,
  513. columnSortable: false,
  514. sortLv: 0,
  515. status: true,
  516. fixed: false
  517. },
  518. {
  519. userId: this.$store.state.user.name,
  520. functionId: this.functionId,
  521. serialNumber: 'InspectionTable1SupplierName',
  522. tableId: 'InspectionTable1',
  523. tableName: '检验申请单',
  524. columnProp: 'supplierName',
  525. headerAlign: 'center',
  526. align: 'left',
  527. columnLabel: '供应商名称',
  528. columnWidth: '150',
  529. columnHidden: false,
  530. columnImage: false,
  531. columnSortable: false,
  532. sortLv: 0,
  533. status: true,
  534. fixed: false
  535. },
  536. {
  537. userId: this.$store.state.user.name,
  538. functionId: this.functionId,
  539. serialNumber: 'InspectionTable1CreateBy',
  540. tableId: 'InspectionTable1',
  541. tableName: '检验申请单',
  542. columnProp: 'createBy',
  543. headerAlign: 'center',
  544. align: 'left',
  545. columnLabel: '申请人员',
  546. columnWidth: '100',
  547. columnHidden: false,
  548. columnImage: false,
  549. columnSortable: false,
  550. sortLv: 0,
  551. status: true,
  552. fixed: false
  553. },
  554. {
  555. userId: this.$store.state.user.name,
  556. functionId: this.functionId,
  557. serialNumber: 'InspectionTable1NeedInspectDate',
  558. tableId: 'InspectionTable1',
  559. tableName: '检验申请单',
  560. columnProp: 'needInspectDate',
  561. headerAlign: 'center',
  562. align: 'center',
  563. columnLabel: '建议验货日期',
  564. columnWidth: '120',
  565. columnHidden: false,
  566. columnImage: false,
  567. columnSortable: false,
  568. sortLv: 0,
  569. status: true,
  570. fixed: false
  571. },
  572. {
  573. userId: this.$store.state.user.name,
  574. functionId: this.functionId,
  575. serialNumber: 'InspectionTable1InspectAddress',
  576. tableId: 'InspectionTable1',
  577. tableName: '检验申请单',
  578. columnProp: 'inspectAddress',
  579. headerAlign: 'center',
  580. align: 'left',
  581. columnLabel: '验货地址',
  582. columnWidth: '200',
  583. columnHidden: false,
  584. columnImage: false,
  585. columnSortable: false,
  586. sortLv: 0,
  587. status: true,
  588. fixed: false
  589. },
  590. {
  591. userId: this.$store.state.user.name,
  592. functionId: this.functionId,
  593. serialNumber: 'InspectionTable1Contact',
  594. tableId: 'InspectionTable1',
  595. tableName: '检验申请单',
  596. columnProp: 'inspectContract',
  597. headerAlign: 'center',
  598. align: 'left',
  599. columnLabel: '联系人',
  600. columnWidth: '150',
  601. columnHidden: false,
  602. columnImage: false,
  603. columnSortable: false,
  604. sortLv: 0,
  605. status: true,
  606. fixed: false
  607. },
  608. {
  609. userId: this.$store.state.user.name,
  610. functionId: this.functionId,
  611. serialNumber: 'InspectionTable1Remark',
  612. tableId: 'InspectionTable1',
  613. tableName: '检验申请单',
  614. columnProp: 'remark',
  615. headerAlign: 'center',
  616. align: 'left',
  617. columnLabel: '备注',
  618. columnWidth: '150',
  619. columnHidden: false,
  620. columnImage: false,
  621. columnSortable: false,
  622. sortLv: 0,
  623. status: true,
  624. fixed: false
  625. },
  626. {
  627. userId: this.$store.state.user.name,
  628. functionId: this.functionId,
  629. serialNumber: 'InspectionTable1Status',
  630. tableId: 'InspectionTable1',
  631. tableName: '检验申请单',
  632. columnProp: 'status',
  633. headerAlign: 'center',
  634. align: 'center',
  635. columnLabel: '状态',
  636. columnWidth: '100',
  637. columnHidden: false,
  638. columnImage: false,
  639. columnSortable: false,
  640. sortLv: 0,
  641. status: true,
  642. fixed: false
  643. },
  644. {
  645. userId: this.$store.state.user.name,
  646. functionId: this.functionId,
  647. serialNumber: 'InspectionTable1QcOperator',
  648. tableId: 'InspectionTable1',
  649. tableName: '检验申请单',
  650. columnProp: 'qcOperator',
  651. headerAlign: 'center',
  652. align: 'left',
  653. columnLabel: 'QC人员',
  654. columnWidth: '100',
  655. columnHidden: false,
  656. columnImage: false,
  657. columnSortable: false,
  658. sortLv: 0,
  659. status: true,
  660. fixed: false
  661. }
  662. ]
  663. }
  664. },
  665. mounted () {
  666. this.$nextTick(() => {
  667. // 统一计算主表格和详情页签的高度,确保一致
  668. const calculatedHeight = (window.innerHeight - 220) / 2
  669. this.height = calculatedHeight
  670. this.detailHeight = calculatedHeight
  671. this.getMainData()
  672. })
  673. },
  674. methods: {
  675. // 获取基础数据列表
  676. getBaseList (val, type) {
  677. this.tagNo = val
  678. this.searchType = type || ''
  679. this.$nextTick(() => {
  680. let strVal = ''
  681. let conSql = ''
  682. if (val === 501) {
  683. // 判断是搜索条件还是新增弹窗
  684. if (this.addDialogVisible) {
  685. strVal = this.addFormData.supplierNo || ''
  686. } else {
  687. strVal = this.searchData.supplierNo || ''
  688. }
  689. conSql = " and site = '" + this.$store.state.user.site + "'"
  690. }
  691. if (val === 2016) {
  692. if (type === 'createBy') {
  693. strVal = this.searchData.createBy || ''
  694. } else if (type === 'qcOperator') {
  695. strVal = this.searchData.qcOperator || ''
  696. }
  697. // 防止 Druid 拦截 where 1=1
  698. conSql = " and username <> '' "
  699. }
  700. this.$refs.baseList.init(val, strVal, conSql)
  701. })
  702. },
  703. /* 列表方法的回调 */
  704. getBaseData (val) {
  705. if (this.tagNo === 501) {
  706. // 判断是搜索条件还是新增弹窗
  707. if (this.addDialogVisible) {
  708. // 新增弹窗:SQL返回: SupplierID, SupplierName
  709. const supplierNoVal = val.SupplierID || val.supplierID || val.supplierId || ''
  710. const supplierNameVal = val.SupplierName || val.supplierName || val.supplier_name || ''
  711. this.$set(this.addFormData, 'supplierNo', supplierNoVal)
  712. this.$set(this.addFormData, 'supplierName', supplierNameVal)
  713. console.log('供应商编码赋值:', supplierNoVal, '供应商名称赋值:', supplierNameVal)
  714. this.loadPoList()
  715. // 查询供应商地址获取验货地址和联系人
  716. if (supplierNoVal) {
  717. this.fetchSupplierAddress(supplierNoVal)
  718. }
  719. } else {
  720. // 搜索条件:SQL返回: SupplierID, SupplierName
  721. const supplierNoVal = val.SupplierID || val.supplierID || val.supplierId || ''
  722. this.searchData.supplierNo = supplierNoVal
  723. console.log('供应商编码赋值:', supplierNoVal)
  724. }
  725. }
  726. if (this.tagNo === 2016) {
  727. if (this.searchType === 'createBy') {
  728. this.searchData.createBy = val.username || val.user_display || val.name
  729. } else if (this.searchType === 'qcOperator') {
  730. this.searchData.qcOperator = val.username || val.user_display || val.name
  731. }
  732. }
  733. },
  734. // 查询数据
  735. getMainData () {
  736. this.searchData.limit = this.pageSize
  737. this.searchData.page = this.pageIndex
  738. this.dataListLoading = true
  739. searchInspectionRequestHeaderList(this.searchData).then(({ data }) => {
  740. if (data.code === 0) {
  741. this.mainDataList = data.page.list
  742. // 调试信息:打印第一条数据的 hasModifiedQty 字段
  743. if (this.mainDataList.length > 0) {
  744. console.log('=== 主表格数据调试 ===')
  745. console.log('第一条数据:', this.mainDataList[0])
  746. console.log('hasModifiedQty 值:', this.mainDataList[0].hasModifiedQty)
  747. console.log('=====================')
  748. }
  749. this.pageIndex = data.page.currPage
  750. this.pageSize = data.page.pageSize
  751. this.totalPage = data.page.totalCount
  752. this.$nextTick(() => {
  753. if (this.$refs.mainTable) {
  754. this.$refs.mainTable.clearSelection()
  755. }
  756. })
  757. // 判断是否有数据
  758. if (this.mainDataList.length > 0) {
  759. this.$refs.mainTable.setCurrentRow(this.mainDataList[0])
  760. this.changeData(this.mainDataList[0])
  761. } else {
  762. this.changeData(null)
  763. }
  764. }
  765. this.dataListLoading = false
  766. }).catch(() => {
  767. this.dataListLoading = false
  768. })
  769. },
  770. // 每页数
  771. sizeChangeHandle (val) {
  772. this.pageSize = val
  773. this.pageIndex = 1
  774. this.getMainData()
  775. },
  776. // 当前页
  777. currentChangeHandle (val) {
  778. this.pageIndex = val
  779. this.getMainData()
  780. },
  781. // 页签点击事件
  782. handleTabClick (tab) {
  783. // 每次点击页签都触发对应页签的查询
  784. if (tab.name === 'detail') {
  785. // 验货明细页签 - 组件内部 watch 会自动触发
  786. this.$nextTick(() => {
  787. if (this.$refs.inspectionDetailTab) {
  788. this.$refs.inspectionDetailTab.loadDetailList()
  789. }
  790. })
  791. } else if (tab.name === 'poDetail') {
  792. // 验货关联PO明细页签
  793. this.$nextTick(() => {
  794. if (this.$refs.poDetailTab) {
  795. this.$refs.poDetailTab.loadDetailList()
  796. }
  797. })
  798. } else if (tab.name === 'result') {
  799. // 验货结果页签
  800. this.$nextTick(() => {
  801. if (this.$refs.resultTab) {
  802. this.$refs.resultTab.loadDetailList()
  803. }
  804. })
  805. } else if (tab.name === 'attachment') {
  806. // 附件管理页签 - 组件内部 watch 会自动触发
  807. this.$nextTick(() => {
  808. if (this.$refs.attachmentTab) {
  809. this.$refs.attachmentTab.loadAttachmentTypeList()
  810. }
  811. })
  812. } else if (tab.name === 'fee') {
  813. // 费用明细页签 - 组件内部 watch 会自动触发
  814. this.$nextTick(() => {
  815. if (this.$refs.feeTab) {
  816. this.$refs.feeTab.loadFeeDetailList()
  817. }
  818. })
  819. }
  820. },
  821. // 行点击事件
  822. changeData (row) {
  823. this.currentRow = row ? JSON.parse(JSON.stringify(row)) : {}
  824. },
  825. // 新增验货申请
  826. addInspectionRequest () {
  827. this.addDialogVisible = true
  828. this.resetAddForm()
  829. },
  830. // 关闭新增弹窗
  831. handleCloseAddDialog () {
  832. this.addDialogVisible = false
  833. this.resetAddForm()
  834. },
  835. // 重置表单
  836. resetAddForm () {
  837. const today = new Date()
  838. const year = today.getFullYear()
  839. const month = String(today.getMonth() + 1).padStart(2, '0')
  840. const day = String(today.getDate()).padStart(2, '0')
  841. const todayStr = `${year}-${month}-${day}`
  842. this.addFormData = {
  843. requestNo: '',
  844. requestDate: todayStr,
  845. supplierNo: '',
  846. supplierName: '',
  847. inspectAddress: '',
  848. contact: '',
  849. needInspectDate: ''
  850. }
  851. this.poList = []
  852. this.filteredPoList = []
  853. this.selectedPoList = []
  854. this.poSearchKeyword = ''
  855. this.crdSortOrder = ''
  856. if (this.$refs.addFormData) {
  857. this.$refs.addFormData.clearValidate()
  858. }
  859. },
  860. // 选择供应商
  861. selectSupplier () {
  862. this.tagNo = 501 // 设置tagNo,确保回调时能正确识别
  863. this.$nextTick(() => {
  864. const conSql = " and site = '" + this.$store.state.user.site + "'"
  865. this.$refs.baseList.init(501, this.addFormData.supplierNo || '', conSql)
  866. })
  867. },
  868. // 根据供应商ID查询验货地址信息
  869. fetchSupplierAddress (supplierId) {
  870. const params = {
  871. site: this.$store.state.user.site,
  872. supplierId: supplierId,
  873. addressType: '验货地址',
  874. page: 1,
  875. limit: 1
  876. }
  877. searchSrmSupplierAddressList(params).then(({ data }) => {
  878. if (data && data.code === 0) {
  879. const pageData = data.data || data.page
  880. const addressList = pageData && pageData.list ? pageData.list : pageData || []
  881. if (addressList && addressList.length > 0) {
  882. const addressData = addressList[0]
  883. // 填充验货地址和联系人信息
  884. this.$set(this.addFormData, 'inspectAddress', addressData.address || '')
  885. this.$set(this.addFormData, 'contact', addressData.contact || '')
  886. }
  887. }
  888. }).catch(error => {
  889. console.error('查询供应商地址失败:', error)
  890. })
  891. },
  892. // 加载PO列表(选择供应商后调用)
  893. loadPoList () {
  894. if (!this.addFormData.supplierNo) {
  895. this.$message.warning('请先选择供应商')
  896. return
  897. }
  898. const params = {
  899. supplierNo: this.addFormData.supplierNo,
  900. site: this.$store.state.user.site,
  901. page: 1,
  902. limit: 1000
  903. }
  904. queryPoPage(params).then(({ data }) => {
  905. if (data.code === 0 && data.page) {
  906. this.poList = data.page.list.map(item => ({
  907. ...item,
  908. inspectQty: item.waitInspectQty || 0, // 默认值为未验货数量
  909. shipMethod: item.shipMethod || '',// 运输方式
  910. crd: item.crd ? item.crd.split(' ')[0] : ''
  911. }))
  912. this.filteredPoList = [...this.poList]
  913. } else {
  914. this.poList = []
  915. this.filteredPoList = []
  916. this.$message.info('该供应商暂无可申请验货的PO')
  917. }
  918. }).catch(() => {
  919. this.poList = []
  920. this.filteredPoList = []
  921. this.$message.error('加载PO列表失败')
  922. })
  923. },
  924. // 表格选择变化
  925. handleSelectionChange (selection) {
  926. this.selectedPoList = selection
  927. },
  928. // 筛选PO列表
  929. filterPoList () {
  930. let result = [...this.poList]
  931. if (this.poSearchKeyword) {
  932. const keyword = this.poSearchKeyword.toLowerCase()
  933. result = result.filter(item =>
  934. item.orderRef1 && item.orderRef1.toLowerCase().includes(keyword)
  935. )
  936. }
  937. if (this.crdSortOrder) {
  938. result.sort((a, b) => {
  939. const dateA = a.crd || ''
  940. const dateB = b.crd || ''
  941. if (!dateA && !dateB) return 0
  942. if (!dateA) return this.crdSortOrder === 'asc' ? -1 : 1
  943. if (!dateB) return this.crdSortOrder === 'asc' ? 1 : -1
  944. if (this.crdSortOrder === 'asc') {
  945. return dateA.localeCompare(dateB)
  946. } else {
  947. return dateB.localeCompare(dateA)
  948. }
  949. })
  950. }
  951. this.filteredPoList = result
  952. },
  953. // 切换CRD日期排序
  954. toggleCrdSort () {
  955. if (!this.crdSortOrder) {
  956. this.crdSortOrder = 'asc'
  957. } else if (this.crdSortOrder === 'asc') {
  958. this.crdSortOrder = 'desc'
  959. } else {
  960. this.crdSortOrder = ''
  961. }
  962. this.filterPoList()
  963. },
  964. // 重置筛选
  965. resetPoFilter () {
  966. this.poSearchKeyword = ''
  967. this.crdSortOrder = ''
  968. this.filteredPoList = [...this.poList]
  969. },
  970. // CRD日期排序方法
  971. sortCrdDate (a, b) {
  972. const dateA = a.crd || ''
  973. const dateB = b.crd || ''
  974. if (!dateA && !dateB) return 0
  975. if (!dateA) return -1
  976. if (!dateB) return 1
  977. return dateA.localeCompare(dateB)
  978. },
  979. // 验货数量变化
  980. handleInspectQtyChange (row, value) {
  981. console.log('验货数量变化:', row.orderRef1, value)
  982. // 确保数据被正确更新
  983. this.$set(row, 'inspectQty', value)
  984. },
  985. // 保存
  986. handleSaveAdd () {
  987. console.log('开始保存,当前选择的PO列表:', this.selectedPoList)
  988. console.log('表单数据:', this.addFormData)
  989. this.$refs.addFormData.validate((valid) => {
  990. console.log('表单验证结果:', valid)
  991. if (valid) {
  992. if (this.selectedPoList.length === 0) {
  993. this.$message.warning('请至少选择一条PO明细')
  994. return
  995. }
  996. // 检查验货数量
  997. const hasInvalidQty = this.selectedPoList.some(item => !item.inspectQty || item.inspectQty <= 0)
  998. if (hasInvalidQty) {
  999. this.$message.warning('请填写有效的验货数量')
  1000. return
  1001. }
  1002. // 构建提交数据
  1003. const submitData = {
  1004. requestDate: this.addFormData.requestDate,
  1005. needInspectDate: this.addFormData.needInspectDate,
  1006. supplierNo: this.addFormData.supplierNo,
  1007. inspectAddress: this.addFormData.inspectAddress,
  1008. inspectContract: this.addFormData.contact,
  1009. remark: '',
  1010. items: this.selectedPoList.map(item => ({
  1011. orderNo: item.orderNo || item.order_ref1 || item.orderRef1,
  1012. itemNo: item.itemNo || item.item_no || item.order_ref2 || item.orderRef2,
  1013. partNo: item.partNo,
  1014. orderRef1: item.orderRef1,
  1015. orderRef2: item.orderRef2,
  1016. qty: item.inspectQty,
  1017. shipMethod: item.shipMethod,
  1018. crd: item.crd
  1019. }))
  1020. }
  1021. console.log('提交的数据:', submitData)
  1022. saveInspectionRequest(submitData).then(({ data }) => {
  1023. console.log('保存接口返回:', data)
  1024. if (data.code === 0) {
  1025. this.$message.success('保存成功')
  1026. this.handleCloseAddDialog()
  1027. this.getMainData()
  1028. } else {
  1029. this.$message.error(data.msg || '保存失败')
  1030. }
  1031. }).catch((error) => {
  1032. console.error('保存接口错误:', error)
  1033. this.$message.error('保存失败,请稍后重试')
  1034. })
  1035. } else {
  1036. console.log('表单验证失败')
  1037. this.$message.warning('请填写完整的表单信息')
  1038. }
  1039. })
  1040. },
  1041. // Excel导入
  1042. importExcel () {
  1043. this.uploadDialogVisible = true
  1044. this.uploadFileName = ''
  1045. this.uploadFile = null
  1046. this.uploadPreviewList = []
  1047. },
  1048. // 文件选择变化
  1049. handleFileChange (file) {
  1050. this.uploadFile = file.raw
  1051. this.uploadFileName = file.name
  1052. },
  1053. // 预览上传数据
  1054. previewUpload () {
  1055. if (!this.uploadFile) {
  1056. this.$message.warning('请先选择文件')
  1057. return
  1058. }
  1059. const formData = new FormData()
  1060. formData.append('file', this.uploadFile)
  1061. // 调用后端预览接口
  1062. previewUpload(this.uploadFile).then(({ data }) => {
  1063. if (data && data.code === 0) {
  1064. this.uploadPreviewList = data.data || []
  1065. this.$message.success('文件解析成功,请确认数据后点击保存')
  1066. } else {
  1067. this.$message.error(data.msg || '文件解析失败')
  1068. }
  1069. }).catch((error) => {
  1070. console.error('文件解析失败:', error)
  1071. const errorMsg = (error.response && error.response.data && error.response.data.msg) || error.message || '未知错误'
  1072. this.$message.error('文件解析失败: ' + errorMsg)
  1073. })
  1074. },
  1075. // 确认上传
  1076. confirmUpload () {
  1077. if (this.uploadPreviewList.length === 0) {
  1078. this.$message.warning('没有可保存的数据')
  1079. return
  1080. }
  1081. this.$confirm(`确认保存 ${this.uploadPreviewList.length} 条数据吗?`, '提示', {
  1082. confirmButtonText: '确定',
  1083. cancelButtonText: '取消',
  1084. type: 'warning'
  1085. }).then(() => {
  1086. // 调用后端保存接口
  1087. batchSave(this.uploadFile).then(({ data }) => {
  1088. if (data && data.code === 0) {
  1089. this.$message.success('数据保存成功')
  1090. this.uploadDialogVisible = false
  1091. this.getMainData()
  1092. } else {
  1093. this.$message.error(data.msg || '数据保存失败')
  1094. }
  1095. }).catch((error) => {
  1096. console.error('数据保存失败:', error)
  1097. const errorMsg = (error.response && error.response.data && error.response.data.msg) || error.message || '未知错误'
  1098. this.$message.error('数据保存失败: ' + errorMsg)
  1099. })
  1100. }).catch(() => {})
  1101. },
  1102. // 下载模板
  1103. downloadTemplate () {
  1104. const loading = this.$loading({
  1105. lock: true,
  1106. text: '正在下载模板...',
  1107. spinner: 'el-icon-loading',
  1108. background: 'rgba(0, 0, 0, 0.7)'
  1109. })
  1110. this.$http({
  1111. url: this.$http.adornUrl('/inspection/downloadTemplate'),
  1112. method: 'post',
  1113. responseType: 'blob'
  1114. }).then(response => {
  1115. loading.close()
  1116. // 创建下载文件
  1117. const blob = new Blob([response.data], {
  1118. type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
  1119. })
  1120. const url = window.URL.createObjectURL(blob)
  1121. const link = document.createElement('a')
  1122. link.href = url
  1123. link.download = '验货申请导入模板.xlsx'
  1124. document.body.appendChild(link)
  1125. link.click()
  1126. document.body.removeChild(link)
  1127. window.URL.revokeObjectURL(url)
  1128. this.$message.success('模板下载成功')
  1129. }).catch(error => {
  1130. loading.close()
  1131. console.error('模板下载失败:', error)
  1132. this.$message.error('模板下载失败,请联系管理员')
  1133. })
  1134. },
  1135. // 导出
  1136. exportExcel () {
  1137. console.log('开始导出...')
  1138. // 生成文件名(使用原生 Date)
  1139. const now = new Date()
  1140. const year = now.getFullYear()
  1141. const month = String(now.getMonth() + 1).padStart(2, '0')
  1142. const day = String(now.getDate()).padStart(2, '0')
  1143. const hour = String(now.getHours()).padStart(2, '0')
  1144. const minute = String(now.getMinutes()).padStart(2, '0')
  1145. const second = String(now.getSeconds()).padStart(2, '0')
  1146. const exportName = `检验申请单${year}${month}${day}${hour}${minute}${second}`
  1147. console.log('导出参数:', this.searchData)
  1148. // 获取当前查询条件
  1149. const exportParams = {
  1150. ...this.searchData,
  1151. limit: 99999,
  1152. page: 1
  1153. }
  1154. try {
  1155. excel.exportTable({
  1156. url: 'inspection/searchInspectionRequestHeaderList',
  1157. columnMapping: this.columnArray1,
  1158. mergeSetting: [],
  1159. params: exportParams,
  1160. fileName: exportName + '.xlsx',
  1161. rowFetcher: res => {
  1162. console.log('导出数据响应:', res)
  1163. if (res.data && res.data.page && res.data.page.list) {
  1164. return res.data.page.list
  1165. }
  1166. console.error('响应数据结构异常:', res.data)
  1167. this.$message.error('导出数据格式异常,请查看控制台')
  1168. return []
  1169. },
  1170. columnFormatter: [],
  1171. dropColumns: []
  1172. })
  1173. console.log('导出请求已发送')
  1174. } catch (error) {
  1175. console.error('导出失败:', error)
  1176. this.$message.error('导出失败: ' + error.message)
  1177. }
  1178. },
  1179. // 确认验货申请
  1180. confirmInspection (row) {
  1181. this.$confirm('确定要确认该验货申请吗?', '提示', {
  1182. confirmButtonText: '确定',
  1183. cancelButtonText: '取消',
  1184. type: 'warning'
  1185. }).then(() => {
  1186. confirmInspectionRequest(row.requestNo).then(({ data }) => {
  1187. if (data.code === 0) {
  1188. this.$message.success('确认成功')
  1189. this.getMainData()
  1190. } else {
  1191. this.$message.error(data.msg || '确认失败')
  1192. }
  1193. }).catch((error) => {
  1194. console.error('确认接口错误:', error)
  1195. this.$message.error('确认失败,请稍后重试')
  1196. })
  1197. }).catch(() => {
  1198. this.$message.info('已取消确认')
  1199. })
  1200. },
  1201. // 删除验货申请
  1202. deleteInspectionRequest (row) {
  1203. this.$confirm('确定要删除该验货申请吗?', '提示', {
  1204. confirmButtonText: '确定',
  1205. cancelButtonText: '取消',
  1206. type: 'warning'
  1207. }).then(() => {
  1208. deleteInspectionRequest(row.requestNo).then(({ data }) => {
  1209. if (data.code === 0) {
  1210. this.$message.success('删除成功')
  1211. this.getMainData()
  1212. } else {
  1213. this.$message.error(data.msg || '删除失败')
  1214. }
  1215. }).catch((error) => {
  1216. console.error('删除接口错误:', error)
  1217. this.$message.error('删除失败,请稍后重试')
  1218. })
  1219. }).catch(() => {
  1220. this.$message.info('已取消删除')
  1221. })
  1222. }
  1223. },
  1224. created () {
  1225. this.getMainData()
  1226. }
  1227. }
  1228. </script>
  1229. <style scoped lang="scss">
  1230. .search-form-inline {
  1231. background: #fff;
  1232. padding: 0;
  1233. margin-bottom: 0;
  1234. }
  1235. .search-row {
  1236. display: flex;
  1237. align-items: flex-end;
  1238. flex-wrap: wrap;
  1239. gap: 0;
  1240. margin-bottom: 0;
  1241. }
  1242. .search-item {
  1243. flex: none;
  1244. margin-bottom: 0;
  1245. margin-right: 12px;
  1246. }
  1247. /* 使用 Element UI 默认字体大小,不再覆盖 */
  1248. .search-item /deep/ .el-form-item__label {
  1249. padding-bottom: 0;
  1250. line-height: 1.2;
  1251. }
  1252. .search-btn-item {
  1253. flex: none;
  1254. margin-bottom: 0;
  1255. margin-right: 0;
  1256. }
  1257. .search-item /deep/ .el-form-item__content {
  1258. line-height: normal;
  1259. }
  1260. .date-range {
  1261. display: flex;
  1262. align-items: center;
  1263. }
  1264. .split {
  1265. padding: 0 6px;
  1266. color: #606266;
  1267. font-size: 13px;
  1268. }
  1269. /deep/ .customer-tab .el-tabs__content {
  1270. padding: 5px !important;
  1271. }
  1272. .form-section {
  1273. margin-bottom: 15px;
  1274. padding-bottom: 15px;
  1275. border-bottom: 1px solid #ebeef5;
  1276. padding: 5px 10px;
  1277. }
  1278. .add-dialog-form /deep/ .el-form-item {
  1279. margin-bottom: 10px;
  1280. }
  1281. .add-dialog-form /deep/ .el-form-item__label {
  1282. text-align: left;
  1283. float: none;
  1284. display: block;
  1285. padding: 0 0 5px 0;
  1286. line-height: 1;
  1287. font-size: 13px;
  1288. }
  1289. .add-dialog-form /deep/ .el-form-item__content {
  1290. margin-left: 0 !important;
  1291. }
  1292. .po-section {
  1293. .section-title {
  1294. font-size: 14px;
  1295. font-weight: bold;
  1296. color: #303133;
  1297. margin-bottom: 8px;
  1298. }
  1299. .section-desc {
  1300. font-size: 12px;
  1301. color: #909399;
  1302. margin-bottom: 10px;
  1303. }
  1304. }
  1305. .dialog-footer {
  1306. text-align: center;
  1307. }
  1308. /deep/ .el-input-number .el-input__inner {
  1309. text-align: right !important;
  1310. padding-right: 32px !important;
  1311. padding-left: 8px !important;
  1312. box-sizing: border-box;
  1313. }
  1314. /deep/ .el-input .el-input--mini {
  1315. line-height: 20px;
  1316. }
  1317. /deep/ .el-input-number .el-input--mini {
  1318. line-height: 20px;
  1319. }
  1320. /* PO表格输入控件防遮挡 */
  1321. .po-section {
  1322. /deep/ .el-table .cell {
  1323. overflow: visible !important;
  1324. padding-left: 4px;
  1325. padding-right: 4px;
  1326. }
  1327. /deep/ .el-input,
  1328. /deep/ .el-select {
  1329. width: 100% !important;
  1330. }
  1331. /deep/ .el-input-number .el-input__inner {
  1332. padding-left: 8px !important;
  1333. padding-right: 35px !important;
  1334. text-align: right;
  1335. }
  1336. /deep/ .el-input-number {
  1337. width: 120px !important;
  1338. min-width: 120px !important;
  1339. }
  1340. /deep/ .el-select .el-input__inner {
  1341. padding-right: 25px !important;
  1342. }
  1343. }
  1344. // 数字输入框按钮样式修复
  1345. /deep/ .el-input-number {
  1346. position: relative;
  1347. .el-input-number__increase,
  1348. .el-input-number__decrease {
  1349. width: 28px;
  1350. height: 50%;
  1351. position: absolute;
  1352. right: 0;
  1353. display: flex;
  1354. align-items: center;
  1355. justify-content: center;
  1356. background-color: #f5f7fa;
  1357. border: none;
  1358. cursor: pointer;
  1359. transition: all 0.2s;
  1360. font-size: 12px;
  1361. &:hover {
  1362. background-color: #ecf5ff;
  1363. color: #409eff;
  1364. }
  1365. &:active {
  1366. background-color: #d9e1f0;
  1367. }
  1368. }
  1369. .el-input-number__increase {
  1370. top: 0;
  1371. bottom: auto;
  1372. border-bottom: 1px solid #dcdfe6;
  1373. border-top-right-radius: 4px;
  1374. }
  1375. .el-input-number__decrease {
  1376. top: auto;
  1377. bottom: 0;
  1378. border-bottom-right-radius: 4px;
  1379. }
  1380. // 确保输入框右边留出按钮空间
  1381. .el-input__inner {
  1382. padding-right: 32px !important;
  1383. }
  1384. }
  1385. // 数字输入框按钮样式修复
  1386. /deep/ .el-input-number {
  1387. position: relative;
  1388. .el-input-number__increase,
  1389. .el-input-number__decrease {
  1390. width: 28px;
  1391. height: 50%;
  1392. position: absolute;
  1393. right: 0;
  1394. display: flex;
  1395. align-items: center;
  1396. justify-content: center;
  1397. background-color: #f5f7fa;
  1398. border: none;
  1399. cursor: pointer;
  1400. transition: all 0.2s;
  1401. font-size: 12px;
  1402. &:hover {
  1403. background-color: #ecf5ff;
  1404. color: #409eff;
  1405. }
  1406. &:active {
  1407. background-color: #d9e1f0;
  1408. }
  1409. }
  1410. .el-input-number__increase {
  1411. top: 0;
  1412. bottom: auto;
  1413. border-bottom: 1px solid #dcdfe6;
  1414. border-top-right-radius: 4px;
  1415. }
  1416. .el-input-number__decrease {
  1417. top: auto;
  1418. bottom: 0;
  1419. border-bottom-right-radius: 4px;
  1420. }
  1421. .el-input__inner {
  1422. padding-right: 32px !important;
  1423. }
  1424. }
  1425. /deep/ .el-input-number--mini {
  1426. .el-input-number__increase,
  1427. .el-input-number__decrease {
  1428. width: 24px;
  1429. font-size: 10px;
  1430. }
  1431. .el-input__inner {
  1432. padding-right: 28px !important;
  1433. }
  1434. }
  1435. .po-section {
  1436. /deep/ .el-date-editor.el-input,
  1437. /deep/ .el-date-editor.el-input__inner {
  1438. width: 100%;
  1439. }
  1440. /deep/ .el-date-editor .el-input__inner {
  1441. height: 28px;
  1442. line-height: 28px;
  1443. padding-left: 10px;
  1444. padding-right: 10px;
  1445. font-size: 12px;
  1446. }
  1447. /deep/ .el-date-editor .el-input__prefix {
  1448. display: none;
  1449. }
  1450. /deep/ .el-date-editor .el-input__suffix {
  1451. right: 5px;
  1452. }
  1453. }
  1454. .choose-label {
  1455. color: #2ec7c9;
  1456. cursor: pointer;
  1457. font-weight: 500;
  1458. }
  1459. .choose-label:hover {
  1460. text-decoration: underline;
  1461. }
  1462. </style>