companyMsg.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <template>
  2. <div class="mod-companyMsg app-container">
  3. <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
  4. <el-form-item>
  5. <el-input v-model="dataForm.fName" placeholder="公司名称" clearable></el-input>
  6. </el-form-item>
  7. <el-form-item>
  8. <el-input v-model="dataForm.fManage" placeholder="联系人" clearable></el-input>
  9. </el-form-item>
  10. <el-form-item>
  11. <el-input v-model="dataForm.fTel" placeholder="联系电话" clearable></el-input>
  12. </el-form-item>
  13. <el-form-item>
  14. <el-button type="cyan" icon="el-icon-search" size="mini" @click="getDataList">搜索</el-button>
  15. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  16. </el-form-item>
  17. <el-row :gutter="10" class="mb8">
  18. <el-col :span="1.5">
  19. <el-button
  20. type="primary"
  21. icon="el-icon-plus"
  22. size="mini"
  23. @click="addOrUpdateHandle()"
  24. >新增
  25. </el-button>
  26. </el-col>
  27. <!-- <el-col :span="1.5">-->
  28. <!-- <el-button-->
  29. <!-- type="success"-->
  30. <!-- icon="el-icon-edit"-->
  31. <!-- size="mini"-->
  32. <!-- :disabled="single"-->
  33. <!-- @click="handleUpdate"-->
  34. <!-- v-hasPermi="['basicdata:corps:edit']"-->
  35. <!-- >修改</el-button>-->
  36. <!-- </el-col>-->
  37. <!-- <el-col :span="1.5">-->
  38. <!-- <el-button-->
  39. <!-- type="danger"-->
  40. <!-- icon="el-icon-delete"-->
  41. <!-- size="mini"-->
  42. <!-- :disabled="multiple"-->
  43. <!-- @click="handleDelete"-->
  44. <!-- v-hasPermi="['basicdata:corps:remove']"-->
  45. <!-- >删除</el-button>-->
  46. <!-- </el-col>-->
  47. <!-- <el-col :span="1.5">-->
  48. <!-- <el-button-->
  49. <!-- type="warning"-->
  50. <!-- icon="el-icon-download"-->
  51. <!-- size="mini"-->
  52. <!-- @click="handleExport"-->
  53. <!-- v-hasPermi="['basicdata:corps:export']"-->
  54. <!-- >导出</el-button>-->
  55. <!-- </el-col>-->
  56. <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
  57. </el-row>
  58. </el-form>
  59. <el-table
  60. :data="dataList"
  61. stripe
  62. v-loading="dataListLoading"
  63. @selection-change="selectionChangeHandle"
  64. >
  65. <el-table-column
  66. type="selection"
  67. header-align="center"
  68. align="center"
  69. width="50"
  70. >
  71. </el-table-column>
  72. <el-table-column
  73. prop="fName"
  74. header-align="center"
  75. align="center"
  76. width="120"
  77. :show-overflow-tooltip="true"
  78. label="公司名称"
  79. >
  80. </el-table-column>
  81. <el-table-column
  82. prop="fAddr"
  83. header-align="center"
  84. align="center"
  85. width="150"
  86. :show-overflow-tooltip="true"
  87. label="公司地址"
  88. >
  89. </el-table-column>
  90. <el-table-column
  91. prop="fBankname"
  92. header-align="center"
  93. align="center"
  94. width="150"
  95. label="公司开户行"
  96. >
  97. </el-table-column>
  98. <el-table-column
  99. prop="fBankno"
  100. header-align="center"
  101. align="center"
  102. width="150"
  103. :show-overflow-tooltip="true"
  104. label="银行账号"
  105. >
  106. </el-table-column>
  107. <el-table-column
  108. prop="creditLv"
  109. header-align="center"
  110. align="center"
  111. width="150"
  112. label="信用等级"
  113. >
  114. </el-table-column>
  115. <el-table-column
  116. prop="paymentDays"
  117. header-align="center"
  118. align="center"
  119. label="账期天数"
  120. >
  121. </el-table-column>
  122. <el-table-column
  123. prop="fManage"
  124. header-align="center"
  125. align="center"
  126. label="联系人"
  127. >
  128. </el-table-column>
  129. <el-table-column
  130. prop="fTel"
  131. header-align="center"
  132. align="center"
  133. width="150"
  134. label="联系电话"
  135. >
  136. </el-table-column>
  137. <el-table-column
  138. prop="fFax"
  139. header-align="center"
  140. align="center"
  141. label="传真"
  142. >
  143. </el-table-column>
  144. <el-table-column
  145. prop="fEmail"
  146. header-align="center"
  147. align="center"
  148. label="Email"
  149. >
  150. </el-table-column>
  151. <el-table-column
  152. prop="headOffice"
  153. header-align="center"
  154. align="center"
  155. width="150"
  156. label="总公司名称"
  157. >
  158. </el-table-column>
  159. <el-table-column
  160. fixed="right"
  161. header-align="center"
  162. align="center"
  163. width="130"
  164. label="操作"
  165. >
  166. <template slot-scope="scope">
  167. <el-button
  168. size="mini"
  169. type="text"
  170. icon="el-icon-edit"
  171. @click="addOrUpdateHandle(scope.row)"
  172. >查看
  173. </el-button>
  174. <el-button
  175. size="mini"
  176. type="text"
  177. icon="el-icon-delete"
  178. @click="deleteHandle(scope.row.fId)"
  179. >删除
  180. </el-button>
  181. </template>
  182. </el-table-column>
  183. </el-table>
  184. <el-pagination
  185. @size-change="sizeChangeHandle"
  186. @current-change="currentChangeHandle"
  187. :current-page="dataForm.current"
  188. :page-sizes="[10, 20, 50, 100]"
  189. :page-size="dataForm.size"
  190. :total="totalPage"
  191. layout="total, sizes, prev, pager, next, jumper"
  192. >
  193. </el-pagination>
  194. <!-- 弹窗, 新增 / 修改 -->
  195. <add-or-update
  196. v-if="addOrUpdateVisible"
  197. ref="addOrUpdate"
  198. @refreshDataList="getDataList"
  199. :dataForm="editModel"
  200. ></add-or-update>
  201. </div>
  202. </template>
  203. <script>
  204. import { listFtmsorderbills, deleted } from '@/api/fleet/companyMsg'
  205. import AddOrUpdate from './companyMsg-add-or-update'
  206. export default {
  207. data() {
  208. return {
  209. dataForm: {
  210. fName: '',
  211. fManage: '',
  212. fTel: '',
  213. current: 1,
  214. size: 10
  215. },
  216. editModel: {},
  217. dataList: [],
  218. totalPage: 0,
  219. dataListLoading: false,
  220. dataListSelections: [],
  221. addOrUpdateVisible: false
  222. }
  223. },
  224. components: {
  225. AddOrUpdate
  226. },
  227. activated() {
  228. this.getDataList()
  229. },
  230. methods: {
  231. // 获取数据列表
  232. getDataList() {
  233. this.dataListLoading = true
  234. listFtmsorderbills(this.dataForm).then(data => {
  235. console.log(data)
  236. if (data && data.code === 200) {
  237. this.dataList = data.rows
  238. this.totalPage = data.total
  239. } else {
  240. this.dataList = []
  241. this.totalPage = 0
  242. }
  243. this.dataListLoading = false
  244. })
  245. // this.$http({
  246. // url: this.$http.adornUrl('/fleet/companyMsg/page'),
  247. // method: 'get',
  248. // params: this.$http.adornParams(this.dataForm)
  249. // }).then(({ data }) => {
  250. //
  251. // })
  252. },
  253. resetQuery() {
  254. this.dataForm = {
  255. fName: '',
  256. fManage: '',
  257. fTel: ''
  258. }
  259. },
  260. // 每页数
  261. sizeChangeHandle(val) {
  262. this.dataForm.pagesize = val
  263. // this.pageIndex = 1
  264. this.getDataList()
  265. },
  266. // 当前页
  267. currentChangeHandle(val) {
  268. this.dataForm.current = val
  269. this.getDataList()
  270. },
  271. // 多选
  272. selectionChangeHandle(val) {
  273. this.dataListSelections = val
  274. },
  275. // 新增 / 修改
  276. addOrUpdateHandle(row) {
  277. this.addOrUpdateVisible = true
  278. console.log(row)
  279. if (row) {
  280. this.editModel = row
  281. } else {
  282. this.editModel = {
  283. fId: null,
  284. fName: null,
  285. fAddr: null,
  286. fBankname: null,
  287. fBankno: null,
  288. creditLv: null,
  289. paymentDays: null,
  290. carNum: null,
  291. fManage: null,
  292. fTel: null,
  293. fFax: null,
  294. fEmail: null,
  295. headOffice: null,
  296. registerdCapital: null,
  297. legalPerson: null,
  298. insdustry: null,
  299. creditNum: null,
  300. taxpayerNum: null,
  301. industryCommerceNum: null,
  302. organizationNum: null,
  303. registerOrganization: null,
  304. dateOfEstablishment: null,
  305. companyType: null,
  306. businessDeadline: null,
  307. businessArea: null,
  308. annualDate: null,
  309. registerdAddress: null,
  310. manageScope: null,
  311. creatTime: null,
  312. modificationTime: null,
  313. pwd: null,
  314. loginAccount: null,
  315. pwd2: null
  316. }
  317. }
  318. this.$nextTick(() => {
  319. this.$refs.addOrUpdate.init()
  320. })
  321. },
  322. // 删除
  323. deleteHandle(id) {
  324. var companyMsgIds = id ? [id] : this.dataListSelections.map(item => {
  325. return item.userId
  326. })
  327. this.$confirm(`确定对[id=${companyMsgIds.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
  328. confirmButtonText: '确定',
  329. cancelButtonText: '取消',
  330. type: 'warning'
  331. }).then(() => {
  332. deleted(companyMsgIds).then(data => {
  333. console.log(data)
  334. if (data && data.code === 200) {
  335. this.$message({
  336. message: '操作成功',
  337. type: 'success',
  338. duration: 1500,
  339. onClose: () => {
  340. this.getDataList()
  341. }
  342. })
  343. } else {
  344. this.$message.error(data.msg)
  345. }
  346. })
  347. }).catch(() => {
  348. })
  349. }
  350. }
  351. }
  352. </script>