transportPrice.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  1. <template>
  2. <!-- 汽运单价页面 -->
  3. <div class="salePlan">
  4. <div class="top">
  5. <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
  6. <el-button type="primary" class="btn" @click="onclick" :loading="loading">
  7. <i class="el-icon-search"></i>查询
  8. </el-button>
  9. <el-button type="primary" @click="btnclick(0)">
  10. <i class="el-icon-plus"></i>新增
  11. </el-button>
  12. <el-button type="primary" @click="exportAllExcel()"><i class="el-icon-download"></i>导出(Excel)</el-button>
  13. <el-button type="primary" @click="importOperation()">
  14. 导入
  15. </el-button>
  16. <el-dialog
  17. :visible.sync="dialogVisible"
  18. >
  19. <div class="dialog">
  20. <div style="width:250px">
  21. <span>油价</span>
  22. <el-input v-model="importPriceValue" style="width:150px"></el-input>
  23. </div>
  24. <div style="width:250px">
  25. <span>执行日期</span>
  26. <el-date-picker
  27. v-model="importPriceDate"
  28. type="date"
  29. value-format="yyyy-MM-dd HH:mm:ss"
  30. style="width:150px"
  31. >
  32. </el-date-picker>
  33. </div>
  34. <div style="width:200px">
  35. <el-upload
  36. style="margin-left:10px"
  37. action=""
  38. :on-change="importExcel"
  39. :show-file-list="false"
  40. accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
  41. :auto-upload="false">
  42. <el-button type="primary">
  43. <i class="el-icon-upload"></i>导入(Excel)</el-button>
  44. </el-upload>
  45. </div>
  46. </div>
  47. </el-dialog>
  48. </div>
  49. <el-tabs v-model="activeName">
  50. <!-- 正在启用 -->
  51. <el-tab-pane label="正在启用" name="first">
  52. <dilTable ref="excelDom" v-bind.sync="option" :loading="loading" :isKuang="isKuang" @func="func">
  53. <el-table-column
  54. fixed="right"
  55. label="操作"
  56. width="200px"
  57. align="center"
  58. >
  59. <template slot-scope="scope">
  60. <el-button type="primary" @click="updatePriceclick(scope.row)">修改</el-button>
  61. <el-button type="primary" @click="deletePrice(scope.row)">删除</el-button>
  62. </template>
  63. </el-table-column>
  64. </dilTable>
  65. </el-tab-pane>
  66. <!-- 历史启用 -->
  67. <el-tab-pane label="历史启用" name="second">
  68. <dilTable ref="excelDom" v-bind.sync="option2" :loading="loading" :isKuang="isKuang" @func="func">
  69. </dilTable>
  70. </el-tab-pane>
  71. </el-tabs>
  72. <!-- 承运商模态框 -->
  73. <el-drawer
  74. title="运价修改界面"
  75. :visible.sync="drawer"
  76. direction="rtl"
  77. size="40%"
  78. :show-close="false"
  79. >
  80. <div class="operation1">
  81. <span style="width:10%;align-content: center;">卸货地点</span>
  82. <el-input
  83. v-model="newAddressDeliveryAddress"
  84. style="width:70%"
  85. ></el-input>
  86. <el-button type="primary" style="width:15%" @click="updateAddressDeliveryAddress">提交</el-button>
  87. </div>
  88. <div class="operation2">
  89. <span style="width:10%;align-content: center;">运价</span>
  90. <el-input
  91. v-model="newPriceValue"
  92. style="width:30%"
  93. ></el-input>
  94. <el-button type="primary" style="width:15%" @click="updatePriceValue">提交</el-button>
  95. </div>
  96. <el-input
  97. placeholder="请输入内容"
  98. style="margin-top: 10px; margin-left: 20px;width:250px"
  99. clearable
  100. v-model="index"
  101. >
  102. </el-input
  103. ><el-button
  104. type="primary"
  105. style="margin-left: 4px;"
  106. @click="queryCarrierName"
  107. >
  108. <i class="el-icon-search"></i>查询
  109. </el-button>
  110. <el-button type="primary" @click="updateCarrierNamelist">确定修改承运商</el-button>
  111. <div>
  112. <!-- 查询所有的承运商 -->
  113. <el-table
  114. :data="carrierNameTable"
  115. style="width:100%"
  116. max-height="200px"
  117. :row-key="getRowKeys"
  118. @selection-change="handleSelectionChange"
  119. :border="true"
  120. ref="carrierNameTable"
  121. >
  122. <el-table-column
  123. type="selection"
  124. :reserve-selection="true"
  125. >
  126. </el-table-column>
  127. <el-table-column
  128. type="index"
  129. label="序号"
  130. >
  131. </el-table-column>
  132. <el-table-column
  133. prop="carrierName"
  134. label="承运商"
  135. align="center"
  136. >
  137. </el-table-column>
  138. </el-table>
  139. <el-pagination
  140. @size-change="handleSizeChange"
  141. @current-change="handleCurrentChange"
  142. :current-page="currentPage"
  143. layout="total,prev,pager,next,sizes"
  144. :total="carrierNametotal"
  145. :page-sizes="[10, 50, 100, 1000]"
  146. :page-size="currentPageSize"
  147. >
  148. </el-pagination>
  149. </div>
  150. </el-drawer>
  151. </div>
  152. </template>
  153. <script>
  154. export default {
  155. name: "TransportPrice",
  156. data() {
  157. return {
  158. activeName: "first",
  159. isKuang:false,
  160. loading:false,
  161. input: "",
  162. drawer:false,
  163. //承运商
  164. carrierNameTable:[],
  165. //卸货地点
  166. newAddressDeliveryAddress:'',
  167. //运价
  168. newPriceValue:'',
  169. //执行日期
  170. insertTime:'',
  171. //修改单价或者卸货地址所需信息
  172. datalist:{},
  173. //选中的值
  174. checkedList:[],
  175. //承运商总数目
  176. carrierNametotal:100,
  177. //当前页数
  178. currentPage:1,
  179. //当前页数规格
  180. currentPageSize:10,
  181. //搜索框
  182. index:'',
  183. //承运商的修改
  184. carrierIdArray:[],
  185. option: {
  186. // 表格请求数据的地址
  187. requestUrl:
  188. "/api/v1/ams/getAmsContractTransportPrice1?apiId=109&deleted=0",
  189. },
  190. option2: {
  191. // 表格请求数据的地址
  192. requestUrl:
  193. "/api/v1/ams/getAmsContractTransportPrice1?apiId=109&deleted=1",
  194. },
  195. tableTitle:'汽运单价',
  196. importPriceValue:null,
  197. importPriceDate:null,
  198. dialogVisible:false
  199. };
  200. },
  201. methods: {
  202. importOperation(){
  203. this.dialogVisible=true
  204. },
  205. exportAllExcel() {
  206. if (this.activeName == 'first') {
  207. this.tableTitle = '正在启用的运输单价'
  208. this.loading = true;
  209. this.isKuang = true;
  210. if(this.input){
  211. this.axios
  212. .post(
  213. "/api/v1/ams/getAmsContractTransportPrice1?apiId=109&deleted=0&con=" +this.input+"&i="+new Date()
  214. )
  215. .then(res => {
  216. console.log(res.data.data)
  217. this.exportAllList = res.data.data.list
  218. this.noSettleDetailsColumn=res.data.data.columnData
  219. this.exportAllReportToExcel(
  220. this.tableTitle,
  221. this.exportAllList,
  222. this.noSettleDetailsColumn
  223. )
  224. })
  225. }else{
  226. this.axios
  227. .post(
  228. "/api/v1/ams/getAmsContractTransportPrice1?apiId=109&deleted=0&i="+new Date()
  229. )
  230. .then(res => {
  231. console.log(res.data.data)
  232. this.exportAllList = res.data.data.list
  233. this.noSettleDetailsColumn=res.data.data.columnData
  234. this.exportAllReportToExcel(
  235. this.tableTitle,
  236. this.exportAllList,
  237. this.noSettleDetailsColumn
  238. )
  239. })
  240. }
  241. }else if (this.activeName == 'second') {
  242. this.tableTitle = '历史启用的运输单价'
  243. this.loading = true;
  244. this.isKuang = true;
  245. if(this.input){
  246. this.axios
  247. .post(
  248. "/api/v1/ams/getAmsContractTransportPrice1?apiId=109&deleted=1&con=" +this.input+"&i="+new Date()
  249. )
  250. .then(res => {
  251. console.log(res.data.data)
  252. this.exportAllList = res.data.data.list
  253. this.noSettleDetailsColumn=res.data.data.columnData
  254. this.exportAllReportToExcel(
  255. this.tableTitle,
  256. this.exportAllList,
  257. this.noSettleDetailsColumn
  258. )
  259. })
  260. }else{
  261. this.axios
  262. .post(
  263. "/api/v1/ams/getAmsContractTransportPrice1?apiId=109&deleted=1&con=" +this.input+"&i="+new Date()
  264. )
  265. .then(res => {
  266. console.log(res.data.data)
  267. this.exportAllList = res.data.data.list
  268. this.noSettleDetailsColumn=res.data.data.columnData
  269. this.exportAllReportToExcel(
  270. this.tableTitle,
  271. this.exportAllList,
  272. this.noSettleDetailsColumn
  273. )
  274. })
  275. }
  276. } else {
  277. }
  278. this.loading=false
  279. },
  280. //导出excel
  281. exportAllReportToExcel(tableTitle, dataArr, columnData) {
  282. var title = tableTitle
  283. let tHeader = []
  284. let filterVal = []
  285. columnData.forEach(e1 => {
  286. if (tHeader.indexOf(e1.label) === -1) {
  287. tHeader.push(e1.label)
  288. }
  289. if (filterVal.indexOf(e1.prop) === -1) {
  290. filterVal.push(e1.prop)
  291. }
  292. })
  293. //导出为excel
  294. this.downloadLoading = true
  295. require.ensure([], () => {
  296. const {
  297. export_json_to_excel
  298. } = require('@/assets/excel/Export2Excel.js') //这里必须使用绝对路径,使用@/+存放export2Excel的路径
  299. // let list = this.$refs.excelDom.dataTabel;
  300. let data = dataArr.map(v => filterVal.map(j => v[j])) //3.formatJson格式转换
  301. export_json_to_excel(tHeader, data, title) // (title)导出的表格名称
  302. })
  303. },
  304. func(){
  305. this.loading = false;
  306. this.isKuang = false;
  307. },
  308. onclick() {
  309. this.loading = true;
  310. this.isKuang = true;
  311. if(this.input){
  312. this.option.requestUrl ="/api/v1/ams/getAmsContractTransportPrice1?apiId=109&deleted=0&con=" +this.input+"&i="+new Date();
  313. this.option2.requestUrl ="/api/v1/ams/getAmsContractTransportPrice1?apiId=109&deleted=1&con=" +this.input+"&i="+new Date();
  314. }else{
  315. this.option.requestUrl ="/api/v1/ams/getAmsContractTransportPrice1?apiId=109&deleted=0&i="+new Date();
  316. this.option2.requestUrl ="/api/v1/ams/getAmsContractTransportPrice1?apiId=109&deleted=1&con=" +this.input+"&i="+new Date();
  317. }
  318. },
  319. btnclick() {
  320. this.$router.push("/addTransportPrice");
  321. },
  322. updatePriceclick(row) {
  323. this.$router.push({
  324. name:'addTransportPriceNew',
  325. params:{
  326. addressProvince:row.addressProvince,
  327. addressDistrict:row.addressDistrict,
  328. addressTown:row.addressTown,
  329. addressDeliveryAddress:row.addressDeliveryAddress,
  330. priceValue:row.priceValue,
  331. haulDistance:row.haulDistance,
  332. placeId:row.placeId,
  333. priceDate:row.priceDate
  334. }
  335. });
  336. },
  337. //修改运价
  338. //删除运价
  339. deletePrice(row){
  340. let mapValue={
  341. addressProvince:row.addressProvince,
  342. addressDistrict:row.addressDistrict,
  343. addressTown:row.addressTown,
  344. addressDeliveryAddress:row.addressDeliveryAddress
  345. }
  346. this.axios.post("/api/v1/ams/deleteSalelPrice",mapValue)
  347. .then(res=>{
  348. if(res.data.code==200){
  349. this.$message.success("删除成功")
  350. }else{
  351. this.$message.warning("删除失败")
  352. }
  353. })
  354. this.onclick()
  355. },
  356. //修改
  357. async updatePrice(row){
  358. this.drawer=true
  359. this.newAddressDeliveryAddress=row.addressDeliveryAddress
  360. this.newPriceValue=row.priceValue
  361. this.datalist.placeId=row.placeId
  362. this.datalist.addressProvince=row.addressProvince
  363. this.datalist.addressDistrict=row.addressDistrict
  364. this.datalist.addressTown=row.addressTown
  365. this.datalist.addressDeliveryAddress=row.addressDeliveryAddress
  366. let mapValue={
  367. pageSize:this.currentPageSize,
  368. pageNum:this.currentPage,
  369. index:this.index
  370. }
  371. await this.axios.post("/api/v1/ams/getCarrierListByPrice",mapValue).then(res=>{
  372. console.log("进入了查询承运商界面")
  373. console.log(res.data)
  374. this.carrierNameTable=res.data.data
  375. this.carrierNametotal=res.data.data[1].total
  376. })
  377. await this.axios.post("/api/v1/ams/getCarrierListByAddress",this.datalist).
  378. then(res=>{
  379. //this.checkedList=res.data.data
  380. })
  381. //console.log("初始化时选中的数据")
  382. //console.log(this.checkedList)
  383. },
  384. //修改运价
  385. updatePriceValue(){
  386. console.log("查看数据")
  387. console.log(this.newPriceValue)
  388. if(this.newPriceValue==null||this.newPriceValue==""){
  389. this.$message.warning("运价不能为空")
  390. return
  391. }
  392. console.log("进入了修改单价的方法")
  393. this.datalist.newPriceValue=this.newPriceValue
  394. console.log(this.datalist)
  395. this.axios.post("/api/v1/ams/updatePriceValue",this.datalist).
  396. then(res=>{
  397. if(res.data.code==200){
  398. this.$message.success("修改运价成功")
  399. }else{
  400. this.$message.warning("修改运价失败")
  401. }
  402. })
  403. this.onclick()
  404. this.drawer=false
  405. this.$refs.carrierNameTable.clearSelection()
  406. },
  407. //修改卸货地址
  408. updateAddressDeliveryAddress(){
  409. if(this.newAddressDeliveryAddress==null||this.newAddressDeliveryAddress==""){
  410. this.$message.warning("卸货地址不能为空")
  411. return
  412. }
  413. console.log("进入了修改卸货地址的方法")
  414. this.datalist.newAddressDeliveryAddress=this.newAddressDeliveryAddress
  415. console.log(this.datalist)
  416. this.axios.post("/api/v1/ams/updateaddressDeliveryAddress",this.datalist).
  417. then(res=>{
  418. console.log(res)
  419. if(res.data.code==200){
  420. this.$message.success("修改卸货成功")
  421. }else{
  422. this.$message.warning("修改卸货失败")
  423. }
  424. })
  425. this.onclick()
  426. this.drawer=false
  427. this.$refs.carrierNameTable.clearSelection()
  428. },
  429. getRowKeys(row){
  430. return row.carrierId
  431. },
  432. handleSelectionChange(list){
  433. console.log("选中的值")
  434. console.log(list)
  435. this.checkedList=list
  436. console.log(this.checkedList)
  437. },
  438. async handleSizeChange(val) {
  439. console.log(`每页 ${val} 条`);
  440. this.currentPageSize=val
  441. let mapValue={
  442. pageSize:this.currentPageSize,
  443. pageNum:this.currentPage,
  444. index:this.index
  445. }
  446. await this.axios.post("/api/v1/ams/getCarrierListByPrice",mapValue).then(res=>{
  447. console.log("进入了查询承运商界面")
  448. console.log(res.data)
  449. this.carrierNameTable=res.data.data
  450. this.carrierNametotal=res.data.data[1].total
  451. })
  452. },
  453. async handleCurrentChange(val) {
  454. console.log(`当前页: ${val}`);
  455. this.currentPage=val
  456. let mapValue={
  457. pageSize:this.currentPageSize,
  458. pageNum:this.currentPage,
  459. index:this.index
  460. }
  461. await this.axios.post("/api/v1/ams/getCarrierListByPrice",mapValue).then(res=>{
  462. console.log("进入了查询承运商界面")
  463. console.log(res.data)
  464. this.carrierNameTable=res.data.data
  465. this.carrierNametotal=res.data.data[1].total
  466. })
  467. },
  468. async queryCarrierName(){
  469. let mapValue={
  470. pageSize:this.currentPageSize,
  471. pageNum:this.currentPage,
  472. index:this.index
  473. }
  474. await this.axios.post("/api/v1/ams/getCarrierListByPrice",mapValue).then(res=>{
  475. console.log("进入了查询承运商界面")
  476. console.log(res.data)
  477. this.carrierNameTable=res.data.data
  478. this.carrierNametotal=res.data.data[1].total
  479. })
  480. },
  481. //修改承运商
  482. async updateCarrierNamelist(){
  483. for(let i=0;i<this.checkedList.length;i++){
  484. this.carrierIdArray.push(this.checkedList[i].carrierId)
  485. }
  486. this.datalist.carrierIdArray=this.carrierIdArray
  487. await this.axios.post("/api/v1/ams/updateCarrierName",this.datalist).then(res=>{
  488. if(res.data.code==200){
  489. this.$message.success("修改承运商成功")
  490. }else{
  491. this.$message.warning("修改承运商失败")
  492. }
  493. })
  494. console.log("看看数据对不对")
  495. console.log(this.carrierIdArray)
  496. console.log(this.$refs)
  497. this.$refs.carrierNameTable.clearSelection()
  498. this.carrierIdArray=[]
  499. this.drawer=false
  500. this.onclick()
  501. },
  502. importExcel(file){
  503. let that = this;
  504. console.log("进入了导入")
  505. if(that.importPriceValue==null){
  506. that.$message.warning("油价没有值")
  507. return
  508. }else if(that.importPriceDate==null){
  509. that.$message.warning("执行时间没有填")
  510. return
  511. }
  512. if (!file) {
  513. that.$message({
  514. message: "文件错误!",
  515. type: "warning"
  516. });
  517. return;
  518. }
  519. let excelData =[]
  520. var reader=new FileReader();
  521. var data=null;
  522. var workbook = null;
  523. //设置读取操作
  524. reader.onload = function (e){
  525. console.log(e);
  526. data = e.target.result;
  527. workbook=XLSX.read(data,{type:'binary'});
  528. console.log(workbook)
  529. //只取第一个表的 数据
  530. let rows= XLSX.utils.sheet_to_json(
  531. workbook.Sheets[workbook.SheetNames[0]]
  532. );
  533. console.log("rows:",rows)
  534. //查找"序号"
  535. let index=1;
  536. for (index=1;index<rows.length;index++){
  537. if (workbook.Sheets[workbook.SheetNames[0]]["A"+index] &&
  538. (workbook.Sheets[workbook.SheetNames[0]]["A"+index].v=="序号" || workbook.Sheets[workbook.SheetNames[0]]["A"+index].v=="序\n号"
  539. || workbook.Sheets[workbook.SheetNames[0]]["A"+index].v=="序\r\n号")){
  540. break;
  541. }
  542. }
  543. console.log("表头行数:" + index);
  544. if(index>=rows.length){
  545. that.$message({
  546. message: "文件错误!",
  547. type: "warning",
  548. });
  549. return
  550. }
  551. //查找最新运价
  552. let cols=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
  553. let j=cols.length-1;
  554. let priceCol=null;
  555. let tonnageCol=null;
  556. for (j=cols.length-1;j>0;j--){
  557. if (workbook.Sheets[workbook.SheetNames[0]][cols[j]+(index+1)] && priceCol==null
  558. && (workbook.Sheets[workbook.SheetNames[0]][cols[j]+(index+1)].v=="运价\n(元/吨)"
  559. || workbook.Sheets[workbook.SheetNames[0]][cols[j]+(index+1)].v=="运价\r\n(元/吨)")){
  560. priceCol=cols[j];
  561. }else if (workbook.Sheets[workbook.SheetNames[0]][cols[j]+(index+1)] && tonnageCol==null
  562. && (workbook.Sheets[workbook.SheetNames[0]][cols[j]+(index+1)].v=="吨公里\n(元/吨.km)"
  563. || workbook.Sheets[workbook.SheetNames[0]][cols[j]+(index+1)].v=="吨公里\r\n(元/吨.km)")){
  564. tonnageCol=cols[j];
  565. }
  566. }
  567. console.log("最新单价列数:" + priceCol);
  568. console.log("最新单价吨公里:" + tonnageCol);
  569. //读取表格
  570. for (let i = index+2; i <= rows.length+1 ; i++){
  571. let temp={
  572. no:null,
  573. addressProvince:null,
  574. addressDistrict:null,
  575. addressTown:null,
  576. addressDeliveryAddress:null,
  577. priceValue:null,
  578. haulDistance:null,
  579. priceTonKilometer:null,
  580. carrierName:null
  581. }
  582. //序号,无序号视为无效数据。
  583. if(!workbook.Sheets[workbook.SheetNames[0]]["A" + i]){
  584. continue;
  585. }
  586. try{
  587. temp.no=workbook.Sheets[workbook.SheetNames[0]]["A" + i].v;
  588. }catch(error){}
  589. //省
  590. try{
  591. temp.addressProvince=workbook.Sheets[workbook.SheetNames[0]]["B" + i].v;
  592. }catch(error){}
  593. //市
  594. try{
  595. temp.addressDistrict=workbook.Sheets[workbook.SheetNames[0]]["C" + i].v;
  596. }catch(error){}
  597. //县
  598. try{
  599. temp.addressTown=workbook.Sheets[workbook.SheetNames[0]]["D" + i].v;
  600. }catch(error){}
  601. //卸货地点
  602. try{
  603. temp.addressDeliveryAddress=workbook.Sheets[workbook.SheetNames[0]]["E" + i].v;
  604. }catch(error){}
  605. //参考运距
  606. try{
  607. temp.haulDistance=workbook.Sheets[workbook.SheetNames[0]]["F" + i].v;
  608. }catch(error){}
  609. //承运商
  610. try{
  611. temp.carrierName=workbook.Sheets[workbook.SheetNames[0]]["O" + i].v;
  612. }catch(error){}
  613. //单价
  614. try{
  615. temp.priceValue=workbook.Sheets[workbook.SheetNames[0]][priceCol + i].v;
  616. }catch(error){}
  617. //吨/公里
  618. try{
  619. temp.priceTonKilometer=workbook.Sheets[workbook.SheetNames[0]][tonnageCol + i].v;
  620. }catch(error){}
  621. // console.log(temp);
  622. excelData.push(temp);
  623. }
  624. //最终数据表格:
  625. console.log("excelData",excelData);
  626. that.importData(excelData)
  627. }
  628. reader.readAsBinaryString(file.raw);
  629. },
  630. async importData(excelData){
  631. const loading = this.$loading({
  632. lock: true,
  633. text: '正在导入数据',
  634. spinner: 'el-icon-loading',
  635. background: 'rgba(0, 0, 0, 0.7)'
  636. })
  637. await this.axios.post("/api/v1/ams/importDataForAmsContractTransportPrice?importPriceValue="+this.importPriceValue
  638. +"&importPriceDate="+this.importPriceDate,excelData).then(res=>{
  639. console.log(res)
  640. if(res.data.code==200){
  641. this.$message({
  642. message: "导入成功",
  643. type: "success"
  644. });
  645. }
  646. })
  647. console.log("导入成功")
  648. this.dialogVisible=false
  649. this.importPriceValue=null
  650. this.importPriceDate=null
  651. loading.close()
  652. this.onclick()
  653. }
  654. },
  655. };
  656. </script>
  657. <style lang='scss' scoped>
  658. .salePlan {
  659. .top{
  660. display: flex;
  661. padding: 1.25rem 0.375rem;
  662. .el-input {
  663. width: 20%;
  664. margin-right: 1.25rem;
  665. }
  666. }
  667. .operation1{
  668. display: flex;
  669. flex-direction: row;
  670. margin-bottom: 20px;
  671. }
  672. .operation2{
  673. display: flex;
  674. flex-direction: row;
  675. margin-bottom: 20px;
  676. }
  677. }
  678. .dialog{
  679. display: flex;
  680. flex-direction: row;
  681. }
  682. </style>