123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358 |
- <template>
- <div class="mod-companyMsg app-container">
- <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
- <el-form-item>
- <el-input v-model="dataForm.fName" placeholder="公司名称" clearable></el-input>
- </el-form-item>
- <el-form-item>
- <el-input v-model="dataForm.fManage" placeholder="联系人" clearable></el-input>
- </el-form-item>
- <el-form-item>
- <el-input v-model="dataForm.fTel" placeholder="联系电话" clearable></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="getDataList">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
- </el-form-item>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- icon="el-icon-plus"
- size="mini"
- @click="addOrUpdateHandle()"
- >新增
- </el-button>
- </el-col>
- <!-- <el-col :span="1.5">-->
- <!-- <el-button-->
- <!-- type="success"-->
- <!-- icon="el-icon-edit"-->
- <!-- size="mini"-->
- <!-- :disabled="single"-->
- <!-- @click="handleUpdate"-->
- <!-- v-hasPermi="['basicdata:corps:edit']"-->
- <!-- >修改</el-button>-->
- <!-- </el-col>-->
- <!-- <el-col :span="1.5">-->
- <!-- <el-button-->
- <!-- type="danger"-->
- <!-- icon="el-icon-delete"-->
- <!-- size="mini"-->
- <!-- :disabled="multiple"-->
- <!-- @click="handleDelete"-->
- <!-- v-hasPermi="['basicdata:corps:remove']"-->
- <!-- >删除</el-button>-->
- <!-- </el-col>-->
- <!-- <el-col :span="1.5">-->
- <!-- <el-button-->
- <!-- type="warning"-->
- <!-- icon="el-icon-download"-->
- <!-- size="mini"-->
- <!-- @click="handleExport"-->
- <!-- v-hasPermi="['basicdata:corps:export']"-->
- <!-- >导出</el-button>-->
- <!-- </el-col>-->
- <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
- </el-row>
- </el-form>
- <el-table
- :data="dataList"
- border
- stripe
- v-loading="dataListLoading"
- @selection-change="selectionChangeHandle"
- >
- <el-table-column
- type="selection"
- header-align="center"
- align="center"
- width="50"
- >
- </el-table-column>
- <el-table-column
- prop="fName"
- header-align="center"
- align="center"
- width="120"
- :show-overflow-tooltip="true"
- label="公司名称"
- >
- </el-table-column>
- <el-table-column
- prop="fAddr"
- header-align="center"
- align="center"
- width="150"
- :show-overflow-tooltip="true"
- label="公司地址"
- >
- </el-table-column>
- <el-table-column
- prop="fBankname"
- header-align="center"
- align="center"
- width="150"
- label="公司开户行"
- >
- </el-table-column>
- <el-table-column
- prop="fBankno"
- header-align="center"
- align="center"
- width="150"
- :show-overflow-tooltip="true"
- label="银行账号"
- >
- </el-table-column>
- <el-table-column
- prop="creditLv"
- header-align="center"
- align="center"
- width="150"
- label="信用等级"
- >
- </el-table-column>
- <el-table-column
- prop="paymentDays"
- header-align="center"
- align="center"
- label="账期天数"
- >
- </el-table-column>
- <el-table-column
- prop="fManage"
- header-align="center"
- align="center"
- label="联系人"
- >
- </el-table-column>
- <el-table-column
- prop="fTel"
- header-align="center"
- align="center"
- width="150"
- label="联系电话"
- >
- </el-table-column>
- <el-table-column
- prop="fFax"
- header-align="center"
- align="center"
- label="传真"
- >
- </el-table-column>
- <el-table-column
- prop="fEmail"
- header-align="center"
- align="center"
- label="Email"
- >
- </el-table-column>
- <el-table-column
- prop="headOffice"
- header-align="center"
- align="center"
- width="150"
- label="总公司名称"
- >
- </el-table-column>
- <el-table-column
- fixed="right"
- header-align="center"
- align="center"
- width="130"
- label="操作"
- >
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="addOrUpdateHandle(scope.row)"
- >查看
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="deleteHandle(scope.row.fId)"
- >删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @size-change="sizeChangeHandle"
- @current-change="currentChangeHandle"
- :current-page="dataForm.current"
- :page-sizes="[10, 20, 50, 100]"
- :page-size="dataForm.size"
- :total="totalPage"
- layout="total, sizes, prev, pager, next, jumper"
- >
- </el-pagination>
- <!-- 弹窗, 新增 / 修改 -->
- <add-or-update
- v-if="addOrUpdateVisible"
- ref="addOrUpdate"
- @refreshDataList="getDataList"
- :dataForm="editModel"
- ></add-or-update>
- </div>
- </template>
- <script>
- import { listFtmsorderbills, deleted } from '@/api/fleet/companyMsg'
- import AddOrUpdate from './companyMsg-add-or-update'
- export default {
- data() {
- return {
- dataForm: {
- fName: '',
- fManage: '',
- fTel: '',
- current: 1,
- size: 10
- },
- editModel: {},
- dataList: [],
- totalPage: 0,
- dataListLoading: false,
- dataListSelections: [],
- addOrUpdateVisible: false
- }
- },
- components: {
- AddOrUpdate
- },
- activated() {
- this.getDataList()
- },
- methods: {
- // 获取数据列表
- getDataList() {
- this.dataListLoading = true
- listFtmsorderbills(this.dataForm).then(data => {
- console.log(data)
- if (data && data.code === 200) {
- this.dataList = data.rows
- this.totalPage = data.total
- } else {
- this.dataList = []
- this.totalPage = 0
- }
- this.dataListLoading = false
- })
- // this.$http({
- // url: this.$http.adornUrl('/fleet/companyMsg/page'),
- // method: 'get',
- // params: this.$http.adornParams(this.dataForm)
- // }).then(({ data }) => {
- //
- // })
- },
- resetQuery() {
- this.dataForm = {
- fName: '',
- fManage: '',
- fTel: ''
- }
- },
- // 每页数
- sizeChangeHandle(val) {
- this.dataForm.pagesize = val
- // this.pageIndex = 1
- this.getDataList()
- },
- // 当前页
- currentChangeHandle(val) {
- this.dataForm.current = val
- this.getDataList()
- },
- // 多选
- selectionChangeHandle(val) {
- this.dataListSelections = val
- },
- // 新增 / 修改
- addOrUpdateHandle(row) {
- this.addOrUpdateVisible = true
- console.log(row)
- if (row) {
- this.editModel = row
- } else {
- this.editModel = {
- fId: null,
- fName: null,
- fAddr: null,
- fBankname: null,
- fBankno: null,
- creditLv: null,
- paymentDays: null,
- carNum: null,
- fManage: null,
- fTel: null,
- fFax: null,
- fEmail: null,
- headOffice: null,
- registerdCapital: null,
- legalPerson: null,
- insdustry: null,
- creditNum: null,
- taxpayerNum: null,
- industryCommerceNum: null,
- organizationNum: null,
- registerOrganization: null,
- dateOfEstablishment: null,
- companyType: null,
- businessDeadline: null,
- businessArea: null,
- annualDate: null,
- registerdAddress: null,
- manageScope: null,
- creatTime: null,
- modificationTime: null,
- pwd: null,
- loginAccount: null,
- pwd2: null
- }
- }
- this.$nextTick(() => {
- this.$refs.addOrUpdate.init()
- })
- },
- // 删除
- deleteHandle(id) {
- var companyMsgIds = id ? [id] : this.dataListSelections.map(item => {
- return item.userId
- })
- this.$confirm(`确定对[id=${companyMsgIds.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- deleted(companyMsgIds).then(data => {
- console.log(data)
- if (data && data.code === 200) {
- this.$message({
- message: '操作成功',
- type: 'success',
- duration: 1500,
- onClose: () => {
- this.getDataList()
- }
- })
- } else {
- this.$message.error(data.msg)
- }
- })
- }).catch(() => {
- })
- }
- }
- }
- </script>
|