Commit 53f2a4dd authored by renjintao's avatar renjintao

Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product-rjt

parents 5dae25d0 12ff8d6b
......@@ -87,6 +87,6 @@ export default {
color: @s1-color;
}
.s0 {
color: #ddd;
color: @table-color;
}
</style>
\ No newline at end of file
......@@ -40,6 +40,7 @@ export default {
};
</script>
<style lang="less">
@import "../../assets/css/custom.less";
.s2 {
color: red;
}
......@@ -47,6 +48,6 @@ export default {
color: #333;
}
.s0 {
color: #ddd;
color: @table-color;
}
</style>
\ No newline at end of file
......@@ -1707,5 +1707,56 @@ export default {
messageType:'类别',
content:'内容',
},
//文档分类
document_category:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
name:'分类名称',
upId:'上级id',
level:'层级',
totalDocument:'分类下总文档数',
tenantId:'租户id',
type:'类别',
englishFullName:'英文全称',
englishName:'英文简称',
status:'',
inheritCategoryId:'继承', //继承分类id
template:'上传模板', //模板路径
templateId:'',
status:'状态',
description:'备注'
},
document_template:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
name:'名称',
status:'状态',
creator:'创建人',
remark:'备注',
url:'模板路径',
},
document_ref:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
documentId:'文档id',
refName:'引用的文档名称',
refId:'引用的文档id',
name:'文档名称',
}
}
......@@ -29,8 +29,9 @@
</FormItem>
</Col>
<Col :span="24">
<h4>扩展属性</h4>
<Table :columns="columns" :data="checkList">
<Divider orientation="left">扩展属性</Divider>
<!-- <h4>扩展属性</h4> -->
<Table :columns="columns" :data="checkList" border>
<template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<Input
......
......@@ -29,8 +29,8 @@
</FormItem>
</Col>
<Col :span="24">
<h4>扩展属性</h4>
<Table border :columns="columns" :data="checkList">
<Divider orientation="left">扩展属性</Divider>
<Table border :columns="columns" :data="checkList" >
<template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<Input
......
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="100">
<Row>
<Col :span="12">
<FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"></Input>
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<!-- <Col :span="12">
<FormItem :label="l('tenantId')" prop="tenantId">
<InputNumber v-model="entity.tenantId"></InputNumber>
</FormItem>
</Col>-->
<Col :span="12">
<FormItem :label="l('code')" prop="code">
<Input v-model="entity.code"></Input>
<FormItem :label="l('type')" prop="type">
<Dictionary code="word_classification_type" v-model="entity.type"></Dictionary>
<!-- <InputNumber v-model="entity.type"></InputNumber> -->
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('description')" prop="description">
<Input v-model="entity.description"></Input>
<FormItem :label="l('englishFullName')" prop="englishFullName">
<Input v-model="entity.englishFullName"></Input>
</FormItem>
</Col>
<Col :span="12" v-if="user">
<FormItem :label="l('userName')" prop="userName">
<UserSelect
ref="userSelected"
:roleTitle="roleTitle"
v-model="entity.userIds"
:multiple="true"
@on-change="userChange"
/>
<Col :span="12">
<FormItem :label="l('englishName')" prop="englishName">
<Input v-model="entity.englishName"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="物料类型" prop="materialType">
<Select v-model="entity.materialType" multiple @on-change="changeVal">
<Option v-for="item in list" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select>
<FormItem :label="l('status')" prop="status">
<Dictionary code="word_classification_status" v-model="entity.status"></Dictionary>
<!-- <InputNumber v-model="entity.status"></InputNumber> -->
</FormItem>
</Col>
</Row>
<Col :span="12">
<FormItem :label="l('inheritCategoryId')" prop="inheritCategoryId" v-if="row.id">
<!-- <Checkbox v-model="entity.inheritCategoryId"></Checkbox> -->
<RadioGroup v-model="inherit">
<Radio label="1"></Radio>
<Radio label="0"></Radio>
</RadioGroup>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('description')" prop="description">
<Input v-model="entity.description" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('template')" prop="template">
<!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> -->
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<!-- <Col :span="24">
<FormItem :label="l('templateId')" prop="templateId">
<Input v-model="entity.templateId"></Input>
</FormItem>
</Col>-->
<Col :span="24">
<Divider orientation="left">扩展属性</Divider>
<Table :columns="columns" :data="checkList" border>
<template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<Input
v-model="row.title"
placeholder="请输入名称"
@on-blur="setRow(row,index)"
v-if="row.fieldType==3"
/>
</template>
<template slot-scope="{ row, index }" slot="note">
<!-- <Input v-if="row.dataType==3" v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" /> -->
<Select
v-if="row.dataType==3"
v-model="row.note"
clearable
transfer
@on-change="setRow(row,index)"
>
<Option v-for="item in codeList" :value="item.code" :key="item.code">{{ item.name }}</Option>
</Select>
<span v-else>{{row.note}}</span>
</template>
<template slot-scope="{ row, index }" slot="dataType">
<Dictionary
@on-change="setRow(row,index)"
v-model="row.dataType"
code="materail.category.dataType"
type="select"
:value="row.dataType"
:key="row.dataType"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="unitName">
<Dictionary
v-if="row.dataType==1||row.dataType==2"
@on-change="setRow(row,index)"
v-model="row.unitName"
code="material.main.unitName"
type="select"
placeholder="请选择单位"
:value="row.unitName"
:key="row.unitName"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="required">
<Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox>
</template>
<template slot-scope="{ row, index }" slot="isUnique">
<Checkbox v-model="row.isUnique" @on-change="setRow(row,index)"></Checkbox>
</template>
<template slot-scope="{ row, index }" slot="action">
<a @click="remove(index,row)" style="color:#FF7A8B" v-if="row.fieldType>1">删除</a>
</template>
</Table>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button>
</Col>
<Col :span="24" class="tr mt10">
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Col>
</Row>
</Form>
</template>
<script>
......@@ -47,104 +134,216 @@ export default {
name: "Add",
data() {
return {
list: [],
roleTitle: "库管员",
disabled: false,
entity: {
creationTime: null,
creatorUserId: null,
lastModificationTime: null,
lastModifierUserId: null,
isDeleted: null,
deleterUserId: null,
deletionTime: null,
upId: this.upId,
materialType: "",
materialTypeName: "",
title: "",
code: "",
status: null,
creatorUserId: this.$store.state.userInfo.userId,
name: "",
upId: 0,
level: 1, //层级,顶级1,
totalDocument: 0,
type: 0,
englishFullName: "",
englishName: "",
status: 0,
description: "",
level: this.level,
userName: "",
userIds: "",
codeRuleType: "",
inheritCategoryId: "0", //0否,是,row的id值
template: "",
templateId: "",
},
inherit: "0",
rules: {
title: [{ required: true, message: "必填", trigger: "blur" }],
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
checkList: [
{
field: "code",
title: "编号",
note: "",
dataType: 0,
unitName: "",
required: true,
isunique: false,
fieldType: 1,
categoryId: 0,
action: 1,
add: 0, //新增标识
},
props: {
v: Object,
eid: Number,
level: Number,
upId: Number,
user: {
type: Boolean,
default: true,
{
field: "version",
title: "版本",
note: "",
dataType: 0,
unitName: "",
required: true,
isunique: false,
fieldType: 1,
categoryId: 0,
action: 1,
add: 0, //新增标识
},
{
field: "name",
title: "标题",
note: "",
dataType: 0,
unitName: "",
required: true,
isunique: false,
fieldType: 1, //共有属性(不能删除)
categoryId: 0,
action: 1,
add: 0, //新增标识
},
mounted() {
this.getList();
{
field: "description",
title: "文档详细说明",
note: "",
dataType: 0,
unitName: "",
required: true,
isunique: false,
fieldType: 1, //共有属性(不能删除)
categoryId: 0,
action: 1,
add: 0, //新增标识
},
],
columns: [
{
title: "序号",
type: "index",
width: 80,
align: "center",
},
methods: {
getList() {
let data = {
conditions: [
{
fieldName: "upId",
fieldValue: 0,
conditionalType: "Equal",
title: "属性名称",
key: "title",
slot: "title",
},
{
title: "属性类型",
key: "dataType",
align: "center",
slot: "dataType",
width: 200,
},
{
title: "设置",
key: "note",
align: "center",
slot: "note",
},
{
title: "单位",
key: "unitName",
align: "center",
slot: "unitName",
width: "150",
},
{
title: "必填",
key: "required",
align: "center",
slot: "required",
width: 80,
},
{
title: "唯一",
key: "isUnique",
align: "center",
slot: "isUnique",
width: 80,
},
{
width: 80,
title: "操作",
slot: "action",
align: "center",
},
],
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
};
Api.list(data).then((r) => {
this.list = r.result;
// console.log(this.list);
});
},
changeVal(val) {
let code = [];
let type = [];
for (let i = 0; i < this.list.length; i++) {
let obj = this.list[i];
for (let j = 0; j < val.length; j++) {
if (obj.id == val[j]) {
code.push(obj.code);
type.push(obj.codeRuleType);
}
props: {
row: Object,
eid: Number,
},
mounted() {
// if (this.eid > 0) {
// this.load(this.eid);
// }
console.log(this.row);
this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
},
methods: {
addNew() {
let maxId = 0;
this.checkList.map((u) => {
if (u.mid > maxId) {
maxId = u.mid;
}
});
let obj = {
mid: maxId + 1,
field: "c" + maxId,
title: "",
note: "",
unitName: "",
dataType: 0,
required: false,
isunique: false,
fieldType: 3,
categoryId: 0,
action: 1,
add: 0, //新增标识
};
this.checkList.push(obj);
},
remove(index, row) {
if (row.add == 0) {
//新增的删除,直接删
this.checkList.splice(index, 1);
} else {
row.action = 2; //返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台
this.$set(this.checkList, index, row);
this.arr.push(row);
this.checkList.splice(index, 1);
}
this.entity.materialTypeName = code.join(",");
this.entity.codeRuleType = type.join(",");
},
setRow(row, index) {
this.$set(this.checkList, index, row);
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
let userNam = "";
let userId = "";
if (this.user) {
userId = this.entity.userIds.join(",");
userNam = this.$refs.userSelected.getSelectNames().join(",");
if (this.$refs.refFile.nameList.length > 0) {
this.entity.templateId = this.parms.eid;
} else {
// this.entity.filePath = "";
this.entity.templateId = "";
}
let materialType = this.entity.materialType.join(",");
let paramsdata = {
id: this.entity.id,
upId: this.entity.upId,
title: this.entity.title, //库位名称
code: this.entity.code, //库位编号
description: this.entity.description, //位置
level: this.entity.level,
userName: userNam, //库管员
userIds: userId, //库管员id
materialType: materialType, //物料类型
materialTypeName: this.entity.materialTypeName, //物料编码
codeRuleType: this.entity.codeRuleType,
};
Api.create(paramsdata)
if (this.row.id) {
this.entity.upId = this.row.id;
this.entity.level = this.row.level;
this.entity.inheritCategoryId = this.row.id;
} else {
this.entity.upId = 0;
this.entity.level = 1;
this.entity.inheritCategoryId = 0;
}
alert(55);
let data = {
cat: this.entity,
pros: this.checkList,
};
Api.create(data)
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
......@@ -154,6 +353,7 @@ export default {
}
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
......@@ -163,25 +363,26 @@ export default {
handleClose() {
this.$emit("on-close");
},
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.entity.id = 0;
});
},
userChange(val) {},
// load(v) {
// Api.get({ id: v }).then((r) => {
// this.entity = r.result;
// this.entity.id = 0;
// });
// },
l(key) {
key = "store_room_location" + "." + key;
key = "document_category" + "." + key;
return this.$t(key);
},
},
watch: {
v() {
this.entity = this.$u.clone(this.v);
},
user(v) {
this.user = v;
},
// v() {
// this.entity = this.$u.clone(this.v);
// },
// eid(v) {
// if (v > 0) {
// this.load(v);
// }
// },
},
};
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index: `${material}/documentcategory/paged`,
paged(params) {
return Api.post(`${material}/documentcategory/paged`, params);
index:`${material}/documentcategory/paged`,
paged(params){
return Api.post(`${material}/documentcategory/paged`,params);
},
getList(params) {
return Api.post(`${material}/documentcategory/list`, params);
get(params){
return Api.get(`${material}/documentcategory/get`,params);
},
get(params) {
return Api.get(`${material}/documentcategory/get`, params);
create(params){
return Api.post(`${material}/documentcategory/create`,params);
},
create(params) {
return Api.post(`${material}/documentcategory/create`, params);
},
update(params) {
return Api.post(`${material}/documentcategory/update`, params);
update(params){
return Api.post(`${material}/documentcategory/update`,params);
},
delete(id) {
return Api.delete(`${material}/documentcategory/delete`, {
params: {
id: id
}
});
return Api.delete(`${material}/documentcategory/delete`,{params:{id:id}});
},
list(params) {
return Api.post(`${material}/category/list`, params);//物料类型列表
deletes(params) {
return Api.post(`${material}/documentcategory/batchdelete`,params);
},
}
//文档属性定义列表
list(params){
return Api.post(`${material}/documentpropertydefinition/list`,params);
},
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('code')">{{entity.code}}</Filed>
<Filed :span="12" :name="l('description')">{{entity.description}}</Filed>
<Filed :span="12" :name="l('level')">
<state code="store.level" :value="entity.level+''" type="text"></state>
</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">
<User :value="entity.creatorUserId" />
</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')">
<User :value="entity.lastModifierUserId" />
<Filed :span="12" :name="l('name')">{{entity.name}}</Filed>
<Filed :span="12" :name="l('level')">{{entity.level}}</Filed>
<Filed :span="12" :name="l('totalDocument')">{{entity.totalDocument}}</Filed>
<Filed :span="12" :name="l('type')">
<state code="word_classification_type" :value="entity.type+''" type="text"></state>
</Filed>
<Filed :span="12" :name="l('englishFullName')">{{entity.englishFullName}}</Filed>
<Filed :span="12" :name="l('englishName')">{{entity.englishName}}</Filed>
<Filed :span="12" :name="l('status')">
<state code="word_classification_status" :value="entity.status+''" type="text"></state>
</Filed>
<Filed :span="12" :name="l('description')">{{entity.description}}</Filed>
<Filed :span="12" :name="l('inheritCategoryId')">{{entity.inheritCategoryId == 0 ? "否" : "是"}}</Filed>
<Filed :span="24" :name="l('template')">
<files ref="refFile" :parms="parms" fileFormat :showList="false" />
</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed>
<Filed :span="24" name="物料编号">{{entity.materialTypeName}}</Filed>
<Filed :span="24" :name="l('userName')">{{entity.userName}}</Filed>
</Row>
</div>
</template>
......@@ -31,6 +35,12 @@ export default {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
},
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
};
},
props: {
......@@ -45,14 +55,15 @@ export default {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.$emit("on-load");
this.parms.eid = r.result.templateId;
// this.$emit("on-load");
});
},
handleClose() {
this.$emit("on-close");
},
// handleClose() {
// this.$emit("on-close");
// },
l(key) {
key = "store_room_location" + "." + key;
key = "document_category" + "." + key;
return this.$t(key);
},
},
......
......@@ -2,42 +2,131 @@
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"></Input>
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<!-- <Col :span="12">
<FormItem :label="l('tenantId')" prop="tenantId">
<InputNumber v-model="entity.tenantId"></InputNumber>
</FormItem>
</Col>-->
<Col :span="12">
<FormItem :label="l('code')" prop="code">
<Input v-model="entity.code"></Input>
<FormItem :label="l('type')" prop="type">
<Dictionary code="word_classification_type" v-model="entity.type"></Dictionary>
<!-- <InputNumber v-model="entity.type"></InputNumber> -->
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('description')" prop="description">
<Input v-model="entity.description"></Input>
<FormItem :label="l('englishFullName')" prop="englishFullName">
<Input v-model="entity.englishFullName"></Input>
</FormItem>
</Col>
<Col :span="12" v-if="user">
<FormItem :label="l('userName')" prop="userName">
<UserSelect
ref="userSelected"
:roleTitle="roleTitle"
v-model="entity.userIds"
:multiple="true"
/>
<Col :span="12">
<FormItem :label="l('englishName')" prop="englishName">
<Input v-model="entity.englishName"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="物料类型" prop="materialType">
<Select v-model="materialType" multiple @on-change="changeVal">
<Option v-for="item in list" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select>
<FormItem :label="l('status')" prop="status">
<Dictionary code="word_classification_status" v-model="entity.status"></Dictionary>
<!-- <InputNumber v-model="entity.status"></InputNumber> -->
</FormItem>
</Col>
</Row>
<Col :span="12">
<FormItem :label="l('inheritCategoryId')" prop="inheritCategoryId">
<!-- <Checkbox v-model="entity.inheritCategoryId"></Checkbox> -->
<RadioGroup v-model="inherit">
<Radio label="1"></Radio>
<Radio label="0"></Radio>
</RadioGroup>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('description')" prop="description">
<Input v-model="entity.description" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('template')" prop="templateId">
<!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> -->
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<!-- <Col :span="24">
<FormItem :label="l('templateId')" prop="templateId">
<Input v-model="entity.templateId"></Input>
</FormItem>
</Col>-->
<Col :span="24">
<Divider orientation="left">扩展属性</Divider>
<Table :columns="columns" :data="checkList" border>
<template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<Input
v-model="row.title"
placeholder="请输入名称"
@on-blur="setRow(row,index)"
v-if="row.fieldType==3"
/>
</template>
<template slot-scope="{ row, index }" slot="note">
<!-- <Input v-if="row.dataType==3" v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" /> -->
<Select
v-if="row.dataType==3"
v-model="row.note"
clearable
transfer
@on-change="setRow(row,index)"
>
<Option v-for="item in codeList" :value="item.code" :key="item.code">{{ item.name }}</Option>
</Select>
<span v-else>{{row.note}}</span>
</template>
<template slot-scope="{ row, index }" slot="dataType">
<Dictionary
@on-change="setRow(row,index)"
v-model="row.dataType"
code="materail.category.dataType"
type="select"
:value="row.dataType"
:key="row.dataType"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="unitName">
<Dictionary
v-if="row.dataType==1||row.dataType==2"
@on-change="setRow(row,index)"
v-model="row.unitName"
code="material.main.unitName"
type="select"
placeholder="请选择单位"
:value="row.unitName"
:key="row.unitName"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="required">
<Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox>
</template>
<template slot-scope="{ row, index }" slot="isUnique">
<Checkbox v-model="row.isUnique" @on-change="setRow(row,index)"></Checkbox>
</template>
<template slot-scope="{ row, index }" slot="action">
<a @click="remove(index,row)" style="color:#FF7A8B" v-if="row.fieldType>1">删除</a>
</template>
</Table>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button>
</Col>
<Col :span="24" class="tr mt10">
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Col>
</Row>
</Form>
</template>
<script>
......@@ -46,104 +135,222 @@ export default {
name: "Edit",
data() {
return {
list: [],
roleTitle: "库管",
entity: {
materialType: [],
codeRuleType: "",
},
materialType: [],
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
inherit: null,
checkList: [
{
field: "code",
title: "编号",
note: "",
dataType: 0,
unitName: "",
required: true,
isunique: false,
fieldType: 1,
categoryId: 0,
action: 1,
add: 0, //新增标识
},
{
field: "version",
title: "版本",
note: "",
dataType: 0,
unitName: "",
required: true,
isunique: false,
fieldType: 1,
categoryId: 0,
action: 1,
add: 0, //新增标识
},
{
field: "name",
title: "标题",
note: "",
dataType: 0,
unitName: "",
required: true,
isunique: false,
fieldType: 1, //共有属性(不能删除)
categoryId: 0,
action: 1,
add: 0, //新增标识
},
{
field: "description",
title: "文档详细说明",
note: "",
dataType: 0,
unitName: "",
required: true,
isunique: false,
fieldType: 1, //共有属性(不能删除)
categoryId: 0,
action: 1,
add: 0, //新增标识
},
],
columns: [
{
title: "序号",
type: "index",
width: 80,
align: "center",
},
{
title: "属性名称",
key: "title",
slot: "title",
},
{
title: "属性类型",
key: "dataType",
align: "center",
slot: "dataType",
width: 200,
},
{
title: "设置",
key: "note",
align: "center",
slot: "note",
},
{
title: "单位",
key: "unitName",
align: "center",
slot: "unitName",
width: "150",
},
{
title: "必填",
key: "required",
align: "center",
slot: "required",
width: 80,
},
{
title: "唯一",
key: "isUnique",
align: "center",
slot: "isUnique",
width: 80,
},
{
width: 80,
title: "操作",
slot: "action",
align: "center",
},
],
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
};
},
props: {
v: Object,
eid: Number,
level: Number,
upId: Number,
user: {
type: Boolean,
default: true,
},
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
this.getList();
},
methods: {
getList() {
let data = {
conditions: [
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.parms.eid = r.result.templateId;
if (r.result.inheritCategoryId == 0) {
this.inherit = "0";
} else {
this.inherit = "1";
}
let conditions = [
{
fieldName: "upId",
fieldValue: 0,
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: r.result.id,
},
],
};
Api.list(data).then((r) => {
this.list = r.result;
];
Api.list({
conditions: conditions,
sortBy: "id",
isDesc: false,
}).then((r) => {
if (r.result) {
r.result.map((u) => {
u.mid = u.id;
});
},
changeVal(val) {
let code = [];
let type = [];
for (let i = 0; i < this.list.length; i++) {
let obj = this.list[i];
for (let j = 0; j < val.length; j++) {
if (obj.id == val[j]) {
code.push(obj.code);
type.push(obj.codeRuleType);
}
this.checkList = r.result;
}
});
});
},
remove(index, row) {
if (row.add == 0) {
this.checkList.splice(index, 1);
} else {
row.action = 2;
this.$set(this.checkList, index, row);
this.arr.push(row);
this.checkList.splice(index, 1);
}
this.entity.materialTypeName = code.join(",");
this.entity.codeRuleType = type.join(",");
},
load(v) {
Api.get({ id: v }).then((r) => {
r.result.userIds = this.$u.toIntArray(r.result.userIds);
this.entity = r.result;
var uids = [];
let ids = [];
ids = r.result.materialType.split(",");
ids.map((u) => {
uids.push(parseInt(u));
});
this.materialType = uids;
setRow(row, index) {
this.$set(this.checkList, index, row);
},
addNew() {
let maxId = 0;
this.checkList.map((u) => {
if (u.mid > maxId) {
maxId = u.mid;
}
});
let obj = {
mid: maxId + 1,
field: "c" + maxId,
title: "",
note: "",
dataType: "0",
required: false,
isunique: false,
fieldType: 3,
categoryId: 0,
action: 1,
add: 0, //新增标识
};
this.checkList.push(obj);
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
let materialType = this.materialType.join(",");
let userNam = "";
let userId = "";
if (this.user) {
userId = this.entity.userIds.join(",");
userNam = this.$refs.userSelected.getSelectNames().join(",");
if (this.$refs.refFile.nameList.length > 0) {
this.entity.templateId = this.parms.eid;
} else {
this.entity.templateId = "";
}
let paramsdata = {
id: this.entity.id,
upId: this.entity.upId,
title: this.entity.title, //库位名称
code: this.entity.code, //库位编号
description: this.entity.description, //位置
level: this.entity.level,
userName: userNam, //库管员
userIds: userId, //库管员id
creationTime: this.entity.creationTime,
creatorUserId: this.entity.creatorUserId,
materialType: materialType, //物料类型
materialTypeName: this.entity.materialTypeName, //物料编码
codeRuleType: this.entity.codeRuleType,
if (this.inherit == 0) {
this.entity.inheritCategoryId = 0;
} else {
this.entity.inheritCategoryId = this.entity.id;
}
let data = {
cat: this.entity,
pros: this.checkList,
};
Api.update(paramsdata)
Api.update(data)
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
......@@ -163,7 +370,7 @@ export default {
this.$emit("on-close");
},
l(key) {
key = "store_room_location" + "." + key;
key = "document_category" + "." + key;
return this.$t(key);
},
},
......@@ -173,9 +380,6 @@ export default {
this.load(v);
}
},
user(v) {
this.user = v;
},
},
};
</script>
\ No newline at end of file
<template>
<div>
<div class="mb10 pt5">
<Input v-model="searchValue" placeholder="请输入库位名称" clearable style="width: 240px" />
<Input v-model.trim="searchValue" placeholder="请输入库位名称" clearable style="width: 240px" />
<Button type="primary" class @click="handleSearch">查询</Button>
<div class="fr">
<Button type="primary" @click="add()">新增库位</Button>
<Button type="primary" @click="add()">新增分类</Button>
</div>
</div>
<TreeGrid :columns="columns" :items="treeData"></TreeGrid>
<Modal v-model="modal" :title="title" width="1000" footer-hide>
<component
:is="detail"
:eid="curId"
:level="level"
:upId="upId"
:user="user"
@on-close="cancel"
@on-ok="ok"
/>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" :row="row" />
</Modal>
</div>
</template>
......@@ -30,63 +23,119 @@ export default {
Search,
},
head: {
title: "库房库位",
title: "文档分类",
author: "henq",
description: "store_room_location 7/10/2020 8:57:03 AM",
description: "document_category 9/18/2020 9:33:43 AM",
},
data() {
return {
easySearch: {
keys: { op: "title,code,userName", value: null },
},
searchValue: "", //搜索库位名称
keys: "",
treeData: [],
treeDataOld: [],
row: {},
modal: false,
title: "新增",
detail: null,
curId: 0,
level: null,
upId: null,
user: true,
treeData: [],
treeDataOld: [],
columns: [
// {
// key: "id",
// title: this.$t("id"),
// hide: true,
// align: "left",
// high: true,
// },
{
key: "title",
title: this.l("title"),
key: "name",
title: this.l("name"),
align: "left",
easy: true,
high: true,
},
{
key: "code",
title: this.l("code"),
align: "left",
key: "creationTime",
title: this.l("creationTime"),
width: 180,
align: "center",
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "center",
render: (h, params) => {
if (params.row.creatorUserId) {
return h("User", {
props: {
value: params.row.creatorUserId,
},
});
}
},
},
{ key: "level", title: this.l("level"), align: "center", high: true },
{
key: "description",
title: this.l("description"),
align: "left",
key: "totalDocument",
title: this.l("totalDocument"),
align: "center",
width: 160,
},
// {
// key: "tenantId",
// title: this.l("tenantId"),
// align: "left",
// high: true,
// hide: true,
// },
{
key: "type",
title: this.l("type"),
align: "center",
high: true,
code: "word_classification_type",
},
{
key: "level",
title: this.l("level"),
key: "englishFullName",
title: this.l("englishFullName"),
align: "left",
code: "store.level",
easy: true,
high: true,
},
{
key: "materialTypeName",
title: "物料编号",
key: "englishName",
title: this.l("englishName"),
align: "left",
easy: true,
high: true,
},
{
key: "status",
title: this.l("status"),
align: "center",
high: true,
code: "word_classification_status",
},
{
key: "inheritCategoryId",
title: this.l("inheritCategoryId"),
align: "center",
high: true,
render: (h, params) => {
return h("div", [
h("span", params.row.inheritCategoryId == 0 ? "否" : "是"),
]);
},
},
{
key: "userName",
title: this.l("userName"),
key: "description",
title: this.l("description"),
align: "left",
},
{
title: "操作",
key: "action",
width: 300,
width: 180,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
......@@ -111,7 +160,7 @@ export default {
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row) },
on: { click: () => this.edit(params.row.id) },
},
"编辑"
),
......@@ -119,7 +168,7 @@ export default {
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row) },
on: { click: () => this.remove(params.row.id) },
},
"删除"
),
......@@ -130,7 +179,7 @@ export default {
};
},
mounted() {
this.laodaction(this.keys);
this.laodaction(this.searchValue);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
......@@ -140,9 +189,9 @@ export default {
let params = {
conditions: [
{
fieldName: "title",
fieldName: "keys",
fieldValue: name,
conditionalType: "Like",
conditionalType: "name",
},
],
};
......@@ -159,80 +208,31 @@ export default {
"upId"
);
this.treeData = this.$u.clone(data);
this.treeDataOld = this.$u.clone(data);
});
},
//查询
searchData() {
var name = this.searchValue;
this.laodaction(name);
},
handleSearch() {
let tree = this.$u.clone(this.treeDataOld);
let value = this.searchValue;
if (value.trim() == "") {
this.treeData = this.$u.clone(this.treeDataOld);
} else {
//不满足搜索条件的待删除元素索引数组
let removeArr = [];
for (let i = 0; i < tree.length; i++) {
let node = tree[i];
this.searchTree(node, i, value, removeArr);
}
//遍历删除不满足条件的节点
for (let j = removeArr.length - 1; j >= 0; j--) {
tree.splice(removeArr[j], 1);
}
this.treeData = tree;
}
},
searchTree(node, index, value, removeArr) {
let children = node.children;
//针对非叶子节点,需要递归其children节点
if (children && children.length > 0) {
let innderArr = [];
for (let i = 0; i < children.length; i++) {
this.searchTree(children[i], i, value, innderArr);
}
if (node.title.indexOf(value) === -1) {
for (let j = innderArr.length - 1; j >= 0; j--) {
children.splice(innderArr[j], 1);
}
if (node.children.length === 0) {
removeArr.push(index);
}
}
} else {
//叶子节点,直接进行匹配
if (node.title.indexOf(value) === -1) {
removeArr.push(index);
}
}
},
addOk() {
var name = this.searchValue;
this.laodaction(name);
this.modal = false;
// this.curId = 0
},
ok() {
var name = this.searchValue;
this.laodaction(name);
this.laodaction(this.searchValue);
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = 0;
this.level = 1;
this.user = true;
(this.upId = 0), (this.title = "新增");
this.row.id = '';
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
addrow(params) {
addrow(row) {
this.curId = 0;
this.user = false;
(this.upId = params.id), (this.title = "新增");
this.row = row;
this.detail = () => import("./add");
this.modal = true;
},
......@@ -248,37 +248,50 @@ export default {
this.detail = () => import("./detail");
this.modal = true;
},
edit(row) {
this.curId = row.id;
edit(id) {
this.curId = id;
this.title = "编辑";
if (row.upId == 0) {
this.user = true;
} else {
this.user = false;
}
this.detail = () => import("./edit");
this.modal = true;
},
remove(row) {
if (row.children && row.children.length == 0) {
Api.delete(row.id).then((r) => {
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.laodaction(this.searchValue);
this.$Message.success("删除成功");
var name = this.searchValue;
this.laodaction(name);
}
});
} else {
this.$Message.error("此节点有子节点,不能删除!");
return false;
}
},
cancel() {
this.curId = 0;
this.modal = false;
},
l(key) {
let vkey = "store_room_location" + "." + key;
/*
document_category:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
name:'分类名称',
upId:'上级id',
level:'层级',
totalDocument:'分类下总文档数',
tenantId:'租户id',
type:'类别',
englishFullName:'英文全称',
englishName:'英文简称',
status:'',
description:'',
inheritCategoryId:'继承分类id',
template:'模板路径',
templateId:'',
}
*/
let vkey = "document_category" + "." + key;
return this.$t(vkey) || key;
},
},
......
<template>
<Form ref="form" :model="condition" :label-width="90">
<Row>
<Col :span="12" :v-if="condition.id.show">
<FormItem :label="$t('id')" prop="id">
<Input v-model="condition.id.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.creationTime.show">
<FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker type="daterange" v-model="condition.creationTime.value"></DatePicker>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.creatorUserId.show">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<Input v-model="condition.creatorUserId.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.lastModificationTime.show">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="daterange" v-model="condition.lastModificationTime.value"></DatePicker>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.lastModifierUserId.show">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<Input v-model="condition.lastModifierUserId.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.deletionTime.show">
<FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker type="daterange" v-model="condition.deletionTime.value"></DatePicker>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.upId.show">
<FormItem :label="l('upId')" prop="upId">
<Input v-model="condition.upId.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.materialType.show">
<FormItem :label="l('materialType')" prop="materialType">
<Input v-model="condition.materialType.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.title.show">
<FormItem :label="l('title')" prop="title">
<Input v-model="condition.title.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.code.show">
<FormItem :label="l('code')" prop="code">
<Input v-model="condition.code.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.status.show">
<FormItem :label="l('status')" prop="status">
<Input v-model="condition.status.value"></Input>
</FormItem>
</Col>
<Col :span="24" :v-if="condition.description.show">
<FormItem :label="l('description')" prop="description">
<Input v-model="condition.description.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.level.show">
<FormItem :label="l('level')" prop="level">
<Input v-model="condition.level.value"></Input>
</FormItem>
</Col>
<Col :span="24" :v-if="condition.userName.show">
<FormItem :label="l('userName')" prop="userName">
<Input v-model="condition.userName.value"></Input>
</FormItem>
</Col>
<Col :span="24" :v-if="condition.userIds.show">
<FormItem :label="l('userIds')" prop="userIds">
<Input v-model="condition.userIds.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.id.show"><FormItem :label="$t('id')" prop="id"> <Input v-model="condition.id.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.creationTime.show"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="daterange" v-model="condition.creationTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.creatorUserId.show"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <Input v-model="condition.creatorUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.lastModificationTime.show"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="daterange" v-model="condition.lastModificationTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.lastModifierUserId.show"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <Input v-model="condition.lastModifierUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.deletionTime.show"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="daterange" v-model="condition.deletionTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.name.show"><FormItem :label="l('name')" prop="name"> <Input v-model="condition.name.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.upId.show"><FormItem :label="l('upId')" prop="upId"> <Input v-model="condition.upId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.level.show"><FormItem :label="l('level')" prop="level"> <Input v-model="condition.level.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.totalDocument.show"><FormItem :label="l('totalDocument')" prop="totalDocument"> <Input v-model="condition.totalDocument.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.tenantId.show"><FormItem :label="l('tenantId')" prop="tenantId"> <Input v-model="condition.tenantId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.type.show"><FormItem :label="l('type')" prop="type"> <Input v-model="condition.type.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.englishFullName.show"><FormItem :label="l('englishFullName')" prop="englishFullName"> <Input v-model="condition.englishFullName.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.englishName.show"><FormItem :label="l('englishName')" prop="englishName"> <Input v-model="condition.englishName.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.status.show"><FormItem :label="l('status')" prop="status"> <Input v-model="condition.status.value"> </Input>
</FormItem></Col>
<Col :span="24" :v-if="condition.description.show"><FormItem :label="l('description')" prop="description"> <Input v-model="condition.description.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.inheritCategoryId.show"><FormItem :label="l('inheritCategoryId')" prop="inheritCategoryId"> <Input v-model="condition.inheritCategoryId.value"> </Input>
</FormItem></Col>
<Col :span="24" :v-if="condition.template.show"><FormItem :label="l('template')" prop="template"> <Input v-model="condition.template.value"> </Input>
</FormItem></Col>
<Col :span="24" :v-if="condition.templateId.show"><FormItem :label="l('templateId')" prop="templateId"> <Input v-model="condition.templateId.value"> </Input>
</FormItem></Col>
</Row>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
import Api from './api'
export default {
name: 'Add',
data() {
return {
condition: {
id: { op: "Equal", value: null, show: true },
creationTime: { op: "Range", value: null, show: true },
creatorUserId: { op: "Equal", value: null, show: true },
lastModificationTime: { op: "Range", value: null, show: true },
lastModifierUserId: { op: "Equal", value: null, show: true },
deletionTime: { op: "Range", value: null, show: true },
upId: { op: "Equal", value: null, show: true },
materialType: { op: "Equal", value: null, show: true },
title: { op: "Equal", value: null, show: true },
code: { op: "Equal", value: null, show: true },
status: { op: "Equal", value: null, show: true },
description: { op: "Equal", value: null, show: true },
level: { op: "Equal", value: null, show: true },
userName: { op: "Equal", value: null, show: true },
userIds: { op: "Equal", value: null, show: true }
id:{op:"Equal",value:null,show:true},
creationTime:{op:"Range",value:null,show:true},
creatorUserId:{op:"Equal",value:null,show:true},
lastModificationTime:{op:"Range",value:null,show:true},
lastModifierUserId:{op:"Equal",value:null,show:true},
deletionTime:{op:"Range",value:null,show:true},
name:{op:"Equal",value:null,show:true},
upId:{op:"Equal",value:null,show:true},
level:{op:"Equal",value:null,show:true},
totalDocument:{op:"Equal",value:null,show:true},
tenantId:{op:"Equal",value:null,show:true},
type:{op:"Equal",value:null,show:true},
englishFullName:{op:"Equal",value:null,show:true},
englishName:{op:"Equal",value:null,show:true},
status:{op:"Equal",value:null,show:true},
description:{op:"Equal",value:null,show:true},
inheritCategoryId:{op:"Equal",value:null,show:true},
template:{op:"Equal",value:null,show:true},
templateId:{op:"Equal",value:null,show:true},
},
}
};
},
methods: {
handleClose() {
this.$emit("on-close");
this.$emit('on-close')
},
l(key) {
key = "store_room_location" + "." + key;
return this.$t(key);
key = "document_category" + "." + key;
return this.$t(key)
}
}
}
};
</script>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <InputNumber v-model="entity.isDeleted"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('documentId')" prop="documentId"> <Input v-model="entity.documentId"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('refName')" prop="refName"> <Input v-model="entity.refName"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('refId')" prop="refId"> <Input v-model="entity.refId"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('name')" prop="name"> <Input v-model="entity.name"> </Input>
</FormItem></Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
disabled: false,
entity: {creationTime: null,
creatorUserId: null,
lastModificationTime: null,
lastModifierUserId: null,
isDeleted: null,
deletionTime: null,
deleterUserId: null,
documentId: "",
refName: "",
refId: "",
name: ""},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
v: Object,
eid: Number
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.create(this.entity).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
}).catch(err => {
this.disabled = false;
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
this.entity.id = 0;
});
},
l(key) {
key = "document_ref" + "." + key;
return this.$t(key)
}
},
watch: {
v() {
this.entity = this.$u.clone(this.v)
},
eid(v) {
if (v > 0) {
this.load(v);
}
}
}
}
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index:`${material}documentref/paged`,
paged(params){
return Api.post(`${material}documentref/paged`,params);
},
get(params){
return Api.get(`${material}documentref/get`,params);
},
create(params){
return Api.post(`${material}documentref/create`,params);
},
update(params){
return Api.post(`${material}documentref/update`,params);
},
delete(id) {
return Api.delete(`${material}documentref/delete`,{params:{id:id}});
},
deletes(params) {
return Api.post(`${material}documentref/batchdelete`,params);
}
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed>
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed>
<Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed>
<Filed :span="12" :name="l('documentId')">{{entity.documentId}}</Filed>
<Filed :span="12" :name="l('refName')">{{entity.refName}}</Filed>
<Filed :span="12" :name="l('refId')">{{entity.refId}}</Filed>
<Filed :span="12" :name="l('name')">{{entity.name}}</Filed>
</Row>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
code: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
this.$emit('on-load')
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "document_ref" + "." + key;
return this.$t(key)
}
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
}
}
}
</script>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <InputNumber v-model="entity.isDeleted"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('documentId')" prop="documentId"> <Input v-model="entity.documentId"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('refName')" prop="refName"> <Input v-model="entity.refName"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('refId')" prop="refId"> <Input v-model="entity.refId"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('name')" prop="name"> <Input v-model="entity.name"> </Input>
</FormItem></Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Edit',
data() {
return {
disabled: false,
entity: {
},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
})
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.update(this.entity).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
}).catch(err => {
this.disabled = false;
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "document_ref" + "." + key;
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
}
}
}
</script>
\ No newline at end of file
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入关键字引用的文档名称/文档名称" v-model="easySearch.keys.value" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Search from "./search";
export default {
name: "list",
components: {
Search,
},
head: {
title: "文档引用",
author: "henq",
description: "document_ref 9/18/2020 11:31:43 AM",
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "refName,name", value: null },
},
modal: false,
title: "新增",
detail: null,
curId: 0,
columns: [
{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
high: true,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "left",
high: true,
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
align: "left",
high: true,
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
align: "left",
high: true,
},
{
key: "isDeleted",
title: this.l("isDeleted"),
align: "left",
high: true,
},
{
key: "deletionTime",
title: this.l("deletionTime"),
align: "left",
high: true,
},
{
key: "deleterUserId",
title: this.l("deleterUserId"),
align: "left",
high: true,
},
{
key: "documentId",
title: this.l("documentId"),
align: "left",
high: true,
},
{
key: "refName",
title: this.l("refName"),
align: "left",
easy: true,
high: true,
},
{ key: "refId", title: this.l("refId"), align: "left", high: true },
{
key: "name",
title: this.l("name"),
align: "left",
easy: true,
high: true,
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) },
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) },
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) },
},
"删除"
),
]);
},
},
],
};
},
mounted() {
console.log(this);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
cancel() {
this.curId = 0;
this.modal = false;
},
l(key) {
/*
document_ref:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
documentId:'文档id',
refName:'引用的文档名称',
refId:'引用的文档id',
name:'文档名称',
}
*/
let vkey = "document_ref" + "." + key;
return this.$t(vkey) || key;
},
},
};
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<Form ref="form" :model="condition" :label-width="90">
<Row>
<Col :span="12" :v-if="condition.id.show"><FormItem :label="$t('id')" prop="id"> <Input v-model="condition.id.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.creationTime.show"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="daterange" v-model="condition.creationTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.creatorUserId.show"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <Input v-model="condition.creatorUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.lastModificationTime.show"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="daterange" v-model="condition.lastModificationTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.lastModifierUserId.show"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <Input v-model="condition.lastModifierUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.deletionTime.show"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="daterange" v-model="condition.deletionTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.documentId.show"><FormItem :label="l('documentId')" prop="documentId"> <Input v-model="condition.documentId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.refName.show"><FormItem :label="l('refName')" prop="refName"> <Input v-model="condition.refName.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.refId.show"><FormItem :label="l('refId')" prop="refId"> <Input v-model="condition.refId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.name.show"><FormItem :label="l('name')" prop="name"> <Input v-model="condition.name.value"> </Input>
</FormItem></Col>
</Row>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
condition: {
id:{op:"Equal",value:null,show:true},
creationTime:{op:"Range",value:null,show:true},
creatorUserId:{op:"Equal",value:null,show:true},
lastModificationTime:{op:"Range",value:null,show:true},
lastModifierUserId:{op:"Equal",value:null,show:true},
deletionTime:{op:"Range",value:null,show:true},
documentId:{op:"Equal",value:null,show:true},
refName:{op:"Equal",value:null,show:true},
refId:{op:"Equal",value:null,show:true},
name:{op:"Equal",value:null,show:true},
},
}
},
methods: {
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "document_ref" + "." + key;
return this.$t(key)
}
}
}
</script>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<!-- <Col :span="12">
<FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem>
</Col>-->
<!-- <Col :span="12">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<InputNumber v-model="entity.isDeleted"></InputNumber>
</FormItem>
</Col>-->
<!-- <Col :span="12">
<FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem>
</Col>-->
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="word_template_status" v-model="entity.status" type="radio"></Dictionary>
</FormItem>
</Col>
<!-- <Col :span="12">
<FormItem :label="l('creator')" prop="creator">
<Input v-model="entity.creator"></Input>
</FormItem>
</Col>-->
<Col :span="24">
<FormItem :label="l('url')" prop="url">
<!-- <InputFile v-model="entity.url"></InputFile> -->
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
disabled: false,
entity: {
creatorUserId: this.$store.state.userInfo.userId,
name: "",
status: 1,
creator: "",
remark: "",
url: "",
},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
};
},
props: {
v: Object,
eid: Number,
},
mounted() {
this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
if (this.$refs.refFile.nameList.length > 0) {
this.entity.url = this.parms.eid;
} else {
this.entity.url = "";
}
Api.create(this.entity)
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "document_template" + "." + key;
return this.$t(key);
},
},
watch: {},
};
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index:`${material}/documenttemplate/paged`,
paged(params){
return Api.post(`${material}/documenttemplate/paged`,params);
},
get(params){
return Api.get(`${material}/documenttemplate/get`,params);
},
create(params){
return Api.post(`${material}/documenttemplate/create`,params);
},
update(params){
return Api.post(`${material}/documenttemplate/update`,params);
},
delete(id) {
return Api.delete(`${material}/documenttemplate/delete`,{params:{id:id}});
},
deletes(params) {
return Api.post(`${material}/documenttemplate/batchdelete`,params);
}
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed>
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed>
<Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed>
<Filed :span="12" :name="l('name')">{{entity.name}}</Filed>
<Filed :span="12" :name="l('status')">{{entity.status}}</Filed>
<Filed :span="12" :name="l('creator')">{{entity.creator}}</Filed>
<Filed :span="12" :name="l('remark')">{{entity.remark}}</Filed>
<Filed :span="24" :name="l('url')">{{entity.url}}</Filed>
</Row>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
code: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
this.$emit('on-load')
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "document_template" + "." + key;
return this.$t(key)
}
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
}
}
}
</script>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<!-- <Col :span="12">
<FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem>
</Col>-->
<!-- <Col :span="12">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<InputNumber v-model="entity.isDeleted"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem>
</Col>-->
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="word_template_status" v-model="entity.status" type="radio"></Dictionary>
</FormItem>
</Col>
<!-- <Col :span="12">
<FormItem :label="l('creator')" prop="creator">
<Input v-model="entity.creator"></Input>
</FormItem>
</Col>-->
<Col :span="24">
<FormItem :label="l('url')" prop="url">
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Edit",
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
};
},
props: {
eid: Number,
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.parms.eid = r.result.url;
});
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
if (this.$refs.refFile.nameList.length > 0) {
this.entity.url = this.parms.eid;
} else {
this.entity.url = "";
}
Api.update(this.entity)
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "document_template" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入名称" v-model="easySearch.keys.value" clearable />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Search from "./search";
export default {
name: "list",
components: {
Search,
},
head: {
title: "文档模板",
author: "henq",
description: "document_template 9/16/2020 2:24:01 PM",
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "name", value: null },
},
modal: false,
title: "新增",
detail: null,
curId: 0,
columns: [
{
type: "index",
width: 60,
align: "center",
},
{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true,
},
{
key: "name",
title: this.l("name"),
align: "left",
easy: true,
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
high: true,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "left",
high: true,
type: "user",
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
align: "left",
high: true,
hide: true,
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
align: "left",
high: true,
hide: true,
},
{
key: "isDeleted",
title: this.l("isDeleted"),
align: "left",
high: true,
hide: true,
},
{
key: "deletionTime",
title: this.l("deletionTime"),
align: "left",
high: true,
hide: true,
},
{
key: "deleterUserId",
title: this.l("deleterUserId"),
align: "left",
high: true,
hide: true,
},
{
key: "status",
title: this.l("status"),
align: "left",
high: true,
code: "word_template_status",
},
// { key: "creator", title: this.l("creator"), align: "left", high: true },
{ key: "remark", title: this.l("remark"), align: "left", high: true },
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) },
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) },
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) },
},
"删除"
),
]);
},
},
],
};
},
mounted() {
console.log(this);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
cancel() {
this.curId = 0;
this.modal = false;
},
l(key) {
/*
document_template:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
name:'名称',
status:'状态',
creator:'创建人',
remark:'',
url:'模板路径',
}
*/
let vkey = "document_template" + "." + key;
return this.$t(vkey) || key;
},
},
};
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<Form ref="form" :model="condition" :label-width="90">
<Row>
<Col :span="12" :v-if="condition.id.show"><FormItem :label="$t('id')" prop="id"> <Input v-model="condition.id.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.creationTime.show"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="daterange" v-model="condition.creationTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.creatorUserId.show"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <Input v-model="condition.creatorUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.lastModificationTime.show"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="daterange" v-model="condition.lastModificationTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.lastModifierUserId.show"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <Input v-model="condition.lastModifierUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.deletionTime.show"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="daterange" v-model="condition.deletionTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.name.show"><FormItem :label="l('name')" prop="name"> <Input v-model="condition.name.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.status.show"><FormItem :label="l('status')" prop="status"> <Input v-model="condition.status.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.creator.show"><FormItem :label="l('creator')" prop="creator"> <Input v-model="condition.creator.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.remark.show"><FormItem :label="l('remark')" prop="remark"> <Input v-model="condition.remark.value"> </Input>
</FormItem></Col>
<Col :span="24" :v-if="condition.url.show"><FormItem :label="l('url')" prop="url"> <Input v-model="condition.url.value"> </Input>
</FormItem></Col>
</Row>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
condition: {
id:{op:"Equal",value:null,show:true},
creationTime:{op:"Range",value:null,show:true},
creatorUserId:{op:"Equal",value:null,show:true},
lastModificationTime:{op:"Range",value:null,show:true},
lastModifierUserId:{op:"Equal",value:null,show:true},
deletionTime:{op:"Range",value:null,show:true},
name:{op:"Equal",value:null,show:true},
status:{op:"Equal",value:null,show:true},
creator:{op:"Equal",value:null,show:true},
remark:{op:"Equal",value:null,show:true},
url:{op:"Equal",value:null,show:true},
},
}
},
methods: {
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "document_template" + "." + key;
return this.$t(key)
}
}
}
</script>
\ No newline at end of file
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