代码更新
This commit is contained in:
@@ -111,17 +111,6 @@
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="info"
|
||||
:loading="syncLoading"
|
||||
icon="el-icon-refresh"
|
||||
size="mini"
|
||||
@click="sync()"
|
||||
>
|
||||
仓位同步
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
@@ -361,9 +350,6 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
/* checkoutbill.getInvTypes().then(res => {
|
||||
this.invtypelist = res
|
||||
})*/
|
||||
crudPoint.getRegion().then(res => {
|
||||
this.reginoList = res
|
||||
})
|
||||
@@ -407,16 +393,6 @@ export default {
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
sync() {
|
||||
this.syncLoading = true
|
||||
crudPoint.syncStruct().then(() => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.syncLoading = false
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,19 +16,24 @@
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission"/>
|
||||
<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="500px">
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="区域编码" prop="region_code">
|
||||
<el-input v-model="form.region_code" style="width: 370px;"/>
|
||||
<el-input v-model="form.region_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域名称" prop="region_name">
|
||||
<el-input v-model="form.region_name" style="width: 370px;"/>
|
||||
<el-input v-model="form.region_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" style="width: 370px;"/>
|
||||
<el-input v-model="form.remark" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@@ -37,27 +42,21 @@
|
||||
</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 v-if="false" prop="region_id" label="区域标识"/>
|
||||
<el-table-column prop="region_code" label="区域编码"/>
|
||||
<el-table-column prop="region_name" label="区域名称"/>
|
||||
<el-table-column prop="remark" label="备注"/>
|
||||
<el-table-column label="是否启用" align="center" prop="is_used">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="format_is_used(scope.row.is_used)"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_name" label="创建人姓名"/>
|
||||
<el-table-column prop="create_time" label="创建时间"/>
|
||||
<el-table-column prop="update_optname" label="修改人姓名"/>
|
||||
<el-table-column prop="update_time" label="修改时间"/>
|
||||
<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 v-if="false" prop="region_id" label="区域标识" />
|
||||
<el-table-column prop="region_code" label="区域编码" />
|
||||
<el-table-column prop="region_name" label="区域名称" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="create_name" label="创建人" />
|
||||
<el-table-column prop="create_time" label="创建时间" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
@@ -68,7 +67,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -86,7 +85,6 @@ const defaultForm = {
|
||||
region_code: null,
|
||||
region_name: null,
|
||||
remark: null,
|
||||
is_used: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
@@ -131,28 +129,6 @@ export default {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
format_is_used(is_used) {
|
||||
return is_used === '1'
|
||||
},
|
||||
changeEnabled(data, val) {
|
||||
let msg = '此操作将停用点位,是否继续!'
|
||||
if (val !== '1') {
|
||||
msg = '此操作将启用点位,是否继续!'
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
changeActive(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
data.is_used = !data.is_used
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user