代码更新
This commit is contained in:
339
lms/nladmin-ui/src/views/wms/basedata/master/transport/index.vue
Normal file
339
lms/nladmin-ui/src/views/wms/basedata/master/transport/index.vue
Normal file
@@ -0,0 +1,339 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="公司编码">
|
||||
<el-input
|
||||
v-model="query.cust_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="公司名称">
|
||||
<el-input
|
||||
v-model="query.cust_name"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否启用">
|
||||
<el-select
|
||||
v-model="query.is_used"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.is_used"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="1200px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物流公司编码" prop="cust_code">
|
||||
<el-input v-model="form.cust_code" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物流公司名称 " prop="cust_name">
|
||||
<el-input v-model="form.cust_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物流公司简称">
|
||||
<el-input v-model="form.cust_simple_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="国家">
|
||||
<el-input v-model="form.country" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="省份">
|
||||
<el-input v-model="form.state" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="城市">
|
||||
<el-input v-model="form.city" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="传真">
|
||||
<el-input v-model="form.faxnumber" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="邮箱">
|
||||
<el-input v-model="form.webSite" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="法人代表">
|
||||
<el-input v-model="form.jurid_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="税务登记号">
|
||||
<el-input v-model="form.tax_no" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工商注册号">
|
||||
<el-input v-model="form.register_no" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="经营许可证号">
|
||||
<el-input v-model="form.manage_lice_no" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="营业执照">
|
||||
<el-input v-model="form.busi_char_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="行政区划">
|
||||
<el-input v-model="form.area_id" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="邮政编码">
|
||||
<el-input v-model="form.zip_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司电话">
|
||||
<el-input v-model="form.corp_tele_no" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司地址">
|
||||
<el-input v-model="form.corp_address" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="cust_code" width="120px" label="物流公司编码" :min-width="flexWidth('cust_code',crud.data,'物流公司编码')" />
|
||||
<el-table-column prop="cust_name" width="120px" label="物流公司名称 " :min-width="flexWidth('cust_name',crud.data,'物流公司名称 ')" />
|
||||
<el-table-column prop="cust_simple_name" width="120px" label="物流公司简称" :min-width="flexWidth('cust_simple_name',crud.data,'物流公司简称')" />
|
||||
<el-table-column prop="is_used" label="启用 ">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.is_used"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="country" label="国家" :min-width="flexWidth('country',crud.data,'国家')" />
|
||||
<el-table-column prop="state" label="省份" :min-width="flexWidth('state',crud.data,'省份')" />
|
||||
<el-table-column prop="city" label="城市" :min-width="flexWidth('city',crud.data,'城市')" />
|
||||
<el-table-column prop="faxnumber" label="传真" :min-width="flexWidth('faxnumber',crud.data,'传真')" />
|
||||
<el-table-column prop="webSite" label="邮箱" :min-width="flexWidth('webSite',crud.data,'邮箱')" />
|
||||
<el-table-column prop="jurid_name" label="法人代表" :min-width="flexWidth('jurid_name',crud.data,'法人代表')" />
|
||||
<el-table-column prop="tax_no" width="120px" label="税务登记号" :min-width="flexWidth('tax_no',crud.data,'税务登记号')" />
|
||||
<el-table-column prop="register_no" width="120px" label="工商注册号" :min-width="flexWidth('register_no',crud.data,'工商注册号')" />
|
||||
<el-table-column prop="manage_lice_no" width="120px" label="经营许可证号" :min-width="flexWidth('manage_lice_no',crud.data,'经营许可证号')" />
|
||||
<el-table-column prop="busi_char_name" label="营业执照" :min-width="flexWidth('busi_char_name',crud.data,'营业执照')" />
|
||||
<el-table-column prop="area_id" label="行政区划" :min-width="flexWidth('area_id',crud.data,'行政区划')" />
|
||||
<el-table-column prop="zip_code" label="邮政编码" :min-width="flexWidth('zip_code',crud.data,'邮政编码')" />
|
||||
<el-table-column prop="corp_tele_no" label="公司电话" :min-width="flexWidth('corp_tele_no',crud.data,'公司电话')" />
|
||||
<el-table-column prop="corp_address" label="公司地址" :min-width="flexWidth('corp_address',crud.data,'公司地址')" />
|
||||
<el-table-column prop="create_name" width="120px" label="创建人姓名" :min-width="flexWidth('create_name',crud.data,'创建人姓名')" />
|
||||
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
|
||||
<el-table-column prop="update_optname" width="120px" label="修改人姓名" :min-width="flexWidth('update_optname',crud.data,'修改人姓名')" />
|
||||
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudTransportationbase from '@/views/wms/basedata/master/transport/transportationbase'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = {
|
||||
cust_id: null,
|
||||
cust_code: null,
|
||||
cust_name: null,
|
||||
cust_simple_name: null,
|
||||
country: null,
|
||||
state: null,
|
||||
city: null,
|
||||
faxnumber: null,
|
||||
webSite: null,
|
||||
jurid_name: null,
|
||||
tax_no: null,
|
||||
register_no: null,
|
||||
manage_lice_no: null,
|
||||
busi_char_name: null,
|
||||
area_id: null,
|
||||
zip_code: null,
|
||||
corp_tele_no: null,
|
||||
corp_address: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_used_time: null,
|
||||
is_used: null,
|
||||
is_delete: null,
|
||||
ext_id: null,
|
||||
remark: null
|
||||
}
|
||||
export default {
|
||||
dicts: ['is_used'],
|
||||
name: 'Transportationbase',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '运输公司基本信息',
|
||||
url: 'api/transportationbase',
|
||||
idField: 'cust_id',
|
||||
sort: 'cust_id,desc',
|
||||
crudMethod: { ...crudTransportationbase },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
cust_id: [
|
||||
{ required: true, message: '物流公司标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
cust_code: [
|
||||
{ required: true, message: '物流公司编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
cust_name: [
|
||||
{ required: true, message: '物流公司名称不能为空', trigger: 'blur' }
|
||||
]
|
||||
}}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
// 改变状态
|
||||
changeEnabled(data, val) {
|
||||
this.$confirm('此操作将 "' + this.dict.label.is_used[val] + '" ' + data.unit_name + ', 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudTransportationbase.edit(data).then(res => {
|
||||
this.crud.notify(this.dict.label.is_used[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,34 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/transportationbase',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/transportationbase/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/transportationbase',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getTransporta() {
|
||||
return request({
|
||||
url: 'api/transportationbase/getTransporta',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getTransporta }
|
||||
Reference in New Issue
Block a user