companyMsg.vue 9.5 KB

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