Commit 146db3e9 authored by renjintao's avatar renjintao

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

parents 8f87ce01 f28c5af8
<template>
<div>
<Input v-model="newName" placeholder="请选择上传文件">
<Button v-if="view" icon="ios-eye" slot="prepend" @click="downFile(newName)"> </Button>
<Button type="primary" icon="ios-cloud-upload-outline" slot="append" @click="handler">上传</Button>
<Input v-model="newName" placeholder="请选择上传文件" v-if="inputShow">
<Button
v-if="view"
icon="ios-eye"
slot="prepend"
@click="downFile(newName)"
>
</Button>
<Button
type="primary"
icon="ios-cloud-upload-outline"
slot="append"
@click="handler"
>上传</Button
>
</Input>
<Button
v-else
type="primary"
icon="ios-cloud-upload-outline"
slot="append"
@click="handler"
>上传</Button
>
<Upload
v-model="name"
:action="postUrl"
......@@ -18,8 +38,9 @@
:files="files"
:on-progress="onProgress"
>
<Button v-show="1==2" type="primary" ref="upload">上传</Button>
<Button v-show="1 == 2" type="primary" ref="upload">上传</Button>
</Upload>
<Progress :percent="per" :stroke-width="5" v-show="vshowPro" />
</div>
</template>
......@@ -29,10 +50,11 @@ export default {
name: "inputFile",
model: {
prop: "value",
event: "on-change"
event: "on-change",
},
data() {
return {
inputShow: true,
file: null,
name: this.value,
downUrl: fileUrlDown,
......@@ -48,7 +70,7 @@ export default {
newName: "",
newPath: "",
per: 0,
vshowPro: false
vshowPro: false,
};
},
created() {},
......@@ -56,20 +78,20 @@ export default {
value: [String, Number, Array, Object],
maxSize: {
type: Number,
default: 10240
default: 10240,
},
files: {
type: Boolean,
default: false
default: false,
},
parms: {
type: String,
default: ""
default: "",
},
showButton: {
type: Boolean,
default: true
}
default: true,
},
},
methods: {
onProgress(event, file, fileList) {
......@@ -138,7 +160,7 @@ export default {
"jpg",
"gif",
"zip",
"rar"
"rar",
];
}
return this.formatList;
......@@ -156,7 +178,7 @@ export default {
window.open(this.fileUrlPath, "_blank");
}
}
}
},
},
mounted() {
this.formatL();
......@@ -165,15 +187,15 @@ export default {
nativeInputValue() {
return this.value === null || this.value === undefined ? "" : this.value;
},
view(){
return true
}
view() {
return true;
},
},
watch: {
value(v) {
this.name = v;
}
}
},
},
};
</script>
<style lang="less">
......
......@@ -1773,6 +1773,7 @@ export default {
miji:"密级",
status:'状态',
filePath:'上传文件',
img:'上传图片',
field:'字段',
dataType:'数据类型',
dataLength:'数据长度',
......
......@@ -144,6 +144,7 @@ export default {
if (this.eid > 0) {
this.load(this.eid);
}
this.parms.eid = this.$u.guid();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
......@@ -192,6 +193,13 @@ export default {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
if (this.$refs.refFile.nameList.length > 0) {
this.entity.productUrlList = this.parms.eid;
} else {
this.entity.productUrl = "";
this.entity.productUrlList = "";
}
Api.update(this.entity)
.then((r) => {
if (r.success) {
......
......@@ -437,7 +437,7 @@ export default {
.product-m {
.body-card {
border: 1px solid rgba(38, 128, 235, 1);
margin: 10px;
margin: 8px 0;
border-radius: 4px;
.title-i {
......
......@@ -13,7 +13,10 @@
</Col>-->
<Col :span="12">
<FormItem :label="l('type')" prop="type">
<Dictionary code="word_classification_type" v-model="entity.type"></Dictionary>
<Dictionary
code="word_classification_type"
v-model="entity.type"
></Dictionary>
<!-- <InputNumber v-model="entity.type"></InputNumber> -->
</FormItem>
</Col>
......@@ -29,12 +32,19 @@
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="word_classification_status" v-model="entity.status"></Dictionary>
<Dictionary
code="word_classification_status"
v-model="entity.status"
></Dictionary>
<!-- <InputNumber v-model="entity.status"></InputNumber> -->
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('inheritCategoryId')" prop="inheritCategoryId" v-if="row.id">
<FormItem
:label="l('inheritCategoryId')"
prop="inheritCategoryId"
v-if="row.id"
>
<!-- <Checkbox v-model="entity.inheritCategoryId"></Checkbox> -->
<RadioGroup v-model="inherit">
<Radio label="1"></Radio>
......@@ -59,34 +69,41 @@
<Input v-model="entity.templateId"></Input>
</FormItem>
</Col>-->
<Col :span="24">
<Col :span="24" v-if="inherit==0">
<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>
<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"
@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-if="row.dataType == 3"
v-model="row.note"
clearable
transfer
@on-change="setRow(row,index)"
@on-change="setRow(row, index)"
>
<Option
v-for="item in codeList"
:value="item.code"
:key="item.code"
>{{ item.name }}</Option
>
<Option v-for="item in codeList" :value="item.code" :key="item.code">{{ item.name }}</Option>
</Select>
<span v-else>{{row.note}}</span>
<span v-else>{{ row.note }}</span>
</template>
<template slot-scope="{ row, index }" slot="dataType">
<Dictionary
@on-change="setRow(row,index)"
@on-change="setRow(row, index)"
v-model="row.dataType"
code="materail.category.dataType"
type="select"
......@@ -96,8 +113,8 @@
</template>
<template slot-scope="{ row, index }" slot="unitName">
<Dictionary
v-if="row.dataType==1||row.dataType==2"
@on-change="setRow(row,index)"
v-if="row.dataType == 1 || row.dataType == 2"
@on-change="setRow(row, index)"
v-model="row.unitName"
code="material.main.unitName"
type="select"
......@@ -107,17 +124,30 @@
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="required">
<Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox>
<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>
<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>
<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>
<Button type="dashed" long @click="addNew" class="mt10"
>新增属性</Button
>
</Col>
<Col :span="24" class="tr mt10">
<FormItem>
......@@ -181,6 +211,19 @@ export default {
action: 1,
add: 0, //新增标识
},
{
field: "secret",
title: "密级",
note: "",
dataType: 3,
unitName: "",
required: true,
isunique: false,
fieldType: 1,
categoryId: 0,
action: 1,
add: 0, //新增标识
},
{
field: "name",
title: "标题",
......@@ -198,7 +241,7 @@ export default {
field: "description",
title: "文档详细说明",
note: "",
dataType: 0,
dataType: 8,
unitName: "",
required: true,
isunique: false,
......
......@@ -14,7 +14,10 @@
</Col>-->
<Col :span="12">
<FormItem :label="l('type')" prop="type">
<Dictionary code="word_classification_type" v-model="entity.type"></Dictionary>
<Dictionary
code="word_classification_type"
v-model="entity.type"
></Dictionary>
<!-- <InputNumber v-model="entity.type"></InputNumber> -->
</FormItem>
</Col>
......@@ -30,12 +33,19 @@
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="word_classification_status" v-model="entity.status"></Dictionary>
<Dictionary
code="word_classification_status"
v-model="entity.status"
></Dictionary>
<!-- <InputNumber v-model="entity.status"></InputNumber> -->
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('inheritCategoryId')" prop="inheritCategoryId" v-if='entity.upId!=0'>
<FormItem
:label="l('inheritCategoryId')"
prop="inheritCategoryId"
v-if="entity.upId != 0"
>
<!-- <Checkbox v-model="entity.inheritCategoryId"></Checkbox> -->
<RadioGroup v-model="inherit">
<Radio label="1"></Radio>
......@@ -60,34 +70,41 @@
<Input v-model="entity.templateId"></Input>
</FormItem>
</Col>-->
<Col :span="24">
<Col :span="24" v-if="inherit==0">
<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>
<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"
@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-if="row.dataType == 3"
v-model="row.note"
clearable
transfer
@on-change="setRow(row,index)"
@on-change="setRow(row, index)"
>
<Option
v-for="item in codeList"
:value="item.code"
:key="item.code"
>{{ item.name }}</Option
>
<Option v-for="item in codeList" :value="item.code" :key="item.code">{{ item.name }}</Option>
</Select>
<span v-else>{{row.note}}</span>
<span v-else>{{ row.note }}</span>
</template>
<template slot-scope="{ row, index }" slot="dataType">
<Dictionary
@on-change="setRow(row,index)"
@on-change="setRow(row, index)"
v-model="row.dataType"
code="materail.category.dataType"
type="select"
......@@ -97,8 +114,8 @@
</template>
<template slot-scope="{ row, index }" slot="unitName">
<Dictionary
v-if="row.dataType==1||row.dataType==2"
@on-change="setRow(row,index)"
v-if="row.dataType == 1 || row.dataType == 2"
@on-change="setRow(row, index)"
v-model="row.unitName"
code="material.main.unitName"
type="select"
......@@ -108,17 +125,30 @@
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="required">
<Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox>
<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>
<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>
<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>
<Button type="dashed" long @click="addNew" class="mt10"
>新增属性</Button
>
</Col>
<Col :span="24" class="tr mt10">
<FormItem>
......@@ -168,6 +198,19 @@ export default {
action: 1,
add: 0, //新增标识
},
{
field: "secret",
title: "密级",
note: "",
dataType: 3,
unitName: "",
required: true,
isunique: false,
fieldType: 1,
categoryId: 0,
action: 1,
add: 0, //新增标识
},
{
field: "name",
title: "标题",
......@@ -185,7 +228,7 @@ export default {
field: "description",
title: "文档详细说明",
note: "",
dataType: 0,
dataType: 8,
unitName: "",
required: true,
isunique: false,
......
<template>
<div>
<div class="mb10 pt5">
<Input v-model.trim="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>
......@@ -10,7 +15,13 @@
<TreeGrid :columns="columns" :items="treeData"></TreeGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" :row="row" />
<component
:is="detail"
:eid="curId"
@on-close="cancel"
@on-ok="ok"
:row="row"
/>
</Modal>
</div>
</template>
......@@ -53,34 +64,21 @@ export default {
easy: true,
high: true,
},
{
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: "totalDocument",
title: this.l("totalDocument"),
align: "center",
width: 160,
},
// {
// key: "level",
// title: this.l("level"),
// align: "center",
// high: true,
// hide: true,
// },
// {
// key: "totalDocument",
// title: this.l("totalDocument"),
// align: "center",
// width: 160,
// hide: true,
// },
// {
// key: "tenantId",
// title: this.l("tenantId"),
......@@ -101,6 +99,7 @@ export default {
align: "left",
easy: true,
high: true,
width: 300,
},
{
key: "englishName",
......@@ -116,21 +115,44 @@ export default {
high: true,
code: "word_classification_status",
},
// {
// key: "inheritCategoryId",
// title: this.l("inheritCategoryId"),
// align: "center",
// high: true,
// hide: true,
// render: (h, params) => {
// return h("div", [
// h("span", params.row.inheritCategoryId == 0 ? "否" : "是"),
// ]);
// },
// },
{
key: "inheritCategoryId",
title: this.l("inheritCategoryId"),
key: "description",
title: this.l("description"),
align: "left",
width: 200,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "center",
high: true,
render: (h, params) => {
return h("div", [
h("span", params.row.inheritCategoryId == 0 ? "否" : "是"),
]);
if (params.row.creatorUserId) {
return h("User", {
props: {
value: params.row.creatorUserId,
},
});
}
},
},
{
key: "description",
title: this.l("description"),
align: "left",
key: "creationTime",
title: this.l("creationTime"),
width: 200,
align: "center",
},
{
title: "操作",
......@@ -225,7 +247,7 @@ export default {
},
add() {
this.curId = 0;
this.row.id = '';
this.row.id = "";
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -12,7 +12,11 @@
@click="toggle"
title="展开/合并"
></Button>
<Button icon="md-refresh" title="刷新" @click="loadTree()"></Button>
<Button
icon="md-refresh"
title="刷新"
@click="loadTree()"
></Button>
<Button icon="md-rewind" title="收起" @click="hide"></Button>
</ButtonGroup>
</div>
......@@ -22,7 +26,12 @@
</div>
<div class="fg">
<div class="tree">
<Tree :data="data" ref="tree" @on-select-change="change" :render="renderContent"></Tree>
<Tree
:data="data"
ref="tree"
@on-select-change="change"
:render="renderContent"
></Tree>
</div>
</div>
</div>
......@@ -32,8 +41,8 @@
<Icon type="ios-arrow-forward" size="24" />
</a>
</div>
<Content :class="!showMenu?'con_bord':''">
<Word ref="dataTable" :treeId='treeId'/>
<Content :class="!showMenu ? 'con_bord' : ''">
<Word ref="dataTable" :treeId="treeId" :addShow="addShow" :ids="ids" />
</Content>
</Layout>
</div>
......@@ -58,7 +67,9 @@ export default {
model8: "",
keys: "",
expand: false,
treeId:0,
treeId: 0,
addShow: false,
ids: [],
};
},
mounted() {
......@@ -131,13 +142,28 @@ export default {
change(a, b) {
// console.log(a)
console.log(b);
if (b.children.length == 0) {
this.treeId = b.id;
this.$refs.dataTable.$refs.grid.reload(this.easySearch);
} else {
this.treeId = 0;
// if (b.children.length == 0) { //判断最底层才能添加文档
// this.addShow = true;
// this.$refs.dataTable.$refs.grid.reload(this.easySearch);
// } else {
// this.addShow = false;
// }
let ids = [];
ids.push(b.value);
if (b.children) {
addId(b.children);
function addId(data) {
data.map((u) => {
ids.push(u.value);
if (u.children) {
addId(u.children);
}
});
}
}
alert(this.treeId )
// console.log(ids)
this.ids = ids;
},
renderContent(h, { root, node, data }) {
return h(
......
<template>
<div class=".detail-document">
<div class="body-document">
<h4>详细信息</h4>
<Row>
<Col span="20">
<div class="new-detail detail-d">
<Row>
<Filed v-for="li in fileds" :key="li.field" :span="li.span" :name="li.title+':'">
<State v-if="li.dataType==3" :code="li.note" :value="entity[li.field]" />
<div v-else-if="li.dataType==8">{{entity[li.field]}}</div>
<div v-else-if="li.dataType==5" v-html="entity[li.field]"></div>
<DTSpan v-else-if="li.dataType==4" :value="entity[li.field]" />
<span v-else>{{entity[li.field]}}</span>
<State
v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
:code="li.note"
:value="entity[li.field]"
/>
</Filed>
</Row>
<Row class="filed-d">
<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('status')+':'">{{entity.status==0?'草稿':'送审'}}</Filed>
<Filed :span="24" :name="l('filePath')+':'">
<files ref="refFile" :parms="parms" :showList="false" />
</Filed>
</Row>
</div>
</Col>
<Col span="4" class="dcm-right">
<div class="img-touxiang">
<img :src="downUrl+avatorPath" v-if="avatorPath" />
<img src="@/assets/images/files_header.png" v-else width="100%" height="100%" />
</div>
</Col>
</Row>
</div>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
avatorPath: "",
downUrl: fileUrlDown,
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
},
fileds: [],
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
};
},
props: ["eid", "treeId"],
mounted() {
this.initFiled();
this.parms.eid = this.$u.guid();
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.parms.eid = r.result.filePath;
this.avatorPath = r.result.img;
this.$emit("on-load");
});
},
initFiled() {
Api.listbyid({
categoryId: this.treeId,
}).then((r) => {
if (r.result) {
let result = [];
result = r.result.definie.concat(r.result.inherit);
console.log(result);
this.fileds = result.filter(function (item) {
item.span = 6;
if (item.dataType > 4) {
item.span = 24;
}
delete item["id"];
// return item.fieldType != 1;
return item;
});
this.fileds.map((u) => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
this.entity[u.field] = "";
this.$set(this.entity, u.filed, v);
});
}
if (this.eid) {
this.load(this.eid);
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "document_property_definition" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script>
<style lang="less">
.top-title {
// margin: 10px;
background: #fff;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
position: relative;
border-radius: 5px;
}
.body-document {
margin-top: 10px;
background: #fff;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
border-radius: 8px;
h4 {
height: 50px;
line-height: 50px;
background: #515a6e;
padding: 0 10px;
color: #f5f6fa;
border-radius: 5px 5px 0 0;
}
.img-touxiang {
width: 230px;
height: 230px;
float: right;
margin-top: 10px;
margin-right: 10px;
img {
width: 100%;
height: 100%;
border-radius: 5px;
}
}
.detail-d {
padding-left: 20px;
.filed-d {
border-top: 1px solid #e0e0e0;
}
}
}
.detail-document {
background-color: #f5f7f9 !important;
}
</style>
\ No newline at end of file
This diff is collapsed.
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