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.

1593 lines
52 KiB

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