logistics_list.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. <template>
  2. <div class="app-container">
  3. <!-- 筛选条件 -->
  4. <div>
  5. <el-form
  6. ref="screenForm"
  7. :model="screenForm"
  8. label-width="70px"
  9. size="small"
  10. label-position="left"
  11. >
  12. <el-row :gutter="20">
  13. <el-col :xs="24" :sm="12" :lg="6">
  14. <el-form-item label="物流公司" prop="customerTel">
  15. <el-input
  16. placeholder="请输入物流公司名称"
  17. v-model="screenForm.customerTel"
  18. ></el-input>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :xs="24" :sm="12" :lg="6">
  22. <el-form-item label="客服电话" prop="logisticsCompany">
  23. <el-input
  24. placeholder="请输入客服电话"
  25. v-model="screenForm.logisticsCompany"
  26. ></el-input>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :xs="24" :sm="12" :lg="12" class="tr">
  30. <el-form-item label="">
  31. <el-button size="small" @click="resetScreenForm">清空</el-button>
  32. <el-button size="small" type="primary" @click="submitScreenForm"
  33. >搜索</el-button
  34. >
  35. </el-form-item>
  36. </el-col>
  37. </el-row>
  38. </el-form>
  39. </div>
  40. <!-- 按钮 -->
  41. <div class="btn-group clearfix">
  42. <div class="fl">
  43. <el-button type="primary" size="small" @click="hanleAdd"
  44. >新增</el-button
  45. >
  46. <el-popconfirm
  47. confirm-button-text="好的"
  48. cancel-button-text="不用了"
  49. icon="el-icon-info"
  50. icon-color="red"
  51. title="内容确定删除吗?"
  52. @onConfirm="hanleDelete"
  53. >
  54. <el-button
  55. type="primary"
  56. size="small"
  57. slot="reference"
  58. class="el-popover-left"
  59. >删除</el-button
  60. >
  61. </el-popconfirm>
  62. </div>
  63. <div class="fr">
  64. <!-- <ExportButton :exUrl="'/logistics/export'" :exParams="exParams" /> -->
  65. <el-button type="primary" size="small" @click="handleExport"
  66. >导出</el-button
  67. >
  68. <el-button type="primary" size="small" @click="hanlePrint"
  69. >打印</el-button
  70. >
  71. </div>
  72. </div>
  73. <!-- 列表 -->
  74. <div class="mymain-container">
  75. <div class="table">
  76. <el-table
  77. v-loading="listLoading"
  78. :data="dataList"
  79. element-loading-text="Loading"
  80. @select="hanleSelect"
  81. @select-all="hanleSelectAll"
  82. border
  83. fit
  84. highlight-current-row
  85. stripe
  86. >
  87. <el-table-column type="selection" align="center"></el-table-column>
  88. <el-table-column
  89. align="center"
  90. label="物流公司名称"
  91. prop="logisticsCompany"
  92. min-width="160"
  93. show-overflow-tooltip
  94. >
  95. </el-table-column>
  96. <el-table-column
  97. align="center"
  98. label="物流公司代码"
  99. prop="logisticsNumber"
  100. min-width="160"
  101. show-overflow-tooltip
  102. >
  103. </el-table-column>
  104. <el-table-column
  105. align="center"
  106. label="提货人"
  107. prop="pickName"
  108. min-width="160"
  109. show-overflow-tooltip
  110. >
  111. </el-table-column>
  112. <el-table-column
  113. align="center"
  114. label="提货人电话"
  115. prop="pickTel"
  116. min-width="160"
  117. show-overflow-tooltip
  118. >
  119. </el-table-column>
  120. <el-table-column
  121. align="center"
  122. label="客服电话"
  123. prop="customerTel"
  124. min-width="160"
  125. show-overflow-tooltip
  126. >
  127. </el-table-column>
  128. <el-table-column
  129. align="center"
  130. label="创建人"
  131. prop="createBy"
  132. min-width="160"
  133. show-overflow-tooltip
  134. >
  135. </el-table-column>
  136. <el-table-column
  137. align="center"
  138. label="创建时间"
  139. prop="createTime"
  140. min-width="160"
  141. show-overflow-tooltip
  142. >
  143. </el-table-column>
  144. <el-table-column
  145. align="center"
  146. label="更新人"
  147. prop="updateBy"
  148. min-width="160"
  149. show-overflow-tooltip
  150. >
  151. </el-table-column>
  152. <el-table-column
  153. align="center"
  154. label="更新时间"
  155. prop="updateTime"
  156. min-width="160"
  157. show-overflow-tooltip
  158. >
  159. </el-table-column>
  160. <el-table-column
  161. align="center"
  162. label="操作"
  163. min-width="160"
  164. show-overflow-tooltip
  165. >
  166. <template slot-scope="scope">
  167. <el-button
  168. type="text"
  169. class="textColor"
  170. @click="hanleDetail(scope.row)"
  171. >详情</el-button
  172. >
  173. <el-button
  174. type="text"
  175. class="textColor"
  176. @click="editFn(scope.row.id, scope.row)"
  177. >编辑</el-button
  178. >
  179. <el-popconfirm
  180. confirm-button-text="好的"
  181. cancel-button-text="不用了"
  182. icon="el-icon-info"
  183. icon-color="red"
  184. title="内容确定删除吗?"
  185. @onConfirm="hanleDelete(scope.row.id)"
  186. >
  187. <el-button
  188. slot="reference"
  189. type="text"
  190. class="textColor el-popover-left"
  191. >删除</el-button
  192. >
  193. </el-popconfirm>
  194. </template>
  195. </el-table-column>
  196. </el-table>
  197. </div>
  198. <!-- 分页 -->
  199. <div class="fr">
  200. <el-pagination
  201. @size-change="handleSizeChange"
  202. @current-change="handleCurrentChange"
  203. :current-page="currentPage"
  204. :page-sizes="[10, 20, 30, 50]"
  205. :page-size="10"
  206. layout="total, sizes, prev, pager, next, jumper"
  207. :total="listTotal"
  208. >
  209. </el-pagination>
  210. </div>
  211. </div>
  212. <!-- 弹窗 -->
  213. <el-dialog
  214. title="提货车辆档案"
  215. :visible.sync="showDialogForm"
  216. width="30%"
  217. :show-close="false"
  218. :close-on-click-modal="false"
  219. >
  220. <el-form ref="form" :model="diaLogForm" label-width="100px">
  221. <el-form-item label="物流公司名称">
  222. <el-input v-model="diaLogForm.logisticsCompany"></el-input>
  223. </el-form-item>
  224. <el-form-item label="物流公司代码">
  225. <el-input v-model="diaLogForm.logisticsNumber"></el-input>
  226. </el-form-item>
  227. <el-form-item label="提货人">
  228. <el-input v-model="diaLogForm.pickName"></el-input>
  229. </el-form-item>
  230. <el-form-item label="提货人电话">
  231. <el-input v-model="diaLogForm.pickTel"></el-input>
  232. </el-form-item>
  233. <el-form-item label="客服电话">
  234. <el-input v-model="diaLogForm.customerTel"></el-input>
  235. </el-form-item>
  236. </el-form>
  237. <div slot="footer" class="dialog-footer">
  238. <el-button @click="hanleCancel">取 消</el-button>
  239. <el-button type="primary" @click="handelInfo">确 定</el-button>
  240. </div>
  241. </el-dialog>
  242. </div>
  243. </template>
  244. <script>
  245. import Mixin from "@/mixin/index";
  246. import {
  247. getLogisticsList,
  248. addInof,
  249. updateInfo,
  250. deleteInfo,
  251. } from "@/api/basic_data/logistics";
  252. import { downloadFiles } from "@/utils/util";
  253. export default {
  254. mixins: [Mixin],
  255. data() {
  256. return {
  257. type: 1, // 1 ,2, 3
  258. diaLogForm: {
  259. id: null,
  260. customerTel: "",
  261. logisticsCompany: "",
  262. logisticsNumber: "",
  263. pickName: "",
  264. pickTel: "",
  265. },
  266. showDialogForm: false,
  267. screenForm: {
  268. name: "",
  269. username: "",
  270. telephone: "",
  271. customerTel: "",
  272. logisticsCompany: "",
  273. },
  274. ids: [],
  275. };
  276. },
  277. methods: {
  278. //显示新增弹框
  279. hanleAdd() {
  280. this.type = 2;
  281. this.showDialogForm = true;
  282. },
  283. //显示编辑,编辑数据初始化
  284. editFn(id, row) {
  285. this.type = 1;
  286. this.diaLogForm = {
  287. id,
  288. customerTel: row.customerTel,
  289. logisticsCompany: row.logisticsCompany,
  290. logisticsNumber: row.logisticsNumber,
  291. pickName: row.pickName,
  292. pickTel: row.pickTel,
  293. };
  294. this.showDialogForm = true;
  295. },
  296. // 初始化数据
  297. getList() {
  298. this.listLoading = true;
  299. let params = {
  300. pageNum: this.currentPage,
  301. pageSize: this.pageSize,
  302. customerTel: this.screenForm.customerTel,
  303. logisticsCompany: this.screenForm.logisticsCompany,
  304. };
  305. getLogisticsList(params).then((res) => {
  306. this.dataList = res.data.records;
  307. this.listTotal = res.data.total;
  308. this.listLoading = false;
  309. console.log(this.dataList, 1233);
  310. });
  311. },
  312. //新增数据或者编辑数据请求接口 type 1 为编辑 type 2 新增
  313. handelInfo() {
  314. if (this.type === 1) {
  315. const params = {
  316. ...this.diaLogForm,
  317. };
  318. updateInfo(params).then((res) => {
  319. this.$successMsg("编辑成功");
  320. this.showDialogForm = false;
  321. this.getList();
  322. this.hanleCancel();
  323. });
  324. this.diaLogForm.id = null;
  325. } else if (this.type === 2) {
  326. addInof(this.diaLogForm).then((res) => {
  327. this.$successMsg("保存成功");
  328. this.showDialogForm = false;
  329. this.hanleCancel();
  330. this.getList();
  331. });
  332. } else {
  333. this.showDialogForm = false;
  334. }
  335. },
  336. //查看详情
  337. hanleDetail(detail) {
  338. this.type = 3;
  339. this.showDialogForm = true;
  340. this.diaLogForm = detail;
  341. this.hanleCancel();
  342. },
  343. // 导出文档
  344. handleExport() {
  345. let screenData = {
  346. customerTel: this.diaLogForm.customerTel,
  347. logisticsCompany: this.diaLogForm.logisticsCompany,
  348. };
  349. downloadFiles("/logistics/export", screenData);
  350. },
  351. // 筛选部分数据或者单个
  352. hanleSelect(selection) {
  353. this.ids = selection.map((k) => {
  354. return k.id;
  355. });
  356. },
  357. // 删除数据
  358. hanleDelete(id) {
  359. this.hanleDeleteAllPromise(id).then((ids) => {
  360. deleteInfo(ids).then(() => {
  361. this.$successMsg("删除成功");
  362. this.getList();
  363. });
  364. });
  365. },
  366. // 取消按钮重置数据
  367. hanleCancel() {
  368. this.diaLogForm = {
  369. id: null,
  370. customerTel: "",
  371. logisticsCompany: "",
  372. logisticsNumber: "",
  373. pickName: "",
  374. pickTel: "",
  375. };
  376. this.showDialogForm = false;
  377. },
  378. },
  379. };
  380. </script>
  381. <style lang="scss" scoped>
  382. .textColor {
  383. color: black;
  384. }
  385. ::v-deep .el-date-editor {
  386. width: 100%;
  387. }
  388. ::v-deep .el-select {
  389. width: 100%;
  390. }
  391. ::v-deep .el-col-9 .el-button {
  392. padding: 5px;
  393. }
  394. ::v-deep .el-dialog__header {
  395. background-color: #dddddd;
  396. }
  397. .base {
  398. padding: 20px 20px 0;
  399. }
  400. .table {
  401. margin-top: 12px;
  402. }
  403. .right {
  404. float: right;
  405. }
  406. </style>