Commit 6b5b68d7 authored by 仇晓婷's avatar 仇晓婷

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

parents 3e8ee6fc af48d377
......@@ -302,10 +302,10 @@ export default {
};
},
created() {
this.initColumns();
},
mounted() {
this.initColumns();
if (this.data && this.data.length > 0) {
this.list = this.data;
return;
......@@ -367,24 +367,24 @@ export default {
});
var items=this.$u.clone(this.columns);
var soct=this.$scopedSlots;
console.warn("that.$scopedSlots()",soct["action"]());
items.forEach((u) => {
if (u.slot) {
u.render = (h, params) => {
return h(
"span",
// soct[u.slot]({
// row: params.row,
// column: params.column,
// index: params.index,
// })
params.row.id
);
};
delete u.slot;
}
});
// var soct=this.$scopedSlots;
// // console.warn("that.$scopedSlots()",soct["action"]());
// items.forEach((u) => {
// if (u.slot) {
// u.render = (h, params) => {
// return h(
// "span",
// // soct[u.slot]({
// // row: params.row,
// // column: params.column,
// // index: params.index,
// // })
// params.row.id
// );
// };
// delete u.slot;
// }
// });
this.columnsCur = items;
console.log("cur", items,this.columnsCur);
},
......
......@@ -98,8 +98,8 @@ export default {
action: '操作',
creationTime: '操作时间',
libraryTube: '操作人',
routingDetail:'工序名称',
routingDetailNo:'工序号'
routingDetail: '工序名称',
routingDetailNo: '工序号'
},
MaterialPowder: {
code: '粉末编码',
......@@ -435,11 +435,11 @@ export default {
cityName: '省市县',
creationTime: '创建时间',
upMent: '上级部门',
code:'部门编号',
location:'省市县',
parent_Id:'上级部门',
property:'属性',
parentTitle:'上级部门'
code: '部门编号',
location: '省市县',
parent_Id: '上级部门',
property: '属性',
parentTitle: '上级部门'
},
instance: {
id: '主键',
......@@ -1437,19 +1437,19 @@ export default {
executive_branch: '执行部门',
},
remind:{//工艺提醒,工艺案例
remind: { //工艺提醒,工艺案例
title: '名称',
creator: '创建人',
creationTime:'创建时间',
creationTime: '创建时间',
content: '内容',
filePath: "上传文件", //文件路径
filePaths: "", //多个文件路径
dispatchId: '工单id',
routingDetailId: '工序id',
routingDetail:'工序',
routingDetail: '工序',
routingHeaderId: '工艺规程id',
type: '类型(1工艺案例,2工艺提醒)',
status:'状态',
status: '状态',
},
product_info: {
......@@ -1475,7 +1475,7 @@ export default {
version: "版本"
},
order_list: {
Id:'工单Id',
Id: '工单Id',
mesCode: '订单编号',
status: '工单状态',
statusOrder: '订单状态',
......@@ -1682,144 +1682,163 @@ export default {
storeId: '库位id',
storeTitle: '库位名称',
stockCode: '物料序号',
count1:"可申请数",
count2:"申请数",
count3:"已领用数/出库数",
count4:"领用",
applicationNumber:"申请数"
count1: "可申请数",
count2: "申请数",
count3: "已领用数/出库数",
count4: "领用",
applicationNumber: "申请数"
},
//导入中心
import_center:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'是否删除',
deletionTime:'删除时间',
deleterUserId:'删除人',
creator:'上传人',
lastModifier:'更新人名',
name:'名称',
file:'文件',
status:'状态',
remark:'备注',
import_center: {
creationTime: '创建时间',
creatorUserId: '创建人',
lastModificationTime: '更新时间',
lastModifierUserId: '更新人',
isDeleted: '是否删除',
deletionTime: '删除时间',
deleterUserId: '删除人',
creator: '上传人',
lastModifier: '更新人名',
name: '名称',
file: '文件',
status: '状态',
remark: '备注',
},
UserMessage:{
title:'标题',
creationTime:'接受时间',
content:'内容',
senderId:'发送人',
receiverId:'接受人',
status:'状态',
messageType:'类别',
content:'内容',
UserMessage: {
title: '标题',
creationTime: '接受时间',
content: '内容',
senderId: '发送人',
receiverId: '接受人',
status: '状态',
messageType: '类别',
content: '内容',
},
//文档分类
document_category:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
name:'分类名称',
upId:'上级id',
level:'层级',
totalDocument:'分类下总文档数',
tenantId:'租户id',
type:'类别',
englishFullName:'英文全称',
englishName:'英文简称',
status:'',
inheritCategoryId:'继承', //继承分类id
document_category: {
creationTime: '创建时间',
creatorUserId: '创建人',
lastModificationTime: '更新时间',
lastModifierUserId: '更新人',
isDeleted: '删除人',
deletionTime: '删除时间',
deleterUserId: '删除人',
name: '分类名称',
upId: '上级id',
level: '层级',
totalDocument: '分类下总文档数',
tenantId: '租户id',
type: '类别',
englishFullName: '英文全称',
englishName: '英文简称',
status: '',
inheritCategoryId: '继承', //继承分类id
// url:'上传模板', //模板路径
template:'模板Id', //模板路径
templateId:'选择模板',
status:'状态',
workFlows:'选择流程',
workFlowIds:'流程Id',
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:'文档名称',
},
document_property_definition:{
title:'标题',
name:'编号',
revision:'版本',
description:'详细说明',
miji:"密级",
status:'状态',
filePath:'上传文件',
img:'上传图片',
field:'字段',
dataType:'数据类型',
dataLength:'数据长度',
dictionaryId:'',
note:'',
unitName:'单位',
tag:'属性类别',
categoryId:'所属分类',
required:'必填',
isUnique:'是否唯一',
fieldType:'',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
dictionaryCode:'',
codeRuleId:'',
},
project_main:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'标题',
note:'备注',
state:'状态',
type:'分类',
picture:'图片',
attachment:'附件',
phase:'阶段',
startDate:'开始日期',
endDate:'结束日期',
businessUnits:'业务单位',
}
template: '模板Id', //模板路径
templateId: '选择模板',
status: '状态',
workFlows: '选择流程',
workFlowIds: '流程Id',
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: '文档名称',
},
document_property_definition: {
title: '标题',
name: '编号',
revision: '版本',
description: '详细说明',
miji: "密级",
status: '状态',
filePath: '上传文件',
img: '上传图片',
field: '字段',
dataType: '数据类型',
dataLength: '数据长度',
dictionaryId: '',
note: '',
unitName: '单位',
tag: '属性类别',
categoryId: '所属分类',
required: '必填',
isUnique: '是否唯一',
fieldType: '',
creationTime: '创建时间',
creatorUserId: '创建人',
lastModificationTime: '更新时间',
lastModifierUserId: '更新人',
isDeleted: '删除人',
deletionTime: '删除时间',
deleterUserId: '删除人',
dictionaryCode: '',
codeRuleId: '',
},
project_plan: {
creationTime: '创建时间',
creatorUserId: '创建人',
lastModificationTime: '更新时间',
lastModifierUserId: '更新人',
isDeleted: '删除人',
deletionTime: '删除时间',
deleterUserId: '删除人',
projectId: '项目id',
upId: '父级',
title: '标题',
status: '状态',
note: '备注',
startDate: '开始日期',
endDate: '结束日期',
type: '类型',
attachment: '附件',
executor: '执行人',
}
,
project_main: {
creationTime: '创建时间',
creatorUserId: '创建人',
lastModificationTime: '更新时间',
lastModifierUserId: '更新人',
isDeleted: '删除人',
deletionTime: '删除时间',
deleterUserId: '删除人',
title: '标题',
note: '备注',
state: '状态',
type: '分类',
picture: '图片',
attachment: '附件',
phase: '阶段',
startDate: '开始日期',
endDate: '结束日期',
businessUnits: '业务单位',
}
}
import XLSX from 'xlsx';
import Api from '@/plugins/request'
let henq = {};
let pdfInfo = ''
henq.clone = (obj) => {
......@@ -169,38 +170,37 @@ henq.findRoots = (arr1, id) => {
//省市县pacc转为list
henq.treeToList1 = (tree) => {
let list = [];
function treeToList1(data) {
data.map(u => {
if (u.children&&u.level!=1) {
if (u.children && u.level != 1) {
treeToList1(u.children, u)
}
else if(u.children&&u.level==1)
{
list=list.concat(u.children);
} else if (u.children && u.level == 1) {
list = list.concat(u.children);
}
})
}
treeToList1(tree, null)
return list;
}
//根据departId返出上级所有name
henq.getDepartAllName = (list,id) => {
henq.getDepartAllName = (list, id) => {
let names = '';
function getDepartAllName(list,id) {
function getDepartAllName(list, id) {
list.map(u => {
if(id==u.id)
{
names=u.name+"/"+names
if (u.parent_Id>0) {
getDepartAllName(list, u.parent_Id)
if (id == u.id) {
names = u.name + "/" + names
if (u.parent_Id > 0) {
getDepartAllName(list, u.parent_Id)
}
}
}
})
}
getDepartAllName(list,id)
return names.slice(0,names.length-1);
getDepartAllName(list, id)
return names.slice(0, names.length - 1);
}
//导出pdf
henq.outPdf = (ele, fileName) => {
......@@ -343,4 +343,212 @@ henq.dirCode = (code, v) => {
}
return items
}
henq.makeRules = (list, apiUrl) => {
//测试数据start
list = [{ //普通输入框
columnDescription: "测试列1", // 中文名称
dbColumnName: "colums1", // 字段名称
dataType: "varchar", // 数据库中字段类型
propertyName: "colums1", //程序中的字段名称
propertyType: "String", // 程序中的字段类型
code: "", // 数据字典编码
isNullable: false, // 是否可空
isKey: false, // 是否主键
unit: "", // 单位
length: 50, //
decimalDigits: 0, // 精度
link: 0, //外键 表的
defaultValue: "", // 默认值
control: 0,
uniqueness: 0, // 唯一性 0 不限制 1 表内唯一 2 表内某条件下唯一
ruleType: "", // 邮箱 ,电话,等
},
{ //数据字典项
columnDescription: "测试列2",
dbColumnName: "colums2",
dataType: "int32",
propertyName: "colums2",
propertyType: "int",
code: "aps.plan.status",
isNullable: false,
isKey: false,
unit: "",
length: 50,
decimalDigits: 0,
link: 0,
defaultValue: "",
control: 0,
uniqueness: 0,
ruleType: "",
},
{ //手机号码
columnDescription: "测试列3",
dbColumnName: "colums3",
dataType: "varchar",
propertyName: "colums3",
propertyType: "int",
code: "",
isNullable: false,
isKey: false,
unit: "",
length: 50,
decimalDigits: 0,
link: 0,
defaultValue: "",
control: 0,
uniqueness: 0,
ruleType: "phone",
},
{ //电子邮件
columnDescription: "测试列4",
dbColumnName: "colums4",
dataType: "varchar",
propertyName: "colums4",
propertyType: "String",
code: "",
isNullable: false,
isKey: false,
unit: "",
length: 50,
decimalDigits: 0,
link: 0,
defaultValue: "",
control: 0,
uniqueness: 0,
ruleType: "email",
},
{ //唯一性api接口校验
columnDescription: "测试列5",
dbColumnName: "colums5",
dataType: "varchar",
propertyName: "colums5",
propertyType: "String",
code: "",
isNullable: false,
isKey: false,
unit: "",
length: 50,
decimalDigits: 0,
link: 0,
defaultValue: "",
control: 0,
uniqueness: 1, //表内唯一验证
ruleType: "",
},
{ //日期校验
columnDescription: "测试列6",
dbColumnName: "colums6",
dataType: "datetime",
propertyName: "colums6",
propertyType: "String",
code: "",
isNullable: false,
isKey: false,
unit: "",
length: 50,
decimalDigits: 0,
link: 0,
defaultValue: "",
control: 0,
uniqueness: 0, //表内唯一验证
ruleType: "datetime",
}
]
apiUrl = `${systemUrl}/user/list`
//测试数据end
//唯一性校验
const validateCol = (rule, value, callback) => {
if (!value) {
return callback(new Error("输入不能为空"));
}
var params1 = {
"conditions": [{
"fieldName": "cardNo",
"fieldValue": value,
"conditionalType": "Equal"
}],
"pageSize": 3
}
Api.post(apiUrl, params1).then((r) => {
if (r.result.length > 0) {
return callback(new Error("输入数据已经存在"));
} else {
callback();
}
})
};
//手机号验证
const valideTel = (rule, value, callback) => {
var re = /^1[3-9]{1}[0-9]{9}/;
if (value === "" || value === null) {
callback(new Error("请输入手机号"));
} else if (!re.test(value)) {
callback(new Error("请输入正确手机号"));
} else {
callback();
}
}
let rules = {}
list.forEach(el => {
if (!el.isNullable) {
let objInfo = {}
rules[el.propertyName] = []
if (el.code == '') { //不能为空,必填文本或数字类型
if (el.ruleType == '') {
objInfo = {
required: true,
message: "必填",
trigger: "blur"
}
if (el.uniqueness != 0) {
var objUniqueness = {
validator: validateCol,
trigger: "blur"
}
}
} else if (el.ruleType == 'email') {
objInfo = {
required: true,
message: '必填',
trigger: 'blur',
type: 'email'
}
} else if (el.ruleType == 'phone') {
objInfo = {
validator: valideTel,
required: true,
trigger: "blur"
}
}
else if (el.ruleType == 'datetime')
{
objInfo = {
required: true,
message: "请选择时间",
trigger: "change"
}
}
} else { //数据字典
objInfo = {
required: true,
message: "必选",
trigger: "change",
type: "number",
}
}
rules[el.propertyName].push(objInfo)
if (el.uniqueness != 0) {
rules[el.propertyName].push(objUniqueness)
}
}
})
return rules
}
export default henq;
......@@ -322,9 +322,9 @@ export default {
this.goMethod(params.row) : null,
},
},
params.row.mainRoutingSetStatus == 0 ?
params.row.mainRoutingSetStatus == 0 && params.row.isPreschedule == 0 ?
"工艺派发" :
params.row.mainRoutingSetStatus == 1 ?
params.row.mainRoutingSetStatus == 1 && params.row.isPreschedule == 0 ?
"移入排产" :
""
),
......
This diff is collapsed.
<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('projectId')" prop="projectId">
<InputNumber v-model="entity.projectId"></InputNumber> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('upId')" prop="upId">
<InputNumber v-model="entity.upId"></InputNumber> </FormItem
></Col> -->
<Col :span="12"
><FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('status')" prop="status">
<Dictionary
code="mes.project_plan.Status"
v-model="entity.status"
></Dictionary> </FormItem
></Col>
<Col :span="24"
><FormItem :label="l('note')" prop="note">
<Input
v-model="entity.note"
type="textarea"
:rows="5"
></Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('startDate')" prop="startDate">
<DatePicker
type="date"
v-model="entity.startDate"
></DatePicker> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('endDate')" prop="endDate">
<DatePicker
type="date"
v-model="entity.endDate"
></DatePicker> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('type')" prop="type">
<Dictionary
code="mes.project_plan.Type"
v-model="entity.type"
></Dictionary> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('attachment')" prop="attachment">
<Input v-model="entity.attachment"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('executor')" prop="executor">
<Input v-model="entity.executor"> </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,
projectId: "33930562-a9f7-bd95-88ab-d01eb1c4c369",
upId: "33930562-a9f7-bd95-88ab-d01eb1c4c369",
title: "",
status: 0,
note: "",
startDate: null,
endDate: null,
type: 0,
attachment: "",
executor: "",
},
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 = "project_plan" + "." + key;
return this.$t(key);
},
},
watch: {
v() {
this.entity = this.$u.clone(this.v);
},
eid(v) {
if (v) {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index: `${material}proje/ctplan/paged`,
paged(params) {
return Api.post(`${material}/projectplan/paged`, params);
},
list(params) {
return Api.post(`${material}/projectplan/list`, params);
},
get(params) {
return Api.get(`${material}/projectplan/get`, params);
},
create(params) {
return Api.post(`${material}/projectplan/create`, params);
},
update(params) {
return Api.post(`${material}/projectplan/update`, params);
},
delete(id) {
return Api.delete(`${material}/projectplan/delete`, {
params: {
id: id
}
});
},
deletes(params) {
return Api.post(`${material}/projectplan/batchdelete`, params);
}
}
<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('projectId')">{{entity.projectId}}</Filed>
<Filed :span="12" :name="l('upId')">{{entity.upId}}</Filed>
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('status')">{{entity.status}}</Filed>
<Filed :span="24" :name="l('note')">{{entity.note}}</Filed>
<Filed :span="12" :name="l('startDate')">{{entity.startDate}}</Filed>
<Filed :span="12" :name="l('endDate')">{{entity.endDate}}</Filed>
<Filed :span="12" :name="l('type')">{{entity.type}}</Filed>
<Filed :span="12" :name="l('attachment')">{{entity.attachment}}</Filed>
<Filed :span="12" :name="l('executor')">{{entity.executor}}</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 = "project_plan" + "." + 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('projectId')" prop="projectId"> <InputNumber v-model="entity.projectId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('upId')" prop="upId"> <InputNumber v-model="entity.upId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('title')" prop="title"> <Input v-model="entity.title"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('status')" prop="status"> <Dictionary code="mes.project_plan.Status" v-model="entity.status"></Dictionary>
</FormItem></Col>
<Col :span="24"><FormItem :label="l('note')" prop="note"> <Input v-model="entity.note" type="textarea" :rows="5"></Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('startDate')" prop="startDate"> <DatePicker type="date" v-model="entity.startDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('endDate')" prop="endDate"> <DatePicker type="date" v-model="entity.endDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('type')" prop="type"> <Dictionary code="mes.project_plan.Type" v-model="entity.type"></Dictionary>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('attachment')" prop="attachment"> <Input v-model="entity.attachment"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('executor')" prop="executor"> <Input v-model="entity.executor"> </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 = "project_plan" + "." + key;
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
}
}
}
</script>
\ No newline at end of file
<template>
<div>
<Card class="mb20">
<p slot="extra">
<Icon type="ios-arrow-down" />
</p>
项目信息
</Card>
<Card>
<TreeGrid :columns="columns" ref="grid" :items="list"
><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>
</TreeGrid>
</Card>
<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: "project_plan 10/19/2020 10:23:07 AM",
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "title", value: null },
},
modal: false,
title: "新增",
detail: null,
curId: 0,
list: [
],
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:"projectId",title:this.l("projectId") ,align:"left" ,high:true },
// { key:"upId",title:this.l("upId") ,align:"left" ,high:true },
{ type: "selection", width: 80, align: "center" },
{
title: "操作",
key: "action",
width: 150,
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) },
},
"删除"
),
]);
},
},
{
key: "type",
width:90,
title: this.l("type"),
align: "left",
high: true,
code: "mes.project_plan.Type",
},
{
key: "title",
title: this.l("title"),
align: "left",
tree: true,
easy: true,
high: true,
},
{
key: "status",
title: this.l("status"),
align: "left",
high: true,
code: "mes.project_plan.Status",
},
{
key: "startDate",
title: this.l("startDate"),
align: "left",
high: true,
},
{ key: "endDate", title: this.l("endDate"), align: "left", high: true },
// {
// key: "attachment",
// title: this.l("attachment"),
// align: "left",
// high: true,
// },
{
key: "executor",
title: this.l("executor"),
align: "left",
high: true,
},
],
};
},
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);
var params={
conditions:[]
}
Api.list(params).then(r=>{
})
},
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) {
/*
project_plan:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
projectId:'项目id',
upId:'父级',
title:'标题',
status:'状态',
note:'备注',
startDate:'开始日期',
endDate:'结束日期',
type:'类型',
attachment:'附件',
executor:'执行人',
}
*/
let vkey = "project_plan" + "." + 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.projectId.show"><FormItem :label="l('projectId')" prop="projectId"> <Input v-model="condition.projectId.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.title.show"><FormItem :label="l('title')" prop="title"> <Input v-model="condition.title.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.status.show"><FormItem :label="l('status')" prop="status"> <Dictionary code="mes.project_plan.Status" v-model="condition.status.value"></Dictionary>
</FormItem></Col>
<Col :span="24" :v-if="condition.note.show"><FormItem :label="l('note')" prop="note"> <Input v-model="condition.note.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.startDate.show"><FormItem :label="l('startDate')" prop="startDate"> <DatePicker type="daterange" v-model="condition.startDate.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.endDate.show"><FormItem :label="l('endDate')" prop="endDate"> <DatePicker type="daterange" v-model="condition.endDate.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.type.show"><FormItem :label="l('type')" prop="type"> <Dictionary code="mes.project_plan.Type" v-model="condition.type.value"></Dictionary>
</FormItem></Col>
<Col :span="12" :v-if="condition.attachment.show"><FormItem :label="l('attachment')" prop="attachment"> <Input v-model="condition.attachment.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.executor.show"><FormItem :label="l('executor')" prop="executor"> <Input v-model="condition.executor.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},
projectId:{op:"Equal",value:null,show:true},
upId:{op:"Equal",value:null,show:true},
title:{op:"Equal",value:null,show:true},
status:{op:"Equal",value:null,show:true},
note:{op:"Equal",value:null,show:true},
startDate:{op:"Range",value:null,show:true},
endDate:{op:"Range",value:null,show:true},
type:{op:"Equal",value:null,show:true},
attachment:{op:"Equal",value:null,show:true},
executor:{op:"Equal",value:null,show:true},
},
}
},
methods: {
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "project_plan" + "." + key;
return this.$t(key)
}
}
}
</script>
\ No newline at end of file
<style lang="less">
.test_layout {
height: 100%;
.bg1 {
background: #fefefe;
}
// &.fg {
// // overflow: auto;
// }
height: 100%;
.bg1 {
background: #fefefe;
}
// &.fg {
// // overflow: auto;
// }
}
.layout-copy {
text-align: center;
padding: 10px 0 20px;
color: #9ea7b4;
text-align: center;
padding: 10px 0 20px;
color: #9ea7b4;
}
</style>
<template>
<div class="flex fd test_layout">
<div class="flex fd test_layout">
<div>
<Menu mode="horizontal" theme="light" active-name="a0">
<div class="layout-assistant">
<MenuItem name="a0" to="/test/example">基础组件</MenuItem>
<MenuItem name="a1" to="/test/user">人员选择</MenuItem>
<MenuItem name="a2" to="/test/com">异步组件</MenuItem>
<MenuItem name="a4" to="/test/resource">资源选择</MenuItem>
<MenuItem name="a3" to="/test/view">详情拖拽排版</MenuItem>
</div>
</Menu>
<Menu mode="horizontal" theme="light" active-name="a0">
<div class="layout-assistant">
<MenuItem name="a0" to="/test/example">基础组件</MenuItem>
<MenuItem name="a1" to="/test/user">人员选择</MenuItem>
<MenuItem name="a2" to="/test/com">异步组件</MenuItem>
<MenuItem name="a4" to="/test/resource">资源选择</MenuItem>
<MenuItem name="a3" to="/test/view">详情拖拽排版</MenuItem>
<MenuItem name="a5" to="/test/test1">colum验证</MenuItem>
</div>
</Menu>
</div>
<div class="fg">
<nuxt-child></nuxt-child>
<nuxt-child></nuxt-child>
</div>
</div>
</div>
</template>
<script>
export default {
layout: "empty",
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
}
layout: "empty",
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
}
};
</script>
\ No newline at end of file
</script>
<template>
<div style="width:100%;">
<Form :model="orderSearchForm" :label-width="120" :rules="ruleValidate" ref="formValidate">
<Row>
<Col span="8">
<FormItem label="输入校验" style="width:100%" prop="colums1">
<Input v-model="orderSearchForm.colums1" style="width:240px" />
</FormItem>
</Col>
<Col span="8">
<FormItem label="数据字典" style="width:100%" prop="colums2">
<dictionary code="plan.order.taskType" v-model="orderSearchForm.colums2" style="width:240px"></dictionary>
</FormItem>
</Col>
<Col span="8">
<FormItem label="电话校验" style="width:100%" prop="colums3">
<Input v-model="orderSearchForm.colums3" style="width:240px" />
</FormItem>
</Col>
<Col span="8">
<FormItem label="email校验" style="width:100%" prop="colums4">
<Input v-model="orderSearchForm.colums4" style="width:240px" />
</FormItem>
</Col>
<Col span="8">
<FormItem label="唯一性校验(用户编号)" style="width:100%" prop="colums5">
<Input v-model="orderSearchForm.colums5" style="width:240px" />
</FormItem>
</Col>
<Col span="8">
<FormItem label="时间校验" style="width:100%" prop="colums6">
<DatePicker v-model="orderSearchForm.colums6" type="date" placeholder="请选择日期" @on-change="getTime"></DatePicker>
</FormItem>
</Col>
</Row>
<Row>
<Col span="24">
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
</FormItem>
</Col>
</Row>
</Form>
</div>
</template>
<script>
export default {
layout: 'empty',
name: "Test1",
data() {
return {
orderSearchForm: {
colums6: ""
},
ruleValidate: this.$u.makeRules(),
};
},
mounted() {
},
methods: {
handleSubmit() {
this.$refs.formValidate.validate((v) => {
if (v) {
this.$Message.success('验证通过')
}
});
},
getTime(value) {
if (value != '') {
this.orderSearchForm.colums6 = this.getFormatDateEnd(value);
}
},
getFormatDateEnd(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate()) +
" 23:59:59";
return resDate;
},
p(s) {
return s < 10 ? "0" + s : s;
},
},
};
</script>
<template>
<div class="flex">
<div class="flex">
<div class="fg1">
<Form ref="form" :model="entity" :rules="rules" :label-width="110">
<Row class="view">
<Col :span="12" class="item" v-for="(li,i) in items" :key="i" v-dragging="{ item: li, list: items}">
<FormItem :label="li.key" :prop="li.key">
<component :is="li.control" :value="entity[li.key]" />
</FormItem>
</Col>
</Row>
<div>
{{
<Form ref="form" :model="entity" :rules="rules" :label-width="110">
<Row class="view">
<Col :span="12" class="item" v-for="(li,i) in items" :key="i" v-dragging="{ item: li, list: items}">
<FormItem :label="li.key" :prop="li.key">
<component :is="li.control" :value="entity[li.key]" />
</FormItem>
</Col>
</Row>
<div>
{{
entity
}}
<Button type="primary" @click="con">conso</Button>
</div>
</Form>
<Button type="primary" @click="con">conso</Button>
</div>
</Form>
</div>
<div v-width="25">
<ul>
......@@ -27,60 +27,63 @@
</li>
</ul>
</div>
</div>
</div>
</template>
<script>
export default {
name: "",
data() {
return {
items: [],
entity: {},
rules: null
};
},
created() {
this.init();
},
methods: {
con() {
console.warn("entity", this.entity);
name: "",
data() {
return {
items: [],
entity: {},
rules: null
};
},
created() {
this.init();
},
init() {
let items = [];
let controls = ["Input", "InputNumber", "Dictionary", "DatePicker"];
for (let i = 0; i < 5; i++) {
this.entity["I" + i] = i;
items.push({
key: "I" + i,
name: "Item" + i,
width: 4,
control: controls[i % 4],
height: 1
});
}
this.items = items;
methods: {
con() {
console.warn("entity", this.entity);
},
init() {
let items = [];
let controls = ["Input", "InputNumber", "Dictionary", "DatePicker"];
for (let i = 0; i < 5; i++) {
this.entity["I" + i] = i;
items.push({
key: "I" + i,
name: "Item" + i,
width: 4,
control: controls[i % 4],
height: 1
});
}
this.items = items;
}
}
}
};
</script>
<style lang="less" >
<style lang="less">
@line-height: 40px;
@item-width: 12.5%;
.view {
margin: 30px;
border: 1px solid #ddd;
line-height: @line-height;
background-color: white;
.item {
border-right: 1px solid #ddd;
border-top: 1px solid #ddd;
margin-right: -1px;
margin-top: -1px;
border-bottom: 1px solid #ddd;
text-align: center;
box-sizing: border-box;
}
margin: 30px;
border: 1px solid #ddd;
line-height: @line-height;
background-color: white;
.item {
border-right: 1px solid #ddd;
border-top: 1px solid #ddd;
margin-right: -1px;
margin-top: -1px;
border-bottom: 1px solid #ddd;
text-align: center;
box-sizing: border-box;
}
}
</style>
\ No newline at end of file
</style>
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