Rap 原分销系统代码Web
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

01b694fd37ddaa25bce5f751a6c8584d880cdb2c.svn-base 22KB

5 månader sedan
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  1. <template>
  2. <div class="app-container">
  3. <div style="margin-bottom:10px">
  4. <el-button type="success" @click="addBtn">新增</el-button>
  5. <el-button type="success" @click="importBtn">导入</el-button>
  6. <el-button type="success" @click="exportTempBtn">模版下载</el-button>
  7. </div>
  8. <!--搜索-->
  9. <el-form class="mt_15" ref="form" inline size="small">
  10. <el-form-item label="店铺">
  11. <el-input v-model.trim="searchParm.shop" clearable placeholder='店铺'></el-input>
  12. </el-form-item>
  13. <el-form-item label="订单ID">
  14. <el-input v-model.trim="searchParm.orderId" clearable placeholder='订单ID'></el-input>
  15. </el-form-item>
  16. <el-form-item label="公司">
  17. <el-select v-model.trim="searchParm.companyId" placeholder="请选择">
  18. <el-option v-for="item in companys" :key="item.name" :label="item.name" :value="item.id"></el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item label="类型">
  22. <el-select v-model.trim="searchParm.status" placeholder="请选择">
  23. <el-option
  24. v-for="item in typeList"
  25. :key="item.name"
  26. :label="item.name"
  27. :value="item.id">
  28. </el-option>
  29. </el-select>
  30. </el-form-item>
  31. <el-form-item label="状态">
  32. <el-select v-model.trim="searchParm.status" placeholder="请选择">
  33. <el-option
  34. v-for="item in statusList"
  35. :key="item.name"
  36. :label="item.name"
  37. :value="item.id">
  38. </el-option>
  39. </el-select>
  40. </el-form-item>
  41. <el-date-picker
  42. v-model.trim="searchTime"
  43. type="daterange"
  44. range-separator=":"
  45. start-placeholder="开始日期"
  46. end-placeholder="结束日期"
  47. style="width:270px"
  48. ></el-date-picker>
  49. <el-form-item>
  50. <el-button type="primary" @click="goSearch">搜索</el-button>
  51. <el-button type="warning" @click="resetForm">重置</el-button>
  52. </el-form-item>
  53. </el-form>
  54. <!--表格渲染-->
  55. <el-table ref="table" border size="small" :data="list" :header-cell-style="{textAlign:'center'}" :cell-style="{textAlign:'center'}">
  56. <el-table-column label="序号" type="index" width="50" />
  57. <el-table-column label="公司名称" prop="companyName" />
  58. <el-table-column label="类型" prop="type" align="center">
  59. <template slot-scope="scope">
  60. {{ scope.row.type | getListType}}
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="总金额" prop="amount" />
  64. <el-table-column label="店铺名称" prop="shop" />
  65. <el-table-column label="订单ID" prop="orderId" />
  66. <el-table-column label="评论" prop="comment" :formatter="commentSub"/>
  67. <!--<el-table-column label="状态" prop="status" align="center">
  68. <template slot-scope="scope">
  69. {{ scope.row.status | getStatus}}
  70. </template>
  71. </el-table-column>-->
  72. <el-table-column label="创建时间" prop="createdAt" />
  73. <el-table-column label="修改时间" prop="updatedAt" />
  74. <el-table-column label="操作" width="300">
  75. <template slot-scope="scope">
  76. <el-button type="info" @click="getBtnById(scope.row.id)">查看</el-button>
  77. <el-button type="warning" @click="editById(scope.row)">评论</el-button>
  78. </template>
  79. </el-table-column>
  80. </el-table>
  81. <!--分页-->
  82. <div class="mt_15">
  83. <el-pagination
  84. @size-change="handleSizeChange"
  85. @current-change="handleCurrentChange"
  86. :current-page="searchParm.page"
  87. :page-sizes="[10, 20, 30, 40, 50]"
  88. :page-size="searchParm.pageSize"
  89. layout="total, sizes, prev, pager, next, jumper"
  90. :total="total">
  91. </el-pagination>
  92. </div>
  93. <!--新增弹窗-->
  94. <el-dialog :visible.sync="dialogAddVisible" :title="dialogAddTitle" center width="45%">
  95. <div class="dialog-content">
  96. <el-form ref="addParm" size="small" :model="addParm" :rules="rules" label-width="130px">
  97. <el-form-item label="公司" prop="companyId">
  98. <el-select v-model.trim="addParm.companyId" placeholder="请选择">
  99. <el-option
  100. v-for="item in companys"
  101. :key="item.name"
  102. :label="item.name"
  103. :value="item.id"
  104. ></el-option>
  105. </el-select>
  106. </el-form-item>
  107. <el-form-item label="总金额" prop="amount">
  108. <el-input v-model.trim="addParm.amount" clearable></el-input>
  109. </el-form-item>
  110. <el-form-item label="状态描述" prop="paymentResults">
  111. <el-input v-model.trim="addParm.paymentResults" clearable></el-input>
  112. </el-form-item>
  113. <el-form-item label="购买数量" prop="pricesNumber">
  114. <el-input v-model.trim="addParm.pricesNumber" clearable></el-input>
  115. </el-form-item>
  116. <el-form-item label="商品名称" prop="shopName">
  117. <el-input v-model.trim="addParm.shopName" clearable></el-input>
  118. </el-form-item>
  119. <el-form-item label="时间" prop="orderDate">
  120. <el-input v-model.trim="addParm.orderDate" clearable></el-input>
  121. </el-form-item>
  122. <el-form-item label="店铺名称" prop="shop">
  123. <el-input v-model.trim="addParm.shop" clearable></el-input>
  124. </el-form-item>
  125. <el-form-item label="订单id" prop="orderId">
  126. <el-input v-model.trim="addParm.orderId" clearable></el-input>
  127. </el-form-item>
  128. <el-form-item label="评论" prop="comment">
  129. <el-input v-model.trim="addParm.comment" clearable></el-input>
  130. </el-form-item>
  131. <el-input v-model.trim="addParm.paths" type="hidden" clearable></el-input>
  132. <el-upload
  133. class="upload-demo"
  134. :data = "updateFileType"
  135. :action="uploadFileImgUrl"
  136. :on-preview="handlePreview"
  137. :headers="uploadHeaders"
  138. :on-remove="handleRemove"
  139. :on-success="uploadImgSuccess"
  140. :before-upload="beforeImgUpload"
  141. :before-remove="beforeRemove"
  142. :file-list="fileList"
  143. list-type="picture">
  144. <el-button size="small" type="primary">点击上传</el-button>
  145. <div slot="tip" class="el-upload__tip">只能上传img/jpg/png/jpeg文件,且不超过5M</div>
  146. </el-upload>
  147. </el-form>
  148. </div>
  149. <span slot="footer">
  150. <el-button type="info" @click="sureAddCancle('addParm')">取消</el-button>
  151. <el-button type="primary" @click="sureAdd('addParm')">确认</el-button>
  152. </span>
  153. </el-dialog>
  154. <!--评论弹窗-->
  155. <el-dialog :visible.sync="dialogEditVisible" :title="dialogEditTitle" center width="45%">
  156. <div class="dialog-content">
  157. <el-form ref="editParm" size="small" :model="editParm" :rules="rules" label-width="130px">
  158. <el-form-item label="评论" prop="accountcommentName">
  159. <el-input v-model.trim="editParm.comment" clearable></el-input>
  160. </el-form-item>
  161. </el-form>
  162. <el-input v-model.trim="editParm.paths" type="hidden" clearable></el-input>
  163. <el-upload
  164. class="upload-demo"
  165. :data = "updateFileType"
  166. :action="uploadFileImgUrl"
  167. :on-preview="handlePreview"
  168. :headers="uploadHeaders"
  169. :on-remove="handleRemove"
  170. :on-success="uploadImgSuccess"
  171. :before-upload="beforeImgUpload"
  172. :before-remove="beforeRemove"
  173. :file-list="fileList"
  174. list-type="picture">
  175. <el-button size="small" type="primary">点击上传</el-button>
  176. <div slot="tip" class="el-upload__tip">只能上传img/jpg/png/jpeg文件,且不超过5M</div>
  177. </el-upload>
  178. </div>
  179. <span slot="footer">
  180. <el-button type="info" @click="sureEditCancle('editParm')">取消</el-button>
  181. <el-button type="primary" @click="sureEdit('editParm')">确认</el-button>
  182. </span>
  183. </el-dialog>
  184. <!--详情弹窗-->
  185. <el-dialog :visible.sync="dialogDetailVisible" :title="dialogDetailTitle" center width="45%">
  186. <div class="dialog-content">
  187. <el-form ref="form" size="small" label-width="130px">
  188. <el-form-item label="公司" prop="companyId">
  189. <el-select v-model.trim="detailParm.companyId" disabled>
  190. <el-option
  191. v-for="item in companys"
  192. :key="item.name"
  193. :label="item.name"
  194. :value="item.id"
  195. ></el-option>
  196. </el-select>
  197. </el-form-item>
  198. <el-form-item label="总金额" prop="amount">
  199. <el-input v-model.trim="detailParm.amount" disabled></el-input>
  200. </el-form-item>
  201. <el-form-item label="店铺名称" prop="shop">
  202. <el-input v-model.trim="detailParm.shop" disabled></el-input>
  203. </el-form-item>
  204. <el-form-item label="商品名称" prop="shopName">
  205. <el-input v-model.trim="detailParm.shopName" disabled></el-input>
  206. </el-form-item>
  207. <el-form-item label="订单id" prop="orderId">
  208. <el-input v-model.trim="detailParm.orderId" disabled></el-input>
  209. </el-form-item>
  210. <el-form-item label="评论" prop="comment">
  211. <el-input v-model.trim="detailParm.comment" disabled></el-input>
  212. </el-form-item>
  213. <el-form-item label="时间" prop="orderDate">
  214. <el-input v-model.trim="detailParm.orderDate" disabled></el-input>
  215. </el-form-item>
  216. <el-upload
  217. class="upload-demo"
  218. :data = "updateFileType"
  219. :action="uploadFileImgUrl"
  220. :on-preview="handlePreview"
  221. :headers="uploadHeaders"
  222. :on-remove="handleRemove"
  223. :on-success="uploadImgSuccess"
  224. :file-list="fileList"
  225. list-type="picture">
  226. </el-upload>
  227. </el-form>
  228. </div>
  229. </el-dialog>
  230. <!--订单信息导入 importBtn-->
  231. <el-dialog :visible.sync="dialogImportVisible" :title="dialogImportTitle" center width="23%">
  232. <div class="dialog-content">
  233. <el-upload
  234. class="upload-demo"
  235. drag
  236. ref="upload"
  237. :action="uploadFileUrl"
  238. :headers="uploadHeaders"
  239. :show-file-list = "false"
  240. :on-success="uploadSuccess"
  241. :before-remove="beforeRemove"
  242. :before-upload="beforeAvatarUpload"
  243. multiple>
  244. <i class="el-icon-upload"></i>
  245. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  246. <div class="el-upload__tip" slot="tip">只能上传Excel文件,且不超过5M</div>
  247. </el-upload>
  248. </div>
  249. </el-dialog>
  250. </div>
  251. </template>
  252. <script>
  253. import { add, getDetailById, commentFun, getList } from '@/api/group/clickOrder';
  254. import { getAll } from "@/api/group/company";
  255. import { doMainName } from "@/api/group/fileUpload";
  256. export default {
  257. filters: {
  258. // getStatus: function (value) {
  259. // // 状态 1.待执行 2.执行中 3.执行成功 4.执行失败
  260. // if(value == 1) {
  261. // return '待执行';
  262. // } else if (value == 2) {
  263. // return '执行中';
  264. // } else if (value == 3) {
  265. // return '执行成功';
  266. // } else if(value == 4) {
  267. // return '执行失败';
  268. // } else {
  269. // return '执行失败';
  270. // }
  271. // },
  272. getListType: function (value) {
  273. // 类型:1.导入 2.刷单
  274. if(value == 1) {
  275. return '导入';
  276. } else if (value == 2) {
  277. return '刷单';
  278. }
  279. }
  280. },
  281. // 数据
  282. data() {
  283. return {
  284. searchParm: {
  285. page: 1,
  286. pageSize: 10,
  287. sort:'created_at',
  288. order:'desc',
  289. accountName:null,
  290. robotClientUuid:null,
  291. sTime: null,
  292. eTime: null,
  293. shop: null,
  294. orderId: null,
  295. companyId: null,
  296. type: null,
  297. status: null
  298. },
  299. total:0,
  300. list: [],
  301. fileList:[],
  302. doMainNameUrl: null,
  303. typeList: [
  304. {
  305. id: 1,
  306. name: "导入"
  307. },
  308. {
  309. id: 2,
  310. name: "刷单"
  311. }
  312. ],
  313. statusList: [
  314. {
  315. id: 1,
  316. name: "待执行"
  317. },
  318. {
  319. id: 2,
  320. name: "执行中"
  321. },
  322. {
  323. id: 3,
  324. name: "执行成功"
  325. },
  326. {
  327. id: 4,
  328. name: "执行失败"
  329. }
  330. ],
  331. uploadHeaders:{ Authorization: this.$store.getters.token },
  332. dialogAddVisible: false,
  333. dialogAddTitle: '新增',
  334. dialogDetailVisible: false,
  335. dialogDetailTitle: '详情',
  336. dialogEditVisible: false,
  337. dialogEditTitle: '修改',
  338. dialogImportVisible: false,
  339. dialogImportTitle:'导入',
  340. searchTime: "",
  341. updateFileType: {type: 12},
  342. uploadFileImgUrl: process.env.VUE_APP_BASE_API + '/api/file/uploadFile',
  343. uploadFileUrl: process.env.VUE_APP_BASE_API + '/api/clickOrder/import',
  344. tempUrl: process.env.VUE_APP_BASE_API + '/api/clickOrder/exportTemp',
  345. fileImages:{
  346. name: null,
  347. url: null
  348. },
  349. addParm: {
  350. id:null,
  351. companyId:null,
  352. paymentResults:null,
  353. pricesNumber:null,
  354. shopName:null,
  355. orderDate:null,
  356. amount:null,
  357. shop:null,
  358. orderId:null,
  359. comment:null,
  360. paths: []
  361. },
  362. detailParm: {
  363. id:null,
  364. companyId:null,
  365. amount:null,
  366. shop:null,
  367. shopName: null,
  368. orderDate: null,
  369. orderId:null,
  370. comment:null,
  371. paths:[]
  372. },
  373. editParm: {
  374. id:null,
  375. comment:null,
  376. paths:[]
  377. },
  378. companys: [],
  379. rules: {
  380. companyId: [
  381. { required: true, message: '请输入公司', trigger: 'blur' }
  382. ],
  383. amount: [
  384. { required: true, message: '请输入总金额', trigger: 'blur' }
  385. ],
  386. paymentResults: [
  387. { required: true, message: '请输入状态描述', trigger: 'blur' }
  388. ],
  389. pricesNumber: [
  390. { required: true, message: '请输入购买数量', trigger: 'blur' }
  391. ],
  392. shopName: [
  393. { required: true, message: '请输入商品名称', trigger: 'blur' }
  394. ],
  395. shop: [
  396. { required: true, message: '请输入店铺名称', trigger: 'blur' }
  397. ],
  398. orderDate: [
  399. { required: true, message: '请输入时间', trigger: 'blur' }
  400. ],
  401. orderId: [
  402. { required: true, message: '请输入订单ID', trigger: 'blur' }
  403. ]
  404. },
  405. }
  406. },
  407. // 调用
  408. created() {
  409. this.getFileDoMainName();
  410. this.getCompanyAll();
  411. this.goSearch();
  412. this.fileList = [];
  413. },
  414. //方法
  415. methods: {
  416. // 图片上传
  417. handleRemove(file, fileList) {
  418. console.log(fileList)
  419. this.editParm.paths = [];
  420. for (let i = 0; i < fileList.length; i++) {
  421. const imgUrl = fileList[i].url;
  422. if (imgUrl.includes("/file/")) {
  423. imgUrl = imgUrl.substring(imgUrl.lastIndexOf("\/file\/") + 5, imgUrl.length);
  424. this.editParm.paths.push(imgUrl);
  425. }
  426. }
  427. },
  428. handlePreview(file) {
  429. console.log("======handlePreview=======");
  430. console.log(file);
  431. },
  432. uploadImgSuccess(res, file) {
  433. if(res.code==200) {
  434. const index = res.data.list[0].path.lastIndexOf("\/");
  435. this.fileImages.name = res.data.list[0].path.substring(index + 1, res.data.list[0].path.length);
  436. this.fileImages.url = this.doMainNameUrl + res.data.list[0].path;
  437. this.editParm.paths.push(res.data.list[0].path);
  438. }
  439. },
  440. //重置
  441. resetForm() {
  442. this.searchParm.shop = null;
  443. this.searchParm.orderId = null;
  444. this.searchParm.companyId = null;
  445. this.searchParm.type = null;
  446. this.searchParm.status = null;
  447. this.searchTime = "";
  448. this.goSearch();
  449. },
  450. // 获取所有公司信息
  451. getCompanyAll() {
  452. getAll()
  453. .then(res => {
  454. if (res.code == 200) {
  455. this.companys = res.data;
  456. }
  457. })
  458. .catch(() => {});
  459. },
  460. // 评论截取
  461. commentSub(row, column) {
  462. if (row['comment'] != "undefined" && row['comment'] != null && row['comment'] != "" && row['comment'] != "null" && row['comment'] != "NULL") {
  463. return row['comment'].slice(0,3) + "...";
  464. }
  465. },
  466. // 查询
  467. goSearch() {
  468. this.searchParm.sTime = this.searchTime[0];
  469. this.searchParm.eTime = this.searchTime[1];
  470. this.searchParm.page=1
  471. this.getDataList()
  472. },
  473. // 获取图片域名请求url fileDoMainName
  474. getFileDoMainName() {
  475. doMainName().then(res => {
  476. if(res.code==200) {
  477. this.doMainNameUrl = res.data;
  478. }
  479. }).catch(err => {
  480. console.log(err)
  481. })
  482. },
  483. //导入成功
  484. uploadSuccess(res, file) {
  485. this.dialogImportVisible = false;
  486. if(res.code==200) {
  487. if(res.data == true) {
  488. this.$message.success('导入成功!');
  489. }
  490. else{
  491. window.location.href = res.data;
  492. this.$message.error('导入失败!');
  493. }
  494. }
  495. this.goSearch();
  496. },
  497. beforeAvatarUpload(file) {
  498. console.log(file);
  499. const isLt10M = file.size / 1024 / 1024 <10;
  500. if (!isLt10M) {
  501. this.$message.error('上传Excel文件大小不能超过 10MB!');
  502. }
  503. return isLt10M;
  504. },
  505. beforeRemove(file, fileList) {
  506. return this.$confirm(`确定移除 ${ file.name }?`);
  507. },
  508. beforeImgUpload(file) {
  509. console.log(file);
  510. const isXlsImg = file.type === 'image/img';
  511. const isXlsJpg = file.type === 'image/jpg';
  512. const isXlsPng = file.type === 'image/png';
  513. const isXlsJpeg = file.type === 'image/jpeg';
  514. console.log("isXlsImg:" + isXlsImg);
  515. console.log("isXlsJpg:" + isXlsJpg);
  516. console.log("isXlsPng:" + isXlsPng);
  517. console.log("isXlsJpeg:" + isXlsJpeg);
  518. const isLt10M = file.size / 1024 / 1024 < 5;
  519. const isXls = true;
  520. if (!isXlsImg && !isXlsJpg && !isXlsPng && !isXlsJpeg) {
  521. this.$message.error('上传头像图片只能是img/jpg/png/jpeg 格式!');
  522. isXls = false;
  523. }
  524. const isLt5M = file.size / 1024 / 1024 <5;
  525. if (!isLt5M) {
  526. this.$message.error('上传Excel文件大小不能超过 5MB!');
  527. }
  528. return isXls && isLt5M;
  529. },
  530. // 导入
  531. importBtn() {
  532. this.dialogImportVisible = true
  533. },
  534. //机器人模板
  535. exportTempBtn() {
  536. console.log(this.tempUrl)
  537. window.location.href = this.tempUrl;
  538. },
  539. // 新增
  540. addBtn(){
  541. this.addParm = {
  542. id:null,
  543. companyId:null,
  544. account:null,
  545. pwd:null,
  546. amount:null,
  547. shop:null,
  548. orderId:null,
  549. comment:null,
  550. paths: []
  551. }
  552. this.fileList = []
  553. this.dialogAddTitle='新增'
  554. this.dialogAddVisible = true;
  555. this.$refs.addParm.clearValidate();
  556. },
  557. // 修改
  558. editById(data){
  559. this.fileList = [];
  560. this.editParm.paths = [];
  561. this.editParm.comment = null;
  562. getDetailById({id: data.id}).then(res => {
  563. if(res.code==200) {
  564. this.editParm.id = res.data.id;
  565. this.editParm.comment = res.data.comment;
  566. if (res.data.paths != "undefined" && res.data.paths != null && res.data.paths != "" &&res.data.paths != "null" && res.data.paths != "NULL") {
  567. this.editParm.paths = res.data.paths.split(',');
  568. this.fileList = res.data.paths.split(',').map(val => {
  569. // return {url:"http://localhost:8008/file" + val}
  570. return {name: val.substring(val.lastIndexOf("\/") + 1, val.length), url: this.doMainNameUrl + val}
  571. console.log("url:" + val);
  572. })
  573. console.log(this.fileList)
  574. }
  575. console.log("this.editParm.paths:" + this.editParm.paths);
  576. this.dialogEditVisible = true
  577. this.$refs.editParm.clearValidate();
  578. }
  579. }).catch(err => {
  580. console.log(err)
  581. })
  582. },
  583. // 确认修改
  584. sureEdit(editParm){
  585. this.$refs[editParm].validate((valid) => {
  586. if (valid) {
  587. this.$refs.editParm.clearValidate();
  588. this.editParm.paths = this.editParm.paths.toString()
  589. commentFun(this.editParm).then(res => {
  590. if(res.code==200) {
  591. console.log(res)
  592. this.dialogEditVisible = false
  593. this.$message.success('修改成功!')
  594. this.getDataList()
  595. }
  596. }).catch(err => {
  597. console.log(err)
  598. })
  599. } else {
  600. console.log('error submit!!');
  601. return false;
  602. }
  603. });
  604. },
  605. sureAddCancle(editParm) {
  606. this.dialogEditVisible=flase
  607. this.$refs.editParm.clearValidate();
  608. },
  609. // 确认新增
  610. sureAdd(addParm){
  611. this.$refs[addParm].validate((valid) => {
  612. if (valid) {
  613. this.$refs.addParm.clearValidate();
  614. this.addParm.paths = this.addParm.paths.toString()
  615. console.log(this.addParm)
  616. add(this.addParm).then(res => {
  617. if(res.code==200) {
  618. this.dialogAddVisible = false
  619. this.$message.success('新增成功!')
  620. this.getDataList()
  621. }
  622. }).catch(err => {
  623. console.log(err)
  624. })
  625. } else {
  626. console.log('error submit!!');
  627. return false;
  628. }
  629. });
  630. },
  631. sureAddCancle(addParm) {
  632. this.dialogAddVisible=flase
  633. this.$refs.addParm.clearValidate();
  634. },
  635. // 查看根据id
  636. getBtnById(id){
  637. getDetailById({id}).then(res => {
  638. if(res.code==200) {
  639. this.detailParm.id = res.data.id;
  640. this.detailParm.companyId = res.data.companyId;
  641. this.detailParm.amount = res.data.amount;
  642. this.detailParm.shop = res.data.shop;
  643. this.detailParm.orderId = res.data.orderId;
  644. this.detailParm.comment = res.data.comment;
  645. this.detailParm.shopName = res.data.shopName;
  646. this.detailParm.orderDate = res.data.orderDate;
  647. this.detailParm.paths = res.data.paths;
  648. this.fileList = [];
  649. if (res.data.paths != "undefined" && res.data.paths != null && res.data.paths != "" &&res.data.paths != "null" && res.data.paths != "NULL") {
  650. this.detailParm.paths = res.data.paths.split(',');
  651. }
  652. if (this.detailParm.paths != "undefined" && this.detailParm.paths != null && this.detailParm.paths != "" && this.detailParm.paths != "null" && this.detailParm.paths != "NULL") {
  653. this.detailParm.paths = res.data.paths.split(',')
  654. this.fileList = res.data.paths.split(',').map(val => {
  655. // return {url:"http://localhost:8008/file" + val}
  656. return {name: val.substring(val.lastIndexOf("\/") + 1, val.length), url: this.doMainNameUrl + val}
  657. })
  658. console.log(this.fileList)
  659. }
  660. this.dialogDetailVisible = true;
  661. }
  662. }).catch(err => {
  663. console.log(err)
  664. })
  665. },
  666. // 分页获取表格数据
  667. getDataList(){
  668. getList(this.searchParm).then(res => {
  669. console.log(res)
  670. if(res.code==200) {
  671. console.log(res)
  672. this.list = res.data.list;
  673. this.total = res.data.total;
  674. }
  675. }).catch(err => {
  676. console.log(err)
  677. })
  678. },
  679. // 分页
  680. handleSizeChange(val) {
  681. console.log(`每页 ${val} 条`);
  682. this.searchParm.pageSize = val;
  683. this.getDataList();
  684. },
  685. handleCurrentChange(val) {
  686. console.log(`当前页: ${val}`);
  687. this.searchParm.page = val;
  688. this.getDataList();
  689. }
  690. }
  691. }
  692. </script>
  693. <style rel="stylesheet/scss" lang="scss" scoped>
  694. </style>