Commit 4fb25156 authored by 李苏's avatar 李苏 💬

需求事项,erp会计,解决表格数据更新后无法选中行bug 数据更新后dom异步渲染 nexttick

parent 86826f1d
public/favicon.ico

65.8 KB | W: | H:

public/favicon.ico

4.19 KB | W: | H:

public/favicon.ico
public/favicon.ico
public/favicon.ico
public/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
public/favicon.png

41.4 KB | W: | H:

public/favicon.png

4.19 KB | W: | H:

public/favicon.png
public/favicon.png
public/favicon.png
public/favicon.png
  • 2-up
  • Swipe
  • Onion skin
import request from 'common/src/utils/request'
/* query */
export function doQuery(query) {
return request({
url: '/budgetms/kjkm/query',
method: 'post',
data: query||{}
})
}
export function doAdd(query) {
return request({
url: '/budgetms/kjkm/add',
method: 'post',
data: query||{}
})
}
export function doUpdate(query) {
return request({
url: '/budgetms/kjkm/update',
method: 'post',
data: query||{}
})
}
export function doDelete(query) {
return request({
url: '/budgetms/kjkm/delete',
method: 'post',
data: query||{}
})
}
/* 导入 */
export function excelimport(query) {
return request({
'Content-type' : 'multipart/form-data',
url: '/budgetms/kjkm/excel/import',
method: 'post',
data: query||{}
})
}
import request from 'common/src/utils/request'
/* query */
export function doQuery(query) {
return request({
url: '/budgetms/fysx/query',
method: 'post',
data: query||{}
})
}
export function doAdd(query) {
return request({
url: '/budgetms/fysx/add',
method: 'post',
data: query||{}
})
}
export function doUpdate(query) {
return request({
url: '/budgetms/fysx/update',
method: 'post',
data: query||{}
})
}
export function doDelete(query) {
return request({
url: '/budgetms/fysx/delete',
method: 'post',
data: query||{}
})
}
src/assets/logo/logo.png

41.4 KB | W: | H:

src/assets/logo/logo.png

4.19 KB | W: | H:

src/assets/logo/logo.png
src/assets/logo/logo.png
src/assets/logo/logo.png
src/assets/logo/logo.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -48,6 +48,32 @@ export const powerRoutes=[ ...@@ -48,6 +48,32 @@ export const powerRoutes=[
}, },
name:'ysflZbdl', name:'ysflZbdl',
path:"ysflZbdl" path:"ysflZbdl"
},
{
component:'jccspz/xqsxZbxl/index',
hidden:false,
meta:{
"title": "需求事项(总表小类)",
"icon": "",
"noCache": false,
"link": null,
"mkid":901010600,
},
name:'xqsxZbxl',
path:"xqsxZbxl"
},
{
component:'jccspz/erpKjkm/index',
hidden:false,
meta:{
"title": "ERP会计科目(关联用)",
"icon": "",
"noCache": false,
"link": null,
"mkid":901010200,
},
name:'erpKjkm',
path:"erpKjkm"
} }
] ]
}, },
......
<template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item v-rule="{
rules:rules,
required:true
}" label="编码" ref="code" prop="code">
<el-input :readonly="readonly" v-model="form.code"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-rule="{
rules:rules,
required:true
}" label="名称" ref="name" prop="name">
<el-input :readonly="readonly" v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="统计标识" ref="tjbz" prop="tjbz">
<RelSelect :readonly="readonly" filterable style="width: 100%;" src='/budgetms/kjkm/init/tjbz'
:match="{value:'id',label:'name'}" v-model='form.tjbz'></RelSelect>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" ref="bz" prop="bz">
<el-input :readonly="readonly" v-model="form.bz"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</RelDialog>
</template>
<script>
import {
editMixin
} from 'common'
export default {
mixins: [editMixin],
/* 存放index页面传递的额外参数*/
mounted() {},
/* 组件名称*/
/* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/
data() {
return {
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: {
tjbz: '',
code: '',
id: '',
name: '',
bz: ''
}
}
},
methods: {}
}
</script>
<style scoped lang="scss">
</style>
<template>
<div class="min_full">
<!-- 查询条件-->
<div class="search" v-condition>
<SearchButton :app='app'></SearchButton>
<el-row :gutter="20" class="search-row-1">
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">名称:</span>
<el-input v-model="queryParams.condition"></el-input>
</div>
</el-col>
</el-row>
</div>
<!-- 按钮操作-->
<el-row class="tool-bar">
<ToolButton :app='app'></ToolButton>
<ViewButton ref="view" :app='app'></ViewButton>
<AddButton ref="add" :app='app'></AddButton>
<CopyButton ref="copy" :app='app'></CopyButton>
<EditButton ref="edit" :app='app'></EditButton>
<el-button size='mini' @click="dcmb()" type="primary">导出模板</el-button>
<el-button size='mini' @click="dr()" type="primary">导入</el-button>
<!-- <AttachFileButton :app='app' ></AttachFileButton> -->
<!-- 额外按钮-->
<!-- 表头设置 -->
<!-- 权限-->
</el-row>
<!-- 表格-->
<div class="tablePagers">
<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
@getRow='getRow'>
</TablePager>
</div>
</div>
</template>
<script>
import {
doQuery,
doAdd,
doUpdate,
doDelete,
excelimport
} from '@/api/jccspz/erpKjkm.js';
import{
download
}from 'common/src/utils/request.js'
/* edit页面*/
import Edit from './edit'
import {
tableMixin
} from 'common'
export default {
mixins: [tableMixin],
name: 'erpKjkm',
/* 初始额外赋值*/
async mounted() {
this.$refs['TablePager'].pageQuery()
},
data() {
return {
/*需要的额外参数 */
showDialog: false,
DialogName: '',
type: '',
DialogTitle: '',
/* 基础url*/
baseUrl: 'budgetms/kjkm',
/* 查询参数*/
queryParams: {
condition: '',
},
/* 表格标题对应参数*/
tableTitle: [
{title: "编码", field: "code", fieldType: "ftString",width:140},
{title: "名称", field: "name", fieldType: "ftString",width:260},
{title: "统计标识", field: "tjbz",fieldType: "ftString",width:100,formatter:function (a,b,value) {
var map={"N": "非统计", "Y":"统计"};
return map[value] || "";
}
},
{title: "备注", field: "bz", fieldType: "ftString",width:200},
{title: "维护人", field: "whr", fieldType: "ftString"},
{title: "维护时间", field: "whsj", fieldType: "ftDateTime"}
]
}
},
methods: {
dcmb(){
download('budgetms/kjkm/excel/model/export',{},'会计科目模板.xlsx')
},
dr(){
//budgetms/kjkm/excel/import
let that=this
let input = document.createElement('input');
input.type='file'
input.onchange=function(){
let file = input.files[0];
if(file){
let name = file.name
let type = file.type
let formData = new FormData();
formData.append('file', file)
excelimport(formData).then(res=>{
try{document.body.removeChild(input)}catch(e){
console.log(e)
}
if(res.success){
that.$success('导入成功')
that.app.$refs.TablePager.pageQuery()
}
})
}
}
input.click()
},
/* 基础查询*/
query: doQuery,
/* 基础增*/
apiAdd: doAdd,
/* 基础更新*/
apiUpdate: doUpdate,
/* 删除操作*/
apiDelete: doDelete,
/* 初始化赋值操作*/
init() {
}
},
components: {
Edit,
}
}
</script>
<style scoped>
</style>
<template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="120px" :rules="rules">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="成本预算科目" ref="fyxmid" prop="fyxmid">
<RelSelect :readonly="readonly" filterable style="width: 100%;" src='/budgetms/fyxm/query' :match="{value:'id',label:'showname'}" v-model='form.fyxmid' ></RelSelect>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="需求事项" ref="xqsx" prop="xqsx">
<el-input :readonly="readonly" v-model="form.xqsx"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="测算依据" ref="csyj" prop="csyj">
<el-input :readonly="readonly" v-model="form.csyj"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="实施实施责任人" ref="zrr" prop="zrr">
<el-input :readonly="readonly" v-model="form.zrr"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="税率(%)" v-rule="{
rules:rules,
required:true
}" ref="sl" prop="sl" >
<el-input :readonly="readonly" type="number" v-model="form.sl"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" ref="bz" prop="bz">
<el-input :readonly="readonly" v-model="form.bz"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</RelDialog>
</template>
<script>
import {editMixin} from 'common'
export default {
mixins: [editMixin],
/* 存放index页面传递的额外参数*/
mounted() {
},
/* 组件名称*/
/* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/
data() {
return {
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: {
fyxmid:'',
id:'',
xqsx:'',
csyj:'',
zrr:'',
sl:'',
bz:''
}
}
},
methods: {
}
}
</script>
<style scoped lang="scss">
</style>
<template>
<div class="min_full">
<!-- 查询条件-->
<div class="search" v-condition>
<SearchButton :app='app'></SearchButton>
<el-row :gutter="20" class="search-row-1">
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">预算科目:</span>
<RelSelect style="width: 100%;" src='budgetms/fyxm/query' filterable clearable
:match="{value:'id',label:'name'}" v-model='queryParams.flbm'></RelSelect>
</div>
</el-col>
</el-row>
</div>
<!-- 按钮操作-->
<el-row class="tool-bar">
<ToolButton :app='app'></ToolButton>
<ViewButton ref="view" :app='app'></ViewButton>
<AddButton ref="add" :app='app'></AddButton>
<CopyButton ref="copy" :app='app'></CopyButton>
<EditButton ref="edit" :app='app'></EditButton>
<!-- <AttachFileButton :app='app' ></AttachFileButton> -->
<!-- 额外按钮-->
<!-- 表头设置 -->
<!-- 权限-->
</el-row>
<!-- 表格-->
<div class="tablePagers">
<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
@getRow='getRow'>
</TablePager>
</div>
</div>
</template>
<script>
import {
doQuery,
doAdd,
doUpdate,
doDelete
} from '@/api/jccspz/xqsxZbxl.js';
/* edit页面*/
import Edit from './edit'
import {
tableMixin
} from 'common'
export default {
mixins: [tableMixin],
name: 'xqsxZbxl',
/* 初始额外赋值*/
async mounted() {
this.$refs['TablePager'].pageQuery()
},
data() {
return {
/*需要的额外参数 */
showDialog: false,
DialogName: '',
type: '',
DialogTitle: '',
/* 基础url*/
baseUrl: 'budgetms/fysx',
/* 查询参数*/
queryParams: {
flbm:''
},
/* 表格标题对应参数*/
tableTitle: [ // {title: "成本预算科目", field: "fyxmName", fieldType: "ftString",width:200,hidden:true},
{title: "成本预算科目", field: "showname", fieldType: "ftString",width:200},
{title: "需求事项", field: "xqsx", fieldType: "ftString",width:300},
{title: "测算依据", field: "csyj", fieldType: "ftString",width:300},
{title: "税率(%)",field:"sl", fieldType:"zzsl", width: 100},
// {title: "成本预算科目编码", field: "fyxmid", fieldType: "ftString",width:192},
{title: "备注", field: "bz", fieldType: "ftString",width:300},
{title: "维护人", field: "whr", fieldType: "ftString"},
{title: "维护时间", field: "whsj", fieldType: "ftDateTime"},]
}
},
methods: {
/* 基础查询*/
query: doQuery,
/* 基础增*/
apiAdd: doAdd,
/* 基础更新*/
apiUpdate: doUpdate,
/* 删除操作*/
apiDelete: doDelete,
/* 初始化赋值操作*/
init() {
}
},
components: {
Edit,
}
}
</script>
<style scoped>
</style>
...@@ -179,6 +179,30 @@ ...@@ -179,6 +179,30 @@
let newTreeData = that.dgData(treeData, 'root') let newTreeData = that.dgData(treeData, 'root')
that.tableData=newTreeData that.tableData=newTreeData
that.expandKeys = ['rowKey'] that.expandKeys = ['rowKey']
if(this.singleItem.id){
let querys=(item,id)=>{
if(item.id==id){
/* 表格数据变更需要重构建Dom需要nextTick*/
this.$nextTick(()=>{
this.$refs.TablePager.setCurrent(item)
})
return item
}else{
/* 展开 */
// this.$refs.TablePager.expandKeys.push(item.rowKey)
item.children.forEach(e=>{
querys(e,id)
})
}
}
querys({
children:newTreeData,
id:false
},this.singleItem.id)
}
}, },
addxjfl(){ addxjfl(){
if (this.app.selectOne || this.app.clickOne) { if (this.app.selectOne || this.app.clickOne) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment