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.

1365 lines
48 KiB

11 months ago
4 months ago
4 months ago
11 months ago
4 months ago
4 months ago
4 months ago
11 months ago
4 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
11 months ago
11 months ago
10 months ago
11 months ago
7 months ago
11 months ago
4 months ago
11 months ago
4 months ago
4 months ago
4 months ago
4 months ago
11 months ago
4 months ago
4 months ago
4 months ago
11 months ago
11 months ago
10 months ago
11 months ago
10 months ago
10 months ago
11 months ago
4 months ago
11 months ago
4 months ago
11 months ago
11 months ago
11 months ago
11 months ago
4 months ago
11 months ago
11 months ago
4 months ago
11 months ago
11 months ago
10 months ago
7 months ago
7 months ago
7 months ago
11 months ago
7 months ago
11 months ago
4 months ago
4 months ago
11 months ago
11 months ago
11 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
11 months ago
7 months ago
4 months ago
7 months ago
7 months ago
  1. <template>
  2. <div class="customer-css">
  3. <el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible"
  4. :width="showPreview ? '1200px' : '600px'" class="customer-dialog" >
  5. <el-form label-position="top">
  6. <el-row :gutter="16">
  7. <el-col :span="12">
  8. <el-form-item label="BU">
  9. <el-select v-model="pageData.buNo" placeholder="请选择" style="width: 100%">
  10. <el-option v-for="i in buList" :key="i.buNo" :label="i.buDesc" :value="i.buNo"></el-option>
  11. </el-select>
  12. </el-form-item>
  13. </el-col>
  14. <el-col :span="12">
  15. <el-form-item label=" ">
  16. <el-button type="primary" @click="downloadFile()">下载文件模板</el-button>
  17. </el-form-item>
  18. </el-col>
  19. <el-col :span="24" style="margin-top: 10px">
  20. <el-upload class="customer-upload" drag action="javascript:void(0);" ref="uploadFile" :limit="1" accept=".xlsx,.xls"
  21. :before-upload="beforeUploadHandle" :on-change="onChange" :auto-upload="false" style="text-align: left;">
  22. <i class="el-icon-upload"></i>
  23. <div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
  24. </el-upload>
  25. </el-col>
  26. </el-row>
  27. </el-form>
  28. <!-- 预览数据表格 -->
  29. <!-- 加载状态 -->
  30. <div v-if="previewLoading" style="margin-top: 20px; text-align: center; padding: 40px;">
  31. <i class="el-icon-loading" style="font-size: 24px; color: #409EFF;"></i>
  32. <p style="margin-top: 10px; color: #666;">正在解析文件请稍候...</p>
  33. </div>
  34. <div v-if="showPreview" style="margin-top: 20px; margin-bottom: 30px;">
  35. <h4>文件预览 - 按发票号汇总 ({{ previewData.length }}个发票)</h4>
  36. <el-table :data="previewData" border style="width: 100%" max-height="400" :show-overflow-tooltip="true" class="delClass">
  37. <el-table-column label="操作" width="40" fixed="left">
  38. <template slot-scope="scope">
  39. <a type="text" size="small" style="color: red" @click="deleteRow(scope.$index, scope.row)">删除</a>
  40. </template>
  41. </el-table-column>
  42. <el-table-column prop="cmcInvoice" label="发票号" width="120" fixed="left">
  43. <template slot-scope="scope">
  44. <span :style="scope.row.exists ? 'color: red; font-weight: bold;' : ''">
  45. {{ scope.row.cmcInvoice }}
  46. <el-tag v-if="scope.row.exists" type="danger" size="mini">已存在</el-tag>
  47. </span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column prop="destination" label="目的地" width="100"></el-table-column>
  51. <el-table-column label="客户模板" width="150">
  52. <template slot-scope="scope">
  53. <el-input
  54. v-model="scope.row.selectedTemplate"
  55. placeholder="请选择客户模板"
  56. @dblclick.native="selectTemplateForRow(scope.row)"
  57. size="small"
  58. style="cursor: pointer;">
  59. </el-input>
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="客户" width="150">
  63. <template slot-scope="scope">
  64. <el-input
  65. v-model="scope.row.selectedCustomer"
  66. placeholder="请选择客户"
  67. @dblclick.native="selectCustomerForRow(scope.row)"
  68. size="small"
  69. style="cursor: pointer;"
  70. readonly>
  71. <i slot="suffix" class="el-icon-edit" style="cursor: pointer;" @click.stop="openEditDialog(scope.row, 'selectedCustomer', '客户', '编辑客户信息')"></i>
  72. </el-input>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="客户地址" width="160">
  76. <template slot-scope="scope">
  77. <el-input
  78. v-model="scope.row.selectedLocalAddress"
  79. placeholder="请选择客户地址"
  80. @dblclick.native="selectLocalAddressForRow(scope.row)"
  81. size="small"
  82. style="cursor: pointer;"
  83. readonly>
  84. <i slot="suffix" class="el-icon-edit" style="cursor: pointer;" @click.stop="openEditDialog(scope.row, 'selectedLocalAddress', '客户地址', '编辑客户地址')"></i>
  85. </el-input>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="收货单位" width="150">
  89. <template slot-scope="scope">
  90. <el-input
  91. v-model="scope.row.selectedOverseasShipper"
  92. placeholder="请选择收货单位"
  93. @dblclick.native="selectOverseasShipperForRow(scope.row)"
  94. size="small"
  95. style="cursor: pointer;"
  96. readonly>
  97. <i slot="suffix" class="el-icon-edit" style="cursor: pointer;" @click.stop="openEditDialog(scope.row, 'selectedOverseasShipper', '收货单位', '编辑收货单位')"></i>
  98. </el-input>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="收货单位地址" width="160">
  102. <template slot-scope="scope">
  103. <el-input
  104. v-model="scope.row.selectedOverseasAddress"
  105. placeholder="请选择收货单位地址"
  106. @dblclick.native="selectOverseasAddressForRow(scope.row)"
  107. size="small"
  108. style="cursor: pointer;"
  109. readonly>
  110. <i slot="suffix" class="el-icon-edit" style="cursor: pointer;" @click.stop="openEditDialog(scope.row, 'selectedOverseasAddress', '收货单位地址', '编辑收货单位地址')"></i>
  111. </el-input>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="运抵国" width="80">
  115. <template slot-scope="scope">
  116. <el-input
  117. v-model="scope.row.selectedCnative"
  118. placeholder="运抵国"
  119. size="small"
  120. style="cursor: pointer;"
  121. readonly>
  122. <i slot="suffix" class="el-icon-edit" style="cursor: pointer;" @click.stop="openEditDialog(scope.row, 'selectedCnative', '运抵国', '编辑运抵国')"></i>
  123. </el-input>
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="贸易国" min-width="80">
  127. <template slot-scope="scope">
  128. <el-input
  129. v-model="scope.row.selectedSalesArea"
  130. placeholder="贸易国"
  131. size="small"
  132. style="cursor: pointer;"
  133. readonly>
  134. <i slot="suffix" class="el-icon-edit" style="cursor: pointer;" @click.stop="openEditDialog(scope.row, 'selectedSalesArea', '贸易国', '编辑贸易国')"></i>
  135. </el-input>
  136. </template>
  137. </el-table-column>
  138. </el-table>
  139. </div>
  140. <span slot="footer" class="dialog-footer" style="margin-top: 10px">
  141. <el-button v-if="!showPreview" type="primary" @click="saveUploadFile">保存</el-button>
  142. <el-button v-if="showPreview" type="primary" @click="saveFromPreview">确认保存</el-button>
  143. <el-button v-if="showPreview" @click="cancelPreview">取消预览</el-button>
  144. <el-button v-if="!showPreview" type="primary" @click="closeDialog">关闭</el-button>
  145. </span>
  146. </el-dialog>
  147. <el-dialog :title="currentRow ? `为发票号 ${currentRow.cmcInvoice} 选择客户模板` : '客户模板'"
  148. @close="templateFlag = false; currentRow = null" :visible.sync="templateFlag" width="1200px" v-drag>
  149. <el-table
  150. :height="400"
  151. :data="customerTemplateList"
  152. stripe
  153. highlight-current-row
  154. border class="delClass"
  155. @row-dblclick="rowDblclickTemplate"
  156. style="width: 100%;">
  157. <el-table-column
  158. prop="template_name"
  159. header-align="center"
  160. align="left"
  161. width="150"
  162. label="模板名称">
  163. </el-table-column>
  164. <el-table-column
  165. prop="ccusname"
  166. header-align="center"
  167. align="left"
  168. width="200"
  169. label="客户名称">
  170. </el-table-column>
  171. <el-table-column
  172. prop="localShipAddress"
  173. header-align="center"
  174. align="left"
  175. width="300"
  176. label="客户地址">
  177. </el-table-column>
  178. <el-table-column
  179. prop="overseasShipper"
  180. header-align="center"
  181. align="left"
  182. width="200"
  183. label="收货单位">
  184. </el-table-column>
  185. <el-table-column
  186. prop="overseasAddress"
  187. header-align="center"
  188. align="left"
  189. width="300"
  190. label="收货地址">
  191. </el-table-column>
  192. <el-table-column
  193. prop="salesArea"
  194. header-align="center"
  195. align="left"
  196. width="80"
  197. label="贸易国">
  198. </el-table-column>
  199. <el-table-column
  200. prop="cnative"
  201. header-align="center"
  202. align="left"
  203. width="80"
  204. label="运抵国">
  205. </el-table-column>
  206. </el-table>
  207. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  208. <el-button @click="templateFlag = false; currentRow = null">关闭</el-button>
  209. </el-footer>
  210. </el-dialog>
  211. <el-dialog :title="currentRow ? `为发票号 ${currentRow.cmcInvoice} 选择客户` : '客户'" @close="closeCustomDialog" :visible.sync="customFlag" width="500px" v-drag>
  212. <el-form inline="inline" label-position="top" :model="customSearchData" style="margin-left: 7px;margin-top: -5px;">
  213. <el-form-item label="客户名称">
  214. <el-input v-model="customSearchData.ccusname" clearable style="width: 150px"></el-input>
  215. </el-form-item>
  216. <el-form-item label=" ">
  217. <el-button type="primary" style="padding: 3px 12px" @click="getCustomerList()">查询</el-button>
  218. </el-form-item>
  219. </el-form>
  220. <el-table
  221. :height="400"
  222. :data="customerList"
  223. stripe
  224. highlight-current-row
  225. border
  226. @row-dblclick="rowDblclick"
  227. style="width: 100%;">
  228. <el-table-column
  229. prop="ccusname"
  230. header-align="center"
  231. align="left"
  232. width="350"
  233. label="客户名称">
  234. </el-table-column>
  235. <el-table-column
  236. prop="country"
  237. header-align="center"
  238. align="left"
  239. label="贸易国">
  240. </el-table-column>
  241. </el-table>
  242. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  243. <el-button @click="customFlag = false">关闭</el-button>
  244. </el-footer>
  245. </el-dialog>
  246. <el-dialog :title="currentRow ? `为发票号 ${currentRow.cmcInvoice} 选择客户地址` : '客户地址'" @close="localShipAddressFlag = false; currentRow = null" :visible.sync="localShipAddressFlag" width="500px" v-drag>
  247. <el-table
  248. :height="400"
  249. :data="customerAddrs"
  250. stripe
  251. highlight-current-row
  252. border
  253. @row-dblclick="rowDblclick2"
  254. style="width: 100%;">
  255. <el-table-column
  256. prop="cDeliverAdd"
  257. header-align="center"
  258. align="left"
  259. label="客户地址">
  260. </el-table-column>
  261. </el-table>
  262. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  263. <el-button @click="localShipAddressFlag = false; currentRow = null">关闭</el-button>
  264. </el-footer>
  265. </el-dialog>
  266. <el-dialog :title="currentRow ? `为发票号 ${currentRow.cmcInvoice} 选择收货单位地址` : '收货单位地址'" @close="overseasAddressFlag = false; currentRow = null" :visible.sync="overseasAddressFlag" width="500px" v-drag>
  267. <el-table
  268. :height="400"
  269. :data="customerAddrs"
  270. stripe
  271. highlight-current-row
  272. border
  273. @row-dblclick="rowDblclick3"
  274. style="width: 100%;">
  275. <el-table-column
  276. prop="cDeliverAdd"
  277. header-align="center"
  278. align="left"
  279. label="收货单位地址">
  280. </el-table-column>
  281. </el-table>
  282. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  283. <el-button @click="overseasAddressFlag = false; currentRow = null">关闭</el-button>
  284. </el-footer>
  285. </el-dialog>
  286. <el-dialog :title="currentRow ? `为发票号 ${currentRow.cmcInvoice} 选择收货单位` : '收货单位'" @close="overseasShipperFlag = false; currentRow = null" :visible.sync="overseasShipperFlag" width="500px" v-drag>
  287. <el-table
  288. :height="400"
  289. :data="customerAddrs"
  290. stripe
  291. highlight-current-row
  292. border
  293. @row-dblclick="rowDblclick4"
  294. style="width: 100%;">
  295. <el-table-column
  296. prop="cDeliverUnit"
  297. header-align="left"
  298. align="left"
  299. width="350"
  300. label="收货单位">
  301. </el-table-column>
  302. <el-table-column
  303. prop="deliverycountry"
  304. header-align="center"
  305. align="left"
  306. label="运抵国">
  307. </el-table-column>
  308. </el-table>
  309. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  310. <el-button @click="overseasShipperFlag = false; currentRow = null">关闭</el-button>
  311. </el-footer>
  312. </el-dialog>
  313. <!-- 大输入框编辑弹窗 -->
  314. <el-dialog
  315. :title="editDialog.title"
  316. :visible.sync="editDialog.visible"
  317. width="600px"
  318. class="edit-dialog"
  319. @close="closeEditDialog">
  320. <div class="edit-dialog-tip">
  321. <i class="el-icon-info"></i> 提示您可以在此编辑较长的文本内容支持多行输入
  322. </div>
  323. <el-form label-position="top" style="margin-bottom: 120px">
  324. <el-form-item :label="editDialog.label">
  325. <el-input ref="editTextarea"
  326. v-model="editDialog.value"
  327. type="textarea"
  328. :rows="6"
  329. placeholder="请输入内容,支持多行文本..."
  330. maxlength="500"
  331. show-word-limit
  332. class="edit-textarea">
  333. </el-input>
  334. </el-form-item>
  335. </el-form>
  336. <span slot="footer" class="dialog-footer">
  337. <el-button @click="closeEditDialog">取消</el-button>
  338. <el-button type="primary" @click="confirmEdit">保存</el-button>
  339. </span>
  340. </el-dialog>
  341. </div>
  342. </template>
  343. <script>
  344. import {queryFileId} from "@/api/qc/qc.js"
  345. import {previewExcel,saveEcssCoDelNotifyByExcel,getCustomerList,getCustomers,getCustomerAdd,getCustomerTemplateList} from '@/api/ecss/ecss.js'
  346. import {downLoadObjectFile} from '@/api/eam/eam_object_list.js'
  347. import {getBuList}from '@/api/factory/site.js'
  348. export default {
  349. name: 'bomComponentUpload',
  350. data() {
  351. return {
  352. buList: [],
  353. titleCon: '文件导入',
  354. visible: false,
  355. fileList: [],
  356. pageData: {
  357. site: '',
  358. buNo: '',
  359. createBy: this.$store.state.user.name,
  360. customerName:'',
  361. localShipAddress:'',
  362. overseasShipper:'',
  363. overseasAddress:'',
  364. cnative:'',
  365. salesArea:'',
  366. },
  367. previewData: [], // 预览数据
  368. showPreview: false, // 是否显示预览
  369. selectedFile: null, // 选择的文件
  370. previewLoading: false, // 预览加载状态
  371. deletedInvoices: [], // 被删除的发票号列表
  372. customSearchData: {},
  373. customerList : [],//所有客户
  374. customerAddrs : [],//地址
  375. customerPersons : [],//联系人
  376. customerMap:new Map,
  377. customFlag:false,
  378. localShipAddressFlag:false,
  379. overseasShipperFlag:false,
  380. overseasAddressFlag:false,
  381. templateFlag:false,
  382. customerTemplateList: [],//客户模板列表
  383. cacheKey: '', // 缓存键
  384. cacheTimer: null, // 缓存定时器
  385. currentRow: null, // 当前编辑的行
  386. cachedFileInfo: null, // 缓存的文件信息
  387. cachedFileList: [], // 缓存的文件列表
  388. // 大输入框编辑弹窗相关数据
  389. editDialog: {
  390. visible: false,
  391. title: '',
  392. label: '',
  393. value: '',
  394. fieldName: '', // 要编辑的字段名
  395. row: null // 当前编辑的行数据
  396. }
  397. }
  398. },
  399. watch: {
  400. // 深度监听pageData的变化,自动保存到缓存
  401. pageData: {
  402. handler: function(newVal, oldVal) {
  403. // 只有在组件已初始化且对话框可见时才保存缓存
  404. if (this.visible && this.cacheKey) {
  405. this.saveToCache();
  406. }
  407. },
  408. deep: true
  409. },
  410. // 深度监听previewData的变化,保存用户的编辑
  411. previewData: {
  412. handler: function(newVal, oldVal) {
  413. // 只有在组件已初始化且对话框可见时才保存缓存
  414. if (this.visible && this.cacheKey && newVal && newVal.length > 0) {
  415. this.saveToCache();
  416. }
  417. },
  418. deep: true
  419. }
  420. },
  421. beforeDestroy() {
  422. // 组件销毁前清理定时器
  423. if (this.cacheTimer) {
  424. clearTimeout(this.cacheTimer);
  425. }
  426. },
  427. methods: {
  428. // 生成缓存键
  429. generateCacheKey() {
  430. const userId = this.$store.state.user.id || this.$store.state.user.name;
  431. return `ecss_del_upload_cache_${userId}`;
  432. },
  433. // 保存数据到缓存(防抖处理)
  434. saveToCache() {
  435. // 清除之前的定时器
  436. if (this.cacheTimer) {
  437. clearTimeout(this.cacheTimer);
  438. }
  439. // 设置新的定时器,500ms后执行保存
  440. this.cacheTimer = setTimeout(() => {
  441. try {
  442. const cacheData = {
  443. pageData: {
  444. buNo: this.pageData.buNo,
  445. customerName: this.pageData.customerName,
  446. localShipAddress: this.pageData.localShipAddress,
  447. overseasShipper: this.pageData.overseasShipper,
  448. overseasAddress: this.pageData.overseasAddress,
  449. cnative: this.pageData.cnative,
  450. salesArea: this.pageData.salesArea,
  451. },
  452. // 保存文件和预览相关数据
  453. fileInfo: this.selectedFile ? {
  454. name: this.selectedFile.name,
  455. size: this.selectedFile.size,
  456. lastModified: this.selectedFile.lastModified
  457. } : null,
  458. showPreview: this.showPreview,
  459. previewData: this.previewData,
  460. deletedInvoices: this.deletedInvoices,
  461. fileList: this.fileList.map(file => ({
  462. name: file.name,
  463. size: file.size,
  464. lastModified: file.lastModified,
  465. uid: file.uid
  466. }))
  467. };
  468. localStorage.setItem(this.cacheKey, JSON.stringify(cacheData));
  469. } catch (error) {
  470. console.warn('保存缓存失败:', error);
  471. }
  472. }, 500);
  473. },
  474. // 从缓存加载数据
  475. loadFromCache() {
  476. try {
  477. const cachedData = localStorage.getItem(this.cacheKey);
  478. if (cachedData) {
  479. const parsedData = JSON.parse(cachedData);
  480. if (parsedData.pageData) {
  481. // 恢复基础表单数据
  482. Object.assign(this.pageData, parsedData.pageData);
  483. // 恢复预览数据和文件状态
  484. if (parsedData.previewData && parsedData.previewData.length > 0) {
  485. this.previewData = parsedData.previewData;
  486. this.showPreview = parsedData.showPreview || false;
  487. }
  488. // 恢复删除的发票号列表
  489. if (parsedData.deletedInvoices) {
  490. this.deletedInvoices = parsedData.deletedInvoices;
  491. }
  492. // 恢复文件列表信息(用于界面显示)
  493. if (parsedData.fileList && parsedData.fileList.length > 0) {
  494. // 记录缓存的文件信息,用于后续比对
  495. this.cachedFileInfo = parsedData.fileInfo;
  496. this.cachedFileList = parsedData.fileList;
  497. }
  498. return true;
  499. }
  500. }
  501. } catch (error) {
  502. console.warn('加载缓存失败:', error);
  503. }
  504. return false;
  505. },
  506. // 清除缓存
  507. clearCache() {
  508. try {
  509. localStorage.removeItem(this.cacheKey);
  510. } catch (error) {
  511. console.warn('清除缓存失败:', error);
  512. }
  513. },
  514. // 检查并恢复文件状态
  515. checkAndRestoreFileState() {
  516. // 检查上传组件中是否有文件
  517. const uploadFiles = this.$refs.uploadFile.uploadFiles;
  518. if (this.cachedFileInfo && this.cachedFileList.length > 0) {
  519. // 如果有缓存的文件信息,检查当前上传组件中的文件
  520. if (uploadFiles && uploadFiles.length > 0) {
  521. const currentFile = uploadFiles[0];
  522. const isSameFile = currentFile.name === this.cachedFileInfo.name &&
  523. currentFile.size === this.cachedFileInfo.size &&
  524. currentFile.lastModified === this.cachedFileInfo.lastModified;
  525. if (isSameFile) {
  526. // 是同一个文件,恢复文件相关状态
  527. this.selectedFile = currentFile;
  528. this.fileList = [currentFile];
  529. console.log('恢复文件状态:', currentFile.name);
  530. } else {
  531. // 文件不匹配,清除预览状态但保留表单数据
  532. this.showPreview = false;
  533. this.previewData = [];
  534. this.selectedFile = null;
  535. this.fileList = [];
  536. console.log('文件不匹配,清除预览状态');
  537. }
  538. } else {
  539. // 没有文件但有缓存,说明文件可能被清除了
  540. this.showPreview = false;
  541. this.previewData = [];
  542. this.selectedFile = null;
  543. this.fileList = [];
  544. console.log('没有找到文件,清除预览状态');
  545. }
  546. }
  547. // 保存当前状态
  548. this.saveToCache();
  549. },
  550. // 初始化组件的参数
  551. init () {
  552. // 初始化缓存键,但不清除任何现有数据
  553. this.cacheKey = this.generateCacheKey();
  554. this.previewLoading = false
  555. let tempData = {
  556. username: this.$store.state.user.name,
  557. }
  558. getBuList(tempData).then(({data}) => {
  559. if (data.code === 0) {
  560. this.buList = data.row2
  561. if(data.row2.length===1){
  562. this.pageData.buNo=data.row2[0].buNo
  563. }
  564. }
  565. // 在获取BU列表后尝试加载缓存
  566. this.loadFromCache();
  567. // 检查并恢复文件状态
  568. this.$nextTick(() => {
  569. this.checkAndRestoreFileState();
  570. });
  571. })
  572. getCustomerList({}).then(({data}) => {
  573. //区分请求成功和失败的状况
  574. if (data && data.code === 0) {
  575. this.customerList=data.rows
  576. }
  577. });
  578. // 只有在完全没有缓存数据时才初始化为空
  579. const hasCache = this.loadFromCache();
  580. if (!hasCache) {
  581. this.fileList = []
  582. this.previewData = []
  583. this.showPreview = false
  584. this.selectedFile = null
  585. this.deletedInvoices = []
  586. this.pageData.customerName=''
  587. this.pageData.cnative=''
  588. this.pageData.localShipAddress='',
  589. this.pageData.overseasShipper='',
  590. this.pageData.overseasAddress='',
  591. this.pageData.salesArea=''
  592. }
  593. this.customerPersons=[]
  594. this.customerAddrs=[]
  595. // 打开页面
  596. this.visible = true
  597. },
  598. getCustomerList(){
  599. getCustomerList(this.customSearchData).then(({data}) => {
  600. //区分请求成功和失败的状况
  601. if (data && data.code === 0) {
  602. this.customerList=data.rows
  603. }
  604. });
  605. },
  606. getCusPersons(){
  607. let cusData = {ccusname: this.pageData.customerName}
  608. getCustomers(cusData).then(({data}) => {
  609. //区分请求成功和失败的状况
  610. if (data && data.code === 0) {
  611. this.customerPersons=data.rows
  612. this.customerPersons.forEach(o => {
  613. if (!this.customerMap.has(o.ccontactname)) {
  614. this.customerMap.set(o.ccontactname, o.cnative);
  615. }
  616. });
  617. }
  618. });
  619. getCustomerAdd(cusData).then(({data}) => {
  620. //区分请求成功和失败的状况
  621. if (data && data.code === 0) {
  622. this.customerAddrs=data.rows
  623. }
  624. });
  625. },
  626. setCnative(){
  627. this.pageData.cnative=this.customerMap.get(this.pageData.overseasShipper)
  628. },
  629. closeCustomDialog () {
  630. this.customFlag = false
  631. this.currentRow = null
  632. },
  633. rowDblclickTemplate(row) {
  634. console.log(row)
  635. if (this.currentRow) {
  636. // 使用模板设置当前行的所有信息
  637. this.currentRow.selectedTemplate = row.template_name
  638. this.currentRow.selectedCustomer = row.ccusname || ''
  639. this.currentRow.selectedLocalAddress = row.localShipAddress || ''
  640. this.currentRow.selectedOverseasShipper = row.overseasShipper || ''
  641. this.currentRow.selectedOverseasAddress = row.overseasAddress || ''
  642. this.currentRow.selectedCnative = row.cnative || ''
  643. this.currentRow.selectedSalesArea = row.salesArea || ''
  644. // 如果模板中有客户信息,自动获取该客户的地址和收货单位信息
  645. if (row.ccusname) {
  646. this.getCusPersonsForRow(row.ccusname)
  647. }
  648. }
  649. this.templateFlag = false
  650. this.currentRow = null
  651. },
  652. rowDblclick (row) {
  653. if (this.currentRow) {
  654. // 预览模式下,为当前行设置客户信息
  655. this.currentRow.selectedCustomer = row.ccusname
  656. this.currentRow.selectedSalesArea = row.country
  657. this.currentRow.selectedLocalAddress = ''
  658. this.currentRow.selectedOverseasShipper = ''
  659. this.currentRow.selectedOverseasAddress = ''
  660. this.currentRow.selectedCnative = ''
  661. this.getCusPersonsForRow(row.ccusname)
  662. } else {
  663. // 普通模式下,设置全局信息
  664. this.pageData.customerName=row.ccusname
  665. this.pageData.cnative='',
  666. this.pageData.localShipAddress='',
  667. this.pageData.overseasShipper='',
  668. this.pageData.overseasAddress='',
  669. this.pageData.salesArea = row.country
  670. this.getCusPersons()
  671. }
  672. this.customFlag = false
  673. },
  674. rowDblclick2 (row) {
  675. if (this.currentRow) {
  676. this.currentRow.selectedLocalAddress = row.cDeliverAdd
  677. } else {
  678. this.pageData.localShipAddress = row.cDeliverAdd
  679. }
  680. this.localShipAddressFlag = false
  681. this.currentRow = null
  682. },
  683. rowDblclick3 (row) {
  684. if (this.currentRow) {
  685. this.currentRow.selectedOverseasAddress = row.cDeliverAdd
  686. } else {
  687. this.pageData.overseasAddress = row.cDeliverAdd
  688. }
  689. this.overseasAddressFlag = false
  690. this.currentRow = null
  691. },
  692. rowDblclick4 (row) {
  693. if (this.currentRow) {
  694. this.currentRow.selectedOverseasShipper = row.cDeliverUnit
  695. this.currentRow.selectedCnative = row.deliverycountry
  696. } else {
  697. this.pageData.overseasShipper = row.cDeliverUnit
  698. this.pageData.cnative = row.deliverycountry
  699. }
  700. this.overseasShipperFlag = false
  701. this.currentRow = null
  702. },
  703. // 上传之前
  704. beforeUploadHandle (file) {
  705. let extName = file[0].name.substring(file[0].name.lastIndexOf('.')).toLowerCase()
  706. if (!(extName === '.xlsx' || extName === '.xls')) {
  707. this.$message.error('数据导入失败,请选择正确的xlsx模板文件')
  708. return false
  709. }
  710. },
  711. // 选择上传文件时
  712. onChange (file) {
  713. this.fileList.push(file)
  714. this.selectedFile = file
  715. this.previewFile(file)
  716. // 保存文件信息到缓存
  717. this.saveToCache()
  718. },
  719. // 关闭modal
  720. closeDialog () {
  721. // 保存当前状态到缓存
  722. this.saveToCache()
  723. // 关闭当前的页面
  724. this.visible = false
  725. this.$emit('refreshTable')
  726. },
  727. deleteFile(){
  728. // 只有在明确需要清除数据时才调用此方法
  729. this.fileList = []
  730. this.previewData = []
  731. this.showPreview = false
  732. this.selectedFile = null
  733. this.deletedInvoices = []
  734. this.cachedFileInfo = null
  735. this.cachedFileList = []
  736. // 清空文件上传记录
  737. this.$refs.uploadFile.clearFiles()
  738. // 清除缓存
  739. this.clearCache()
  740. // 刷新报工的页面
  741. this.$emit('refreshTable')
  742. },
  743. // 保修当前的数据
  744. saveUploadFile () {
  745. if (null == this.pageData.buNo || this.pageData.buNo=='') {
  746. this.$message.error("请先选择BU!")
  747. return false
  748. }
  749. if (null == this.pageData.customerName || this.pageData.customerName=='') {
  750. this.$message.error("请先选择客户!")
  751. return false
  752. }
  753. if (null == this.pageData.localShipAddress || this.pageData.localShipAddress=='') {
  754. this.$message.error("请先填写客户发货地址!")
  755. return false
  756. }
  757. if (null == this.pageData.overseasShipper || this.pageData.overseasShipper=='') {
  758. this.$message.error("请先填写收货单位!")
  759. return false
  760. }
  761. if (null == this.pageData.overseasAddress || this.pageData.overseasAddress=='') {
  762. this.$message.error("请先填写收货单位地址!")
  763. return false
  764. }
  765. if (null == this.pageData.cnative || this.pageData.cnative=='') {
  766. this.$message.error("请先填写收货单位运抵国!")
  767. return false
  768. }
  769. // 判断文件是否上传
  770. if (null == this.fileList || 0 === this.fileList.length) {
  771. this.$message.error("请先上传文件!")
  772. return false
  773. }
  774. const formData = new FormData()
  775. formData.append("buNo",this.pageData.buNo)
  776. formData.append("username",this.$store.state.user.name)
  777. formData.append("file", this.fileList[0].raw)
  778. formData.append("customerName", this.pageData.customerName)
  779. formData.append("localShipAddress", this.pageData.localShipAddress)
  780. formData.append("overseasShipper", this.pageData.overseasShipper)
  781. formData.append("overseasAddress", this.pageData.overseasAddress)
  782. formData.append("cnative", this.pageData.cnative)
  783. formData.append("salesArea", this.pageData.salesArea)
  784. saveEcssCoDelNotifyByExcel(formData).then(({ data }) => {
  785. if (data.code === 0) {
  786. const { resultMap } = data;
  787. const successList = resultMap.success || [];
  788. const failList = resultMap.fail || [];
  789. // 紧凑样式
  790. let html = `
  791. <div style="max-height:380px;overflow:auto;font-size:12px;line-height:1.4;">
  792. `;
  793. if (successList.length > 0) {
  794. html += `<div style="margin-bottom:6px;">
  795. <div style="color:green;font-weight:bold;margin-bottom:3px;">
  796. 成功${successList.length}
  797. </div>
  798. <table border="1" cellspacing="0" cellpadding="2"
  799. style="border-collapse:collapse;width:100%;">
  800. `;
  801. successList.forEach(item => {
  802. html += `<tr><td style="color:green;padding:2px 4px;">${item}</td></tr>`;
  803. });
  804. html += `</table></div>`;
  805. }
  806. if (failList.length > 0) {
  807. html += `<div>
  808. <div style="color:red;font-weight:bold;margin-bottom:3px;">
  809. 失败${failList.length}
  810. </div>
  811. <table border="1" cellspacing="0" cellpadding="2"
  812. style="border-collapse:collapse;width:100%;">
  813. `;
  814. failList.forEach(item => {
  815. html += `<tr><td style="color:red;padding:2px 4px;">${item}</td></tr>`;
  816. });
  817. html += `</table></div>`;
  818. }
  819. html += `</div>`;
  820. this.$alert(html, '导入结果', {
  821. confirmButtonText: '确定',
  822. dangerouslyUseHTMLString: true,
  823. callback: () => {
  824. if (successList.length > 0){
  825. this.clearCache();
  826. this.clearPreviewData();
  827. this.closeDialog();
  828. }
  829. }
  830. });
  831. } else {
  832. this.$alert(data.msg, '错误', {
  833. confirmButtonText: '确定'
  834. });
  835. }
  836. });
  837. },
  838. // 预览文件
  839. async previewFile(file) {
  840. if (!file || !file.raw) {
  841. return
  842. }
  843. if (!this.pageData.buNo) {
  844. this.$message.error('请先选择BU!')
  845. this.fileList = []
  846. this.$refs.uploadFile.clearFiles()
  847. return
  848. }
  849. this.previewLoading = true // 开始加载
  850. const formData = new FormData()
  851. formData.append("file", file.raw)
  852. formData.append("buNo", this.pageData.buNo)
  853. try {
  854. const { data } = await previewExcel(formData)
  855. if (data.code === 0) {
  856. this.previewData = data.data || []
  857. this.showPreview = true
  858. // 清空删除列表,因为这是新的文件预览
  859. this.deletedInvoices = []
  860. // 为每个发票号初始化客户信息
  861. this.previewData.forEach(item => {
  862. this.$set(item, 'selectedTemplate', '')
  863. this.$set(item, 'selectedCustomer', '')
  864. this.$set(item, 'selectedLocalAddress', '')
  865. this.$set(item, 'selectedOverseasShipper', '')
  866. this.$set(item, 'selectedOverseasAddress', '')
  867. this.$set(item, 'selectedCnative', '')
  868. this.$set(item, 'selectedSalesArea','')
  869. })
  870. // 预览成功后立即保存缓存
  871. this.saveToCache()
  872. } else {
  873. this.$message.error(data.msg || '文件预览失败')
  874. }
  875. } catch (error) {
  876. this.$message.error('文件预览失败:' + error.message)
  877. } finally {
  878. this.previewLoading = false // 结束加载
  879. }
  880. },
  881. // 从预览数据保存
  882. saveFromPreview() {
  883. // 验证每个发票的必填信息
  884. for (let item of this.previewData) {
  885. if (!item.selectedCustomer) {
  886. this.$message.error(`发票号 ${item.cmcInvoice} 请选择客户`)
  887. return false
  888. }
  889. if (!item.selectedLocalAddress) {
  890. this.$message.error(`发票号 ${item.cmcInvoice} 请填写客户地址`)
  891. return false
  892. }
  893. if (!item.selectedOverseasShipper) {
  894. this.$message.error(`发票号 ${item.cmcInvoice} 请填写收货单位`)
  895. return false
  896. }
  897. if (!item.selectedOverseasAddress) {
  898. this.$message.error(`发票号 ${item.cmcInvoice} 请填写收货单位地址`)
  899. return false
  900. }
  901. if (!item.selectedCnative) {
  902. this.$message.error(`发票号 ${item.cmcInvoice} 请填写运抵国`)
  903. return false
  904. }
  905. }
  906. // 发送保存请求
  907. const formData = new FormData()
  908. formData.append("buNo", this.pageData.buNo)
  909. formData.append("username", this.$store.state.user.name)
  910. formData.append("file", this.fileList[0].raw)
  911. // 添加被删除的发票号列表
  912. formData.append("deletedInvoices", JSON.stringify(this.deletedInvoices))
  913. // 为每个发票设置客户信息
  914. this.previewData.forEach((item, index) => {
  915. formData.append(`customerName_${item.cmcInvoice}`, item.selectedCustomer)
  916. formData.append(`localShipAddress_${item.cmcInvoice}`, item.selectedLocalAddress)
  917. formData.append(`overseasShipper_${item.cmcInvoice}`, item.selectedOverseasShipper)
  918. formData.append(`overseasAddress_${item.cmcInvoice}`, item.selectedOverseasAddress)
  919. formData.append(`cnative_${item.cmcInvoice}`, item.selectedCnative)
  920. formData.append(`salesArea_${item.cmcInvoice}`, item.selectedSalesArea)
  921. })
  922. saveEcssCoDelNotifyByExcel(formData).then(({ data }) => {
  923. if (data.code === 0) {
  924. const { resultMap } = data;
  925. const successList = resultMap.success || [];
  926. const failList = resultMap.fail || [];
  927. // 紧凑样式
  928. let html = `
  929. <div style="max-height:380px;overflow:auto;font-size:12px;line-height:1.4;">
  930. `;
  931. if (successList.length > 0) {
  932. html += `<div style="margin-bottom:6px;">
  933. <div style="color:green;font-weight:bold;margin-bottom:3px;">
  934. 成功${successList.length}
  935. </div>
  936. <table border="1" cellspacing="0" cellpadding="2"
  937. style="border-collapse:collapse;width:100%;">
  938. `;
  939. successList.forEach(item => {
  940. html += `<tr><td style="color:green;padding:2px 4px;">${item}</td></tr>`;
  941. });
  942. html += `</table></div>`;
  943. }
  944. if (failList.length > 0) {
  945. html += `<div>
  946. <div style="color:red;font-weight:bold;margin-bottom:3px;">
  947. 失败${failList.length}
  948. </div>
  949. <table border="1" cellspacing="0" cellpadding="2"
  950. style="border-collapse:collapse;width:100%;">
  951. `;
  952. failList.forEach(item => {
  953. html += `<tr><td style="color:red;padding:2px 4px;">${item}</td></tr>`;
  954. });
  955. html += `</table></div>`;
  956. }
  957. html += `</div>`;
  958. this.$alert(html, '导入结果', {
  959. confirmButtonText: '确定',
  960. dangerouslyUseHTMLString: true,
  961. callback: () => {
  962. if (successList.length > 0){
  963. this.clearCache();
  964. this.clearPreviewData();
  965. this.closeDialog();
  966. }
  967. }
  968. });
  969. } else {
  970. this.$alert(data.msg, '错误', {
  971. confirmButtonText: '确定'
  972. });
  973. }
  974. });
  975. },
  976. // 取消预览
  977. cancelPreview() {
  978. this.showPreview = false
  979. this.previewData = []
  980. this.fileList = []
  981. this.selectedFile = null
  982. this.deletedInvoices = []
  983. this.cachedFileInfo = null
  984. this.cachedFileList = []
  985. this.$refs.uploadFile.clearFiles()
  986. // 更新缓存
  987. this.saveToCache()
  988. },
  989. // 清除预览数据
  990. clearPreviewData() {
  991. this.previewData = []
  992. this.showPreview = false
  993. this.selectedFile = null
  994. this.fileList = []
  995. this.deletedInvoices = []
  996. this.previewLoading = false
  997. this.cachedFileInfo = null
  998. this.cachedFileList = []
  999. this.$refs.uploadFile.clearFiles()
  1000. // 更新缓存
  1001. this.saveToCache()
  1002. },
  1003. // 为行选择客户模板
  1004. selectTemplateForRow(row) {
  1005. this.currentRow = row
  1006. this.getCustomerTemplateList()
  1007. this.templateFlag = true
  1008. },
  1009. // 为行选择客户
  1010. selectCustomerForRow(row) {
  1011. this.currentRow = row
  1012. this.customFlag = true
  1013. },
  1014. // 为行选择客户地址
  1015. selectLocalAddressForRow(row) {
  1016. if (!row.selectedCustomer) {
  1017. this.$message.warning('请先选择客户')
  1018. return
  1019. }
  1020. this.currentRow = row
  1021. this.getCusPersonsForRow(row.selectedCustomer)
  1022. this.localShipAddressFlag = true
  1023. },
  1024. // 为行选择收货单位
  1025. selectOverseasShipperForRow(row) {
  1026. if (!row.selectedCustomer) {
  1027. this.$message.warning('请先选择客户')
  1028. return
  1029. }
  1030. this.currentRow = row
  1031. this.getCusPersonsForRow(row.selectedCustomer)
  1032. this.overseasShipperFlag = true
  1033. },
  1034. // 为行选择收货单位地址
  1035. selectOverseasAddressForRow(row) {
  1036. if (!row.selectedCustomer) {
  1037. this.$message.warning('请先选择客户')
  1038. return
  1039. }
  1040. this.currentRow = row
  1041. this.getCusPersonsForRow(row.selectedCustomer)
  1042. this.overseasAddressFlag = true
  1043. },
  1044. // 获取客户模板列表
  1045. async getCustomerTemplateList() {
  1046. try {
  1047. const { data } = await getCustomerTemplateList({})
  1048. if (data && data.code === 0) {
  1049. this.customerTemplateList = data.rows || []
  1050. }
  1051. } catch (error) {
  1052. console.error('获取客户模板列表失败:', error)
  1053. this.customerTemplateList = []
  1054. }
  1055. },
  1056. // 获取特定客户的地址信息
  1057. getCusPersonsForRow(customerName) {
  1058. let cusData = {ccusname: customerName}
  1059. getCustomers(cusData).then(({data}) => {
  1060. if (data && data.code === 0) {
  1061. this.customerPersons = data.rows
  1062. this.customerPersons.forEach(o => {
  1063. if (!this.customerMap.has(o.ccontactname)) {
  1064. this.customerMap.set(o.ccontactname, o.cnative);
  1065. }
  1066. });
  1067. }
  1068. });
  1069. getCustomerAdd(cusData).then(({data}) => {
  1070. if (data && data.code === 0) {
  1071. this.customerAddrs = data.rows
  1072. }
  1073. });
  1074. },
  1075. // 打开大输入框编辑弹窗
  1076. openEditDialog(row, fieldName, label, title) {
  1077. this.editDialog.visible = true
  1078. this.editDialog.title = title
  1079. this.editDialog.label = label
  1080. this.editDialog.fieldName = fieldName
  1081. this.editDialog.row = row
  1082. this.editDialog.value = row[fieldName] || ''
  1083. this.$nextTick(() => this.$refs.editTextarea.focus());
  1084. },
  1085. // 关闭大输入框编辑弹窗
  1086. closeEditDialog() {
  1087. this.editDialog.visible = false
  1088. this.editDialog.title = ''
  1089. this.editDialog.label = ''
  1090. this.editDialog.fieldName = ''
  1091. this.editDialog.row = null
  1092. this.editDialog.value = ''
  1093. },
  1094. // 确认编辑
  1095. confirmEdit() {
  1096. if (this.editDialog.row && this.editDialog.fieldName) {
  1097. this.editDialog.row[this.editDialog.fieldName] = this.editDialog.value
  1098. }
  1099. this.closeEditDialog()
  1100. },
  1101. // 删除行
  1102. deleteRow(index, row) {
  1103. this.$confirm(`确定要删除发票号 "${row.cmcInvoice}" 吗?删除后将不会提交到后台。`, '删除确认', {
  1104. confirmButtonText: '确定删除',
  1105. cancelButtonText: '取消',
  1106. type: 'warning'
  1107. }).then(() => {
  1108. // 记录被删除的发票号
  1109. if (!this.deletedInvoices.includes(row.cmcInvoice)) {
  1110. this.deletedInvoices.push(row.cmcInvoice)
  1111. }
  1112. // 从预览数据中移除该行
  1113. this.previewData.splice(index, 1)
  1114. this.$message.success(`发票号 "${row.cmcInvoice}" 已删除`)
  1115. // 保存到缓存
  1116. this.saveToCache()
  1117. }).catch(() => {
  1118. // 用户取消删除
  1119. })
  1120. },
  1121. // 下载
  1122. async downloadFile () {
  1123. let file = {
  1124. id: 0,
  1125. fileName: ''
  1126. }
  1127. let tempData = {
  1128. orderRef1: 'ecss',
  1129. orderRef2: 'upLoadDel'
  1130. }
  1131. await queryFileId(tempData).then(({data}) => {
  1132. if (data && data.code === 0) {
  1133. file.id = data.data.id
  1134. file.fileName = data.data.fileName
  1135. } else {
  1136. this.$alert(data.msg, '错误', {
  1137. confirmButtonText: '确定'
  1138. })
  1139. }
  1140. })
  1141. await downLoadObjectFile(file).then(({data}) => {
  1142. // 不限制文件下载类型
  1143. const blob = new Blob([data], {type: "application/octet-stream"})
  1144. // 下载文件名称
  1145. const fileName = file.fileName
  1146. // a标签下载
  1147. const linkNode = document.createElement('a')
  1148. // a标签的download属性规定下载文件的名称
  1149. linkNode.download = fileName
  1150. linkNode.style.display = 'none'
  1151. // 生成一个Blob URL
  1152. linkNode.href = URL.createObjectURL(blob)
  1153. document.body.appendChild(linkNode)
  1154. // 模拟在按钮上的一次鼠标单击
  1155. linkNode.click()
  1156. // 释放URL 对象
  1157. URL.revokeObjectURL(linkNode.href)
  1158. document.body.removeChild(linkNode)
  1159. })
  1160. },
  1161. }
  1162. }
  1163. </script>
  1164. <style scoped>
  1165. /deep/ .delClass .cell {
  1166. line-height: 24px !important;
  1167. font-size: 12px !important;
  1168. height: 24px !important;
  1169. }
  1170. /deep/ .customer-upload .el-upload .el-upload-dragger {
  1171. width: 580px;
  1172. }
  1173. /* 输入框样式优化 */
  1174. .el-input.is-readonly {
  1175. cursor: pointer !important;
  1176. }
  1177. .el-input.is-readonly .el-input__inner {
  1178. cursor: pointer !important;
  1179. background-color: #f8f9fa;
  1180. }
  1181. .el-input.is-readonly .el-input__inner:hover {
  1182. background-color: #e9ecef;
  1183. border-color: #409EFF;
  1184. }
  1185. /* 编辑图标样式 */
  1186. .el-input__suffix .el-icon-edit {
  1187. color: #409EFF;
  1188. transition: all 0.3s;
  1189. font-size: 14px;
  1190. padding: 2px;
  1191. border-radius: 3px;
  1192. }
  1193. .el-input__suffix .el-icon-edit:hover {
  1194. color: #ffffff;
  1195. background-color: #409EFF;
  1196. transform: scale(1.1);
  1197. }
  1198. /* 编辑弹窗整体样式 */
  1199. .edit-dialog .el-dialog__body {
  1200. padding: 20px 20px 0;
  1201. }
  1202. .edit-dialog-tip {
  1203. margin-bottom: 15px;
  1204. color: #909399;
  1205. font-size: 12px;
  1206. background-color: #f4f4f5;
  1207. padding: 8px 12px;
  1208. border-radius: 4px;
  1209. border-left: 3px solid #409EFF;
  1210. }
  1211. .edit-dialog-tip .el-icon-info {
  1212. margin-right: 5px;
  1213. color: #409EFF;
  1214. }
  1215. /* 大输入框样式 */
  1216. .edit-textarea .el-textarea__inner {
  1217. resize: vertical !important;
  1218. min-height: 120px !important;
  1219. border: 1px solid #dcdfe6 !important;
  1220. border-radius: 4px !important;
  1221. padding: 8px 12px !important;
  1222. font-size: 14px !important;
  1223. line-height: 1.5 !important;
  1224. color: #606266 !important;
  1225. background-color: #fff !important;
  1226. transition: border-color 0.2s cubic-bezier(.645,.045,.355,1) !important;
  1227. box-sizing: border-box !important;
  1228. }
  1229. .edit-textarea .el-textarea__inner:focus {
  1230. outline: none !important;
  1231. border-color: #409EFF !important;
  1232. box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2) !important;
  1233. }
  1234. .edit-textarea .el-input__count {
  1235. color: #909399 !important;
  1236. background: #fff !important;
  1237. position: absolute !important;
  1238. font-size: 12px !important;
  1239. bottom: 5px !important;
  1240. right: 10px !important;
  1241. }
  1242. /* 修复弹窗中的表单项样式 */
  1243. .edit-dialog .el-form-item {
  1244. margin-bottom: 18px !important;
  1245. }
  1246. .edit-dialog .el-form-item__label {
  1247. color: #606266 !important;
  1248. font-weight: 500 !important;
  1249. line-height: 1.5 !important;
  1250. padding: 0 0 8px 0 !important;
  1251. box-sizing: border-box !important;
  1252. font-size: 14px !important;
  1253. }
  1254. /* 编辑弹窗按钮样式 */
  1255. .edit-dialog .dialog-footer {
  1256. text-align: right !important;
  1257. padding: 15px 20px 20px !important;
  1258. }
  1259. .edit-dialog .dialog-footer .el-button {
  1260. margin-left: 10px !important;
  1261. }
  1262. /* 确保弹窗内容不会溢出 */
  1263. .edit-dialog .el-dialog__wrapper {
  1264. overflow: hidden;
  1265. }
  1266. .edit-dialog .el-dialog {
  1267. margin-top: 5vh !important;
  1268. margin-bottom: 50px !important;
  1269. }
  1270. /* 表格输入框提示文字 */
  1271. .el-table .el-input__inner::placeholder {
  1272. font-size: 12px;
  1273. color: #c0c4cc;
  1274. }
  1275. </style>