Commit 4a4ee0ca authored by 仇晓婷's avatar 仇晓婷

站内邮件、bug;ok

parent 5c44c709
......@@ -5,14 +5,16 @@
<Filed :span="8" name="编码:">{{!entity.code?'未分配':entity.code}}</Filed>
<Filed :span="8" name="名称:">{{entity.name}}</Filed>
<Filed :span="8" name="状态:">
<State code="materail.main.status" :value="parseInt(entity.status)" />
<State code="material.main.status" :value="parseInt(entity.status)" />
</Filed>
<Filed :span="8" name="版本:">
<State code="material.main.version" :value="parseInt(entity.version)" />
</Filed>
<Filed :span="8" name="描述:">{{entity.description}}</Filed>
</Row>
<Divider orientation="center"><h3>扩展属性</h3></Divider>
<Divider orientation="center">
<h3>扩展属性</h3>
</Divider>
<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]" />
......@@ -37,8 +39,8 @@ export default {
props: {
idVal: {
type: String,
default: ""
}
default: "",
},
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
......@@ -46,16 +48,16 @@ export default {
data() {
return {
entity: {
state: ""
state: "",
},
fileds: []
fileds: [],
};
},
created() {
this.dataImmut = [];
this.dataMut = [];
Api.get({ Id: this.idVal }).then(r => {
Api.get({ Id: this.idVal }).then((r) => {
console.log(r);
if (r.success) {
let farmData = {};
......@@ -66,24 +68,24 @@ export default {
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: farmData.rootCategoryId
}
fieldValue: farmData.rootCategoryId,
},
];
Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false
}).then(r => {
isDesc: false,
}).then((r) => {
if (r.result) {
this.fileds = r.result.filter(function(item) {
this.fileds = r.result.filter(function (item) {
item.span = 8;
if (item.dataType == 8 || item.dataType == 5) {
item.span = 24;
}
return item.fieldType != 1;
});
this.fileds.map(u => {
this.fileds.map((u) => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
......@@ -98,8 +100,8 @@ export default {
});
},
methods: {
load(v) {}
load(v) {},
},
watch: {}
watch: {},
};
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index: `${systemUrl}/usermessage/paged`,
paged(params) {
return Api.get(`${systemUrl}/usermessage/paged`, params); //消息历史记录列表
},
get(params) {
return Api.get(`${systemUrl}/usermessage/get`, params);
},
getUserInfo(params) {
return Api.get(`${systemUrl}/user/getuserinfo`, params);
},
sendmessagetousers(params) { //给指定用户发送消息
return Api.post(`${systemUrl}/usermessage/sendmessagetousers`, params);
},
// 获取打你审批数据
getpaged(params) {
......@@ -22,5 +32,5 @@ export default {
list(params) {
return Api.post(`${systemUrl}/newmessage/list`, params); //获取列表信息
},
}
\ No newline at end of file
......@@ -4,40 +4,101 @@
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入消息标题" v-model="easySearch.keys.value" v-width="260" />
<Input placeholder="请输入消息标题" v-model="easySearch.keys.value" v-width="260" clearable />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</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"
:cartList="this.$u.clone(this.$store.state.cart)"
@on-close="cancel"
@on-ok="ok"
/>
<Modal v-model="modal" title="查看详情" width="1200" footer-hide>
<div class="detail">
<Row>
<Filed :span="12" name="标题">{{entity.title}}</Filed>
<Filed :span="12" name="接受时间">{{entity.creationTime}}</Filed>
<Filed :span="24" name="内容">{{entity.content}}</Filed>
<Filed :span="12" name="发送人">{{entity.senderId}}</Filed>
<Filed :span="12" name="接受人">{{entity.receiverId}}</Filed>
<Filed :span="24" name="状态" style="color:red">{{entity.messageType== 1 ? "已读" : ""}}</Filed>
</Row>
</div>
</Modal>
<Modal v-model="modal1" title="站内邮件" width="1000" :mask-closable="false" footer-hide>
<Form ref="form" :model="entity1" :rules="rules" :label-width="100">
<Row>
<Col span="12">
<FormItem label="收件人" prop="receiverIds">
<UserSelect ref="userSelected" v-model="entity1.receiverIds" :multiple="true" />
</FormItem>
</Col>
<Col :span="12">
<FormItem label="标题" prop="title">
<Input v-model="entity1.title"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem label="内容" prop="content">
<Input v-model="entity1.content" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem label="上传附件">
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</Modal>
</div>
</template>
<script>
// import Api from "./api";
import Api from "./api";
import userVue from "../../components/page/user.vue";
export default {
name: "Add",
data() {
return {
action: "", //Api.index1
action: Api.index,
easySearch: {
keys: { op: "serialNumber,customer", value: null },
keys: { op: "title", value: null },
},
detail: null,
dataList: [],
curId: 0,
disabled: false,
entity: {},
modal1: false,
modal: false,
title: "归还",
entity1: {
receiverIds: null,
},
parms: {
app: "UserMessage",
eid: null,
name: "",
field: "",
},
rules: {
title: [
{ required: true, message: "必填", trigger: "blur", type: "string" },
],
content: [
{ required: true, message: "必填", trigger: "blur", type: "string" },
],
receiverIds: [
{
required: true,
message: "请选择人员!",
trigger: "blur",
type: "array",
},
],
},
columns: [
{
type: "index",
......@@ -46,69 +107,129 @@ export default {
},
{
title: "标题",
key: "serialNumber",
key: "title",
width: 200,
},
{
title: "内容",
key: "content",
tooltip: true,
},
{
key: "creationTime",
title: "接受时间",
width: 200,
},
{
title: "接受人",
key: "libraryTube",
title: "发送人",
key: "receiverId",
width: 120,
type: "user",
},
{
title: "发送人",
key: "customer",
title: "接受人",
key: "senderId",
width: 120,
type: "user",
},
{
title: "状态",
key: "status",
code: "resource.record.status",
key: "messageType",
width: 120,
render: (h, params) => {
return h(
"div",
{
style: {
color: "red",
},
},
params.row.messageType == 1 ? "已读" : ""
);
},
},
{
title: this.l("action"),
key: "action",
width: 150,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"a",
{
class: "details",
on: { click: () => this.details(params.row.id) },
},
"查看"
),
]);
},
},
// {
// title: this.l("action"),
// key: "action",
// width: 150,
// align: "center",
// render: (h, params) => {
// return h("div", { class: "action" }, [
// h(
// "a",
// {
// class: "details",
// on: { click: () => this.details(params.row.id) },
// },
// params.row.status == 0 ? "归还" : ""
// ),
// ]);
// },
// },
],
name: "",
resource: [],
selectList: [],
libraryTube: this.$store.state.userInfo.userName, //库管员
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
props: {},
mounted() {},
mounted() {
this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
},
methods: {
details(id) {
this.curId = id;
// this.detail = () => import("./return");
this.modal = true;
Api.get({ id: id }).then((r) => {
this.entity = r.result;
});
},
handleClose() {
this.$emit("on-close");
add() {
this.entity1 = {};
this.modal1 = true;
this.disabled = false;
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
this.entity1.attachment = "";
if (this.$refs.refFile.nameList.length > 0) {
let nameList = this.$refs.refFile.nameList;
let names = [];
nameList.forEach((e) => {
names.push(e.fileName);
});
this.entity1.attachment = JSON.stringify(names)
.replace("[", "")
.replace("]", "")
.replace(/\"/g, ""); //附件本地库暂存文件名称
}
let ids = this.entity1.receiverIds;
this.entity1.receiverIds = ids.join(",");
this.entity1.senderId = this.$store.state.userInfo.userId;
Api.sendmessagetousers(this.entity1)
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.modal1 = false;
} else {
this.$Message.error("保存失败");
this.disabled = false;
}
this.$refs.refFile.intFiles();
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
});
}
});
},
selectInfo(value) {
this.selectList = [];
this.selectList = value;
handleClose() {
this.modal1 = false;
this.$refs.form.resetFields();
},
l(key) {
let vkey = "resource" + "." + key;
......@@ -117,15 +238,6 @@ export default {
search() {
this.$refs.grid.reload(this.easySearch);
},
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
cancel() {
this.curId = 0;
this.modal = false;
},
},
watch: {},
};
......
......@@ -21,23 +21,26 @@
<Dictionary code="material.code.status" v-model="entity.status"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<!-- :disabled="!(entity.isEdit)" -->
<FormItem :label="l('levelNum')" prop="levelNum">
<InputNumber v-model="entity.levelNum" :disabled="!(entity.isEdit)" :max="10" :min="1"></InputNumber>
<InputNumber v-model="entity.levelNum" :max="10" :min="1"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<!-- :disabled="!(entity.isEdit)" -->
<FormItem :label="l('codeLength')" prop="codeLength">
<InputNumber v-model="entity.codeLength" :disabled="!(entity.isEdit)" :max="5" :min="1"></InputNumber>
<InputNumber v-model="entity.codeLength" :max="5" :min="1"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<Col :span="12">
<!-- :disabled="!(entity.isEdit)" -->
<FormItem :label="l('materialCodeLength')" prop="materialCodeLength">
<InputNumber v-model="entity.materialCodeLength" :disabled="!(entity.isEdit)" :max="10" :min="1"></InputNumber>
<InputNumber v-model="entity.materialCodeLength" :max="10" :min="1"></InputNumber>
</FormItem>
</Col>
<Col :span="24">
<Col :span="24">
<FormItem :label="l('description')" prop="description">
<Input v-model="entity.description" type="textarea" :rows="2"></Input>
</FormItem>
......@@ -63,12 +66,12 @@ export default {
status: [{ required: true, message: "必填" }],
levelNum: [{ required: true, message: "必填" }],
codeLength: [{ required: true, message: "必填" }],
materialCodeLength: [{ required: true, message: "必填" }]
}
materialCodeLength: [{ required: true, message: "必填" }],
},
};
},
props: {
eid: Number
eid: Number,
},
mounted() {
if (this.eid > 0) {
......@@ -77,16 +80,16 @@ export default {
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
});
},
handleSubmit() {
this.$refs.form.validate(v => {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.update(this.entity)
.then(r => {
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
......@@ -95,7 +98,7 @@ export default {
this.$Message.error("保存失败");
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
......@@ -109,14 +112,14 @@ export default {
l(key) {
key = "coderule" + "." + key;
return this.$t(key);
}
},
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
}
}
},
},
};
</script>
\ No newline at end of file
......@@ -31,13 +31,17 @@
</FormItem>
</Col>
</Row>
<Row :gutter="16">
<Col span="11">
<FormItem label="所属部门" prop="shop_name">
<FormItem label="所属部门" prop="shop_id">
<departmentSelect v-model="formItem.shop_id" @on-change="departChange"></departmentSelect>
</FormItem>
<!-- <FormItem label="所属部门" prop="shop_name">
<Input v-model="formItem.shop_name" readonly placeholder="请选择..." style="width:327px">
<Button slot="append" @click="selectDepart">选择</Button>
</Input>
</FormItem>
</FormItem>-->
</Col>
<Col span="11" offset="1">
<FormItem label="设备IP" prop="equip_ip">
......@@ -52,7 +56,8 @@
<span>上传图片</span>
<Icon type="ios-cloud-upload" size="30" style="color: #3399ff"></Icon>
</Upload>-->
<inputFile ref="refqcFile" v-model="imgName" :parms="qcfileparms" files />
<files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" />
<!-- <inputFile ref="refqcFile" v-model="imgName" :parms="qcfileparms" files /> -->
</FormItem>
</Col>
<Col :span="12">
......@@ -89,12 +94,18 @@ import Department from "@/components/modalTree/department.vue";
import service from "@/plugins/request";
export default {
components: {
Department
Department,
},
name: "",
data() {
return {
qcfileparms: "app=newEquipment&eid=23&name=newEquipment",
// qcfileparms: "app=newEquipment&eid=23&name=newEquipment",
parms: {
app: "newEquipment", //服务
eid: this.$u.guid(), //记录id
name: "", //表名process_case
field: "", //字段名
},
modalShow: false,
showDeptTree: false,
saveId: "",
......@@ -113,7 +124,7 @@ export default {
shop_id: "",
shop_name: "",
// isimportant: 2,
location: ""
location: "",
// capability_value: 1
},
property: true,
......@@ -123,17 +134,17 @@ export default {
{
required: true,
message: "设备编号不能为空!",
trigger: "blur"
}
trigger: "blur",
},
],
shop_name: [
shop_id: [
{
required: true,
message: "所属部门不能为空!",
trigger: "blur"
}
]
}
trigger: "blur",
},
],
},
};
},
created() {
......@@ -145,7 +156,7 @@ export default {
const imgPathsArr = JSON.parse(newName);
this.formItem.equip_pic = imgPathsArr[0].filePath;
}
}
},
},
methods: {
selectDepart() {
......@@ -154,14 +165,14 @@ export default {
laodaction() {
let url = `${systemUrl}/equiptype/getpaged`,
that = this;
service.get(`${url}`).then(res => {
service.get(`${url}`).then((res) => {
let selectdata = res.result.items;
// console.log(selectdata)
selectdata.forEach(item => {
selectdata.forEach((item) => {
that.cityList.push({
value: item.equip_type_name,
label: item.equip_type_name,
id: item.id
id: item.id,
});
// console.log(that.cityList)
});
......@@ -193,7 +204,7 @@ export default {
let arr = this.formItem.equip_type;
let str = arr.join(",");
let url = `${systemUrl}/equipinfo/createorupdate`;
var ar1 = this.data1.find(val => {
var ar1 = this.data1.find((val) => {
if (val.id != saveId) return val.equip_id == this.formItem.equip_id;
});
if (ar1) {
......@@ -218,10 +229,10 @@ export default {
location: this.formItem.location,
// capability_value: this.formItem.capability_value,
property: this.property,
shop_name: this.formItem.shop_name
shop_name: this.formItem.shop_name,
};
// console.log(paramsdata);
service.post(`${url}`, { equipInfo: paramsdata }).then(res => {
service.post(`${url}`, { equipInfo: paramsdata }).then((res) => {
if (res.success) {
this.$emit("getMessage");
this.modalShow = false;
......@@ -235,7 +246,7 @@ export default {
let str = arr.join(",");
//console.log(str);
let url = `${systemUrl}/equipinfo/createorupdate`;
var ar = this.data1.find(val => {
var ar = this.data1.find((val) => {
return val.equip_id == this.formItem.equip_id;
});
if (ar) {
......@@ -248,6 +259,14 @@ export default {
} else {
this.property = "";
}
if (this.$refs.refFile.nameList.length > 0) {
// this.entity.filePath = this.$refs.refFile.nameList[0].filePath
this.formItem.filePaths = this.parms.eid;
this.formItem.equip_pic = this.parms.eid;
} else {
this.formItem.filePath = "";
this.formItem.filePaths = "";
}
let paramsdata = {
id: this.saveId,
equip_id: this.formItem.equip_id,
......@@ -261,10 +280,10 @@ export default {
location: this.formItem.location,
// capability_value: this.formItem.capability_value,
property: this.property,
shop_name: this.formItem.shop_name
shop_name: this.formItem.shop_name,
};
//console.log(this.formItem.equip_type);
service.post(`${url}`, { equipInfo: paramsdata }).then(res => {
service.post(`${url}`, { equipInfo: paramsdata }).then((res) => {
if (res.success) {
this.$emit("getMessage");
this.modalShow = false;
......@@ -272,8 +291,14 @@ export default {
}
});
}
}
}
},
departChange(v, items) {
this.formItem.shop_name = items.name;
},
clickData(data, liUrl) {
this.formItem.filePath = liUrl;
},
},
};
</script>
......
......@@ -21,20 +21,18 @@ export default {
key: "routingDetailNo",
title: this.l("routingDetailNo"),
align: "left",
width: 100,
},
{
key: "routingDetailName",
title: this.l("routingDetailName"),
align: "left",
},
{
key: "materialType",
title: this.l("materialType"),
align: "center",
code: "mes_xingchi_resource.material.materialReType",
width: 100,
},
// {
// key: "materialType",
// title: this.l("materialType"),
// align: "center",
// code: "mes_xingchi_resource.material.materialReType",
// },
{
key: "materialNumber",
title: this.l("materialNumber"),
......@@ -48,42 +46,40 @@ export default {
{
key: "totalCount",
title: this.l("quantity"),
align: "right",
width: 80,
},
{
key: "brand",
title: this.l("brand"),
align: "left",
},
{
key: "specifications",
title: this.l("specifications"),
align: "left",
},
{
key: "xhgg",
title: this.l("xhgg"),
align: "left",
easy: true,
high: true,
hide: true,
},
{
key: "texture",
title: this.l("texture"),
align: "left",
},
{
key: "procurementStandards",
title: this.l("procurementStandards"),
align: "left",
},
{
key: "qualityGrade",
title: this.l("qualityGrade"),
align: "left",
},
// {
// key: "brand",
// title: this.l("brand"),
// align: "left",
// },
// {
// key: "specifications",
// title: this.l("specifications"),
// align: "left",
// },
// {
// key: "xhgg",
// title: this.l("xhgg"),
// align: "left",
// easy: true,
// high: true,
// hide: true,
// },
// {
// key: "texture",
// title: this.l("texture"),
// align: "left",
// },
// {
// key: "procurementStandards",
// title: this.l("procurementStandards"),
// align: "left",
// },
// {
// key: "qualityGrade",
// title: this.l("qualityGrade"),
// align: "left",
// },
{
key: "drawNum",
title: this.l("drawNum"),
......
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