Commit bf6fb94e authored by renjintao's avatar renjintao

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

parents 2680e4ba 57fd5ebb
......@@ -1468,7 +1468,7 @@ export default {
creator:'创建人',
content:'内容',
filePath:'文件路径',
filePaths:'多个文件路径',
filePaths:'文件图片',
dispatchId:'工单id',
routingDetailId:'工序id',
routingHeaderId:'工艺规程id',
......
......@@ -184,7 +184,7 @@ export default {
if (r.result) {
var arr = r.result;
this.checkList = arr.filter(function(item) {
delete item["id"];
delete item["id"]; //删除属性id
return item;
});
}
......@@ -201,7 +201,7 @@ export default {
this.checkList.splice(index, 1);
}
},
setRow() {
setRow(row,index) {
this.$set(this.checkList, index, row);
},
addNew() {
......
......@@ -197,7 +197,7 @@ export default {
this.checkList.splice(index, 1);
}
},
setRow() {
setRow(row,index) {
this.$set(this.checkList, index, row);
},
addNew() {
......
......@@ -53,7 +53,7 @@
</a>
</div>
<Content :class="!showMenu?'con_bord':''">
<!-- <Product :parent="parent" /> -->
<MasterData ref="dataTable" @on-edit="editRow" />
</Content>
</Layout>
<Modal v-model="modal" :title="title" width="1000" footer-hide :mask-closable="false">
......@@ -69,11 +69,14 @@
</div>
</template>
<script>
// import spareParts from "./spareParts";
// import Product from "./product";
import MasterData from "./masterData.vue";
import Api from "./api";
export default {
name: "",
components: {
MasterData
},
name: "classification",
data() {
return {
keys: "",
......@@ -85,11 +88,7 @@ export default {
curId: 0,
detail: null,
showMenu: true,
parent: {
id: null,
parentName: "",
ids: ""
}
dataList: []
};
},
async fetch({ store, params }) {
......@@ -103,15 +102,19 @@ export default {
//this.$Message.info("展开左侧树")
this.showMenu = true;
},
ok() {
ok(row) {
this.loadTree();
this.modal = false;
this.curId = 0;
if (row) {
this.dataList.map((e, index) => {
if (e.id == row.id) {
this.$set(this.$refs.dataTable.dataColumns, index, row);
}
});
}
},
addNew() {
// this.nodeInfo.id = 0;
// let conditions = [];
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
......@@ -124,6 +127,10 @@ export default {
this.detail = () => import("./sonAdd");
this.modal = true;
},
editRow(row) {
this.nodeInfo = row;
this.edit();
},
edit() {
if (this.nodeInfo.upId == 0) {
this.detail = () => import("./edit");
......@@ -166,9 +173,9 @@ export default {
"span",
{
on: {
// click: () => {
// this.handleSelect(data); //手动选择树节点
// },
click: () => {
this.handleSelect(data); //手动选择树节点
},
//右键点击事件
contextmenu: e => {
e.preventDefault();
......@@ -182,9 +189,32 @@ export default {
data.title
);
},
// handleSelect(data) {
// this.$emit("clickItem", data);
// },
handleSelect(data) {
let tableData = [];
let obj = {};
let children = 0;
if (data.upId == 0 && data.children.length > 0) {
data.children.forEach(e => {
if (e.children.length > 0) {
children = 1;
} else {
children = 0;
}
obj = {
id: e.id,
name: e.name,
code: e.code,
status: e.status,
children: children,
upId: e.upId,
description: e.description
};
tableData.push(obj);
});
this.dataList = tableData;
this.$refs.dataTable.dataColumns = tableData;
}
},
loadTree() {
let conditions = [];
Api.list({ conditions: conditions }).then(r => {
......
<template>
<div class="master-data">
<Table border :columns="columns" :data="dataColumns" :height="tableHeight"></Table>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "masterData",
data() {
return {
tableHeight: "",
dataColumns: [],
columns: [
// {
// key: "index",
// title: "#",
// align: "left",
// width: 60
// },
{
key: "code",
title: "编码",
align: "left"
},
{
key: "name",
title: "名称",
align: "left"
},
{
key: "status",
title: "状态",
align: "left",
render: (h, params) => {
return h("state", {
props: {
code: "materail.category.status",
type: "text",
value: params.row.status + ""
}
});
}
},
{
key: "banben",
title: "版本",
align: "left"
},
{
key: "description",
title: "描述",
align: "left"
},
{
title: "操作",
key: "action",
width: 260,
align: "left",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row) }
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) }
},
params.row.children == 0 ? "删除" : ""
)
]);
}
}
]
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
this.tableHeight = window.innerHeight - 150;
},
mounted() {
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.tableHeight = window.innerHeight - 150;
})();
};
},
methods: {
edit(row) {
this.$emit("on-edit", row);
},
remove(id) {
this.$Modal.confirm({
title: "删除",
content: "<p>您确定要删除吗?</p>",
onOk: () => {
Api.delete(id).then(r => {
if (r.success) {
this.loadTree();
this.$Message.success("删除成功");
}
});
},
onCancel: () => {
this.$Message.success("取消删除");
}
});
}
}
};
</script>
<style lang="less" scoped>
.spare-parts {
width: 100%;
height: 100%;
}
</style>
\ No newline at end of file
<template>
<div>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem label="编码" prop="userUnit">
<Input v-model="entity.userUnit" placeholder="请输入"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="名称" prop="taskBased">
<Input v-model="entity.taskBased" placeholder="请输入"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="状态" prop="productName" placeholder="请选择">
<Select v-model="entity.productName" style="width:200px">
<Option value="0">New York</Option>
<Option value="1" disabled>London</Option>
<Option value="2">Sydney</Option>
</Select>
</FormItem>
</Col>
<Col :span="24">
<FormItem label="描述" prop="productName">
<Input v-model="entity.productName" type="textarea" placeholder="请输入..."></Input>
</FormItem>
</Col>
<Col :span="24">
<h4>属性配置</h4>
</Col>
<Col :span="24" style="padding:20px 0 0px 10px;margin-bottom:10px;" class="table-solt">
<Table border :columns="columns" :data="checkList" class="tableCommon">
<template slot-scope="{ row, index }" slot="name">
<Input v-model="row.name" placeholder="请输入" @on-blur="setRow(row,index)" />
</template>
<template slot-scope="{ row, index }" slot="require">
<Input v-model="row.require" placeholder="请输入" @on-blur="setRow(row,index)" />
</template>
<template slot-scope="{ row, index }" slot="result">
<Input v-model="row.result" placeholder="请输入" @on-blur="setRow(row,index)" />
</template>
<template slot-scope="{ row, index }" slot="pash">
<inputFile v-model="row.file" :files="true" :parms="getParams(row.fileId)" />
</template>
<template slot-scope="{ row, index }" slot="remark">
<Input v-model="row.remark" placeholder="请输入" @on-blur="setRow(row,index)" />
</template>
</Table>
</Col>
<Col :span="24" style="margin-bottom:20px;">
<Button type="primary" long @click="addNew" class="mt10">添加</Button>
</Col>
<Col :span="24" style="text-align: right;">
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Col>
</Row>
</Form>
</div>
</template>
<script>
export default {
data() {
return {
entity: {},
disabled: false,
columns: [
{
title: "序号",
type: "index",
width: 80,
align: "center"
},
{
title: "检验项目",
key: "name",
align: "center",
slot: "name"
},
{
title: "要求",
key: "require",
align: "center",
slot: "require"
},
{
title: "预测结果",
key: "result",
align: "center",
slot: "result"
}
],
checkList: [],
rules: {
businessName: [{ required: true, message: "必填", trigger: "blur" }],
businessCode: [{ required: true, message: "必填", trigger: "blur" }]
}
};
},
methods: {
setRow() {
this.checkList = r.result;
},
addNew() {},
handleSubmit() {
this.$refs.form.validate(v => {});
},
handleClose() {
this.$emit('on-close')
}
}
};
</script>
......@@ -81,7 +81,7 @@ export default {
.then(r => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
this.$emit("on-ok",this.entity);
} else {
this.$Message.error("保存失败");
}
......
<template>
<div>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem label="编码" prop="code">
<Input v-model="entity.code" placeholder="请输入" disabled></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="名称" prop="name">
<Input v-model="entity.name" placeholder="请输入"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="状态" prop="status" placeholder="请选择">
<Dictionary
code="materail.category.status"
v-model="entity.status"
type="select"
:value="entity.status"
:key="entity.status"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="版本" prop="banben">
<Input v-model="entity.banben" placeholder="请输入"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem label="描述" prop="description">
<Input v-model="entity.description" type="textarea" placeholder="请输入..."></Input>
</FormItem>
</Col>
<Col :span="24" style="text-align: right;">
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Col>
</Row>
</Form>
</div>
</template>
<script>
import Api from "./api";
export default {
data() {
return {
arr: [],
entity: {
upId: 0,
code: 0
},
disabled: false,
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
}
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
// this.tableData();
},
methods: {
tableData() {
let conditions = [
{
conditionalType: "In",
fieldName: "fieldType",
fieldValue: "1,2"
},
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: "0"
}
];
Api.listTable({ conditions: conditions }).then(r => {
if (r.result) {
var arr = r.result;
this.checkList = arr.filter(function(item) {
delete item["id"];
return item;
});
}
});
},
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);
}
},
setRow(row, index) {
this.$set(this.checkList, index, row);
},
handleSubmit() {
this.$refs.form.validate(v => {
if (v) {
// let categoryDto = this.entity;
// let pro = this.checkList.concat(this.arr);
// Api.create({ categoryDto: categoryDto, pro: pro })
// .then(r => {
// if (r.success) {
// this.$Message.success("保存成功");
// this.$emit("on-ok");
// } else {
// this.$Message.error("保存失败");
// }
// })
// .catch(err => {
// this.disabled = false;
// this.$Message.error("保存失败");
// });
}
});
},
handleClose() {
this.$emit("on-close");
}
}
};
</script>
import Api from '@/plugins/request'
export default {
listTable(params){
return Api.post(`${systemUrl}/custompropertydefinition/list`,params);
},
list(params){
return Api.post(`${systemUrl}/category/list`,params);
},
get(params){
return Api.get(`${systemUrl}/category/get`,params);
},
create(params){
return Api.post(`${systemUrl}/category/create`,params);
},
update(params){
return Api.post(`${systemUrl}/category/update`,params);
},
delete(id) {
return Api.delete(`${systemUrl}/category/delete`,{params:{id:id}});
},
}
\ No newline at end of file
<template>
<div>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<!-- <Col :span="12">
<FormItem label="编码" prop="code">
<Input v-model="entity.code" placeholder="请输入" disabled></Input>
</FormItem>
</Col>-->
<Col :span="12">
<FormItem label="名称" prop="name">
<Input v-model="entity.name" placeholder="请输入"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="状态" prop="status" placeholder="请选择">
<Dictionary
code="materail.category.status"
v-model="entity.status"
type="select"
:value="entity.status"
:key="entity.status"
></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem label="描述" prop="description">
<Input v-model="entity.description" type="textarea" placeholder="请输入..."></Input>
</FormItem>
</Col>
<Col :span="24">
<h4>属性配置</h4>
</Col>
<Col :span="24" style="padding:20px 0 0px 10px;margin-bottom:10px;" class="table-solt">
<!--fieldType 1.固有,2.默认,3自定义; -->
<Table border :columns="columns" :data="checkList" class="tableCommon" height="300">
<template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<Input v-else v-model="row.title" placeholder="请输入" @on-blur="setRow(row,index)" />
</template>
<template slot-scope="{ row, index }" slot="note">
<div v-if="row.fieldType==1">{{row.note}}</div>
<Input v-model="row.note" placeholder="请输入" @on-blur="setRow(row,index)" v-else />
</template>
<template slot-scope="{ row, index }" slot="dataType">
<state
v-if="row.fieldType==1"
code="materail.category.dataType"
:value="row.dataType"
type="text"
></state>
<Dictionary
v-else
code="materail.category.dataType"
type="select"
:value="row.dataType"
:key="row.dataType"
></Dictionary>
</template>
<!-- <template slot-scope="{ row, index }" slot="result">
<Input v-model="row.result" placeholder="请输入" @on-blur="setRow(row,index)" />
</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"
v-if="row.fieldType==2||row.fieldType==3"
>
<a @click="remove(index,row)" style="color:#FF7A8B">删除</a>
</template>
</Table>
</Col>
<Col :span="24" style="margin-bottom:20px;">
<Button type="primary" long @click="addNew" class="mt10">添加</Button>
</Col>
<Col :span="24" style="text-align: right;">
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Col>
</Row>
</Form>
</div>
</template>
<script>
import Api from "./api";
export default {
props: ["nodeInfo"],
data() {
return {
entity: {
upId: 0,
code: 0
},
arr: [],
disabled: false,
columns: [
{
title: "序号",
type: "index",
width: 80,
align: "center"
},
{
title: "属性名称",
key: "title",
align: "center",
slot: "title"
},
{
title: "备注",
key: "note",
align: "center",
slot: "note"
},
{
title: "属性类型",
key: "dataType",
align: "center",
slot: "dataType"
},
// {
// title: "是否显示",
// key: "result",
// align: "center",
// slot: "result"
// },
{
title: "是否必填",
key: "required",
align: "center",
slot: "required"
},
{
title: "是否唯一属性",
key: "isunique",
align: "center",
slot: "isunique"
},
{
title: "操作",
slot: "action",
width: 100,
align: "center"
}
],
checkList: [],
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
}
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
this.get();
},
methods: {
get() {
Api.get({ id: this.nodeInfo.id }).then(r => {
if (r.result) {
this.entity = r.result;
this.tableData();
}
});
},
tableData() {
let conditions = [
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: this.nodeInfo.id
}
];
Api.listTable({ conditions: conditions }).then(r => {
if (r.result) {
console.log(r);
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);
}
},
setRow(row,index) {
this.$set(this.checkList, index, row);
},
addNew() {
let arr = this.$u.clone(this.checkList);
let obj = {
title: "",
note: "",
dataType: "",
required: false,
isunique: false,
fieldType: 3,
categoryId: 0,
action: 1,
add: 0
};
arr.push(obj);
this.checkList = arr;
},
handleSubmit() {
this.$refs.form.validate(v => {
if (v) {
let categoryDto = this.entity;
let pro = this.checkList.concat(this.arr);
Api.update({ categoryDto: categoryDto, pro: pro })
.then(r => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch(err => {
this.disabled = false;
this.$Message.error("保存失败");
});
}
});
},
handleClose() {
this.$emit("on-close");
}
}
};
</script>
<template>
<div class="master-data">
<Button type="dashed" @click="datail">详情</Button>
<div class="classification">
<Layout>
<Sider width="300" v-if="showMenu">
<div class="p-list">
<h3>
零部件库
<div class="fr mr10 mt10">
<ButtonGroup class="fr" size="small">
<!-- <Button icon="md-add" title="新增顶级" @click="addNew"></Button> -->
<Button
:icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
@click="toggle"
title="展开/合并"
></Button>
<Button icon="md-refresh" title="刷新" @click="loadTree"></Button>
<Button icon="md-rewind" title="收起" @click="hide"></Button>
</ButtonGroup>
</div>
</h3>
<div class="search">
<Input search placeholder="关键字" v-model="keys" clearable />
</div>
<div class="fg">
<div class="tree">
<Tree :data="data" ref="tree" @on-select-change="change" :render="renderContent"></Tree>
</div>
</div>
</div>
</Sider>
<div v-if="!showMenu" class="show_menu">
<a class="menu_play fr" @click="showMenuFn" title="展开">
<Icon type="ios-arrow-forward" size="24" />
</a>
</div>
<Content :class="!showMenu?'con_bord':''">
<MasterData ref="dataTable" @on-edit="edit" />
</Content>
</Layout>
<!-- <Modal v-model="modal" :title="title" width="1000" footer-hide :mask-closable="false">
<component
:is="detail"
:eid="curId"
:nodeInfo="nodeInfo"
@on-close="cancel"
@on-ok="ok"
ref="chlidren"
/>
</Modal>-->
</div>
</template>
<script>
import MasterData from "./masterData.vue";
import Api from "./api";
export default {
components: {
MasterData
},
name: "masterData",
data() {
return {};
return {
keys: "",
expand: false,
list: [],
nodeInfo: {},
modal: false,
title: "新增",
curId: 0,
detail: null,
showMenu: true,
dataList: []
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
this.loadTree();
},
methods: {
datail() {
this.$router.push({
path: "/materiel/masterData/details"
showMenuFn() {
//this.$Message.info("展开左侧树")
this.showMenu = true;
},
ok(row) {
this.loadTree();
this.modal = false;
this.curId = 0;
if (row) {
this.dataList.map((e, index) => {
if (e.id == row.id) {
this.$set(this.$refs.dataTable.dataColumns, index, row);
}
});
}
},
cancel() {
this.curId = 0;
this.modal = false;
},
renderContent(h, { root, node, data }) {
return h(
"span",
{
on: {
click: () => {
this.handleSelect(data); //手动选择树节点
}
}
},
data.title
);
},
handleSelect(data) {},
loadTree() {
let conditions = [];
Api.list({ conditions: conditions }).then(r => {
var data = this.$u.toTree(
r.result,
0,
u => {
u.title = u.code + u.name;
u.value = u.id;
u.expand = true;
},
"upId"
);
this.list = this.$u.clone(data);
});
},
toggle() {
this.expand = !this.expand;
},
change(v, b) {
console.log(v);
console.log(b);
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);
}
});
}
}
// this.$emit("on-select", b.value, b, ids);
},
hide() {
this.showMenu = false;
}
},
computed: {
data() {
let items = this.$u.clone(this.list);
let expand = this.expand;
let result = [];
search(this.keys, items);
function search(keys, data) {
data.map(u => {
if (keys.length < u.title) {
u.expand = expand;
result.push(u);
} else {
u.expand = expand;
if (u.title.indexOf(keys) > -1) {
result.push(u);
} else if (u.children) {
search(keys, u.children);
}
}
});
}
return result;
}
}
};
</script>
<style lang="less" scoped>
.master-data {
width: 100%;
<style lang="less" >
.classification {
font-family: Microsoft YaHei;
.ivu-layout-sider {
background: rgba(255, 255, 255, 1);
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 87vh;
h4 {
height: 30px;
line-height: 30px;
background: #eee;
padding-left: 10px;
}
.p-list {
h3 {
height: 50px;
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: bold;
line-height: 50px;
color: rgba(81, 90, 110, 1);
background: rgba(245, 246, 250, 1);
opacity: 1;
padding-left: 10px;
}
.search {
height: 50px;
padding: 5px 10px;
}
.fg {
flex: none;
height: 100%;
overflow: auto;
padding-left: 10px;
}
.tree {
height: calc(100vh - 215px);
overflow: auto;
}
}
}
.show_menu {
width: 30px;
height: 30px;
position: fixed;
top: 100px;
left: 0;
z-index: 9;
.menu_play {
width: 30px;
height: 30px;
line-height: 34px;
font-size: 14px;
text-align: center;
color: #515a6e;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
background: #ffffff;
box-shadow: #ccc 2px 2px 4px 1px;
}
.menu_play:hover {
background-color: #2d8cf0;
color: white;
}
}
.ivu-layout-content {
// margin-left: 5px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto;
padding: 10px;
height: 87vh;
overflow-y: hidden;
}
}
</style>
\ No newline at end of file
......@@ -4,51 +4,92 @@
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入编码/名称" v-width="200" v-model="easySearch.keys.value" clearable />
<Input
placeholder="请输入工艺名称/工艺编号"
v-width="200"
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="1120" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
<Modal v-model="modal" :title="title" width="1000" footer-hide :mask-closable="false">
<component
:is="detail"
:eid="curId"
:nodeInfo="nodeInfo"
@on-close="cancel"
@on-ok="ok"
ref="chlidren"
/>
</Modal>
</div>
</template>
<script>
import Api from "./api";
// import Search from "./search";
export default {
name: "masterData",
components: {
// Search
},
data() {
return {
action: "",
detail: null,
modal: false,
title: "新增",
curId: 0,
detail: null,
easySearch: {
keys: { op: "name,code", value: null }
keys: { op: "unicode,name,code", value: null }
},
title: "",
columns: [
// {
// key: "index",
// title: "#",
// align: "left",
// width: 60
// },
{
key: "code",
title: "编码",
align: "left",
width: 200,
easy: true,
high: true
align: "left"
},
{
key: "name",
title: "名称",
align: "left"
},
{
key: "status",
title: "状态",
align: "left",
easy: true,
high: true,
tooltip: true
render: (h, params) => {
return h("state", {
props: {
code: "materail.category.status",
type: "text",
value: params.row.status + ""
}
});
}
},
{
key: "description",
title: "描述",
align: "left"
},
{
title: "操作",
key: "action",
......@@ -70,7 +111,7 @@ export default {
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) }
},
"删除"
params.row.children == 0 ? "删除" : ""
)
]);
}
......@@ -78,21 +119,43 @@ export default {
]
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
// this.dataColumns = this.dataTable;
// console.log(this.dataColumns)
},
methods: {
edit() {
this.modal = true;
this.detail = () => import("./add");
search() {
this.$refs.grid.reload(this.easySearch);
},
remove() {},
add() {
this.curId = 0;
this.title = "新增";
this.detail = () => import("./Add");
this.modal = true;
this.detail = () => import("./add");
},
search() {
this.$refs.grid.reload(this.easySearch);
remove(id) {
this.$Modal.confirm({
title: "删除",
content: "<p>您确定要删除吗?</p>",
onOk: () => {
Api.delete(id).then(r => {
if (r.success) {
this.loadTree();
this.$Message.success("删除成功");
}
});
},
onCancel: () => {
this.$Message.success("取消删除");
}
});
},
ok() {
// this.$refs.grid.load();
// this.loadTree();
this.modal = false;
this.curId = 0;
},
......
......@@ -8,7 +8,8 @@
</Col>
<Col :span="24">
<FormItem label>
<files ref="refFile" :parms="parms" files />
<!-- <files ref="refFile" :parms="parms" files /> -->
<files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" />
</FormItem>
<!-- <FormItem :label="l('filePath')" prop="filePath">
<InputFile v-model="entity.filePath"></InputFile>
......@@ -41,16 +42,19 @@ export default {
content: "",
filePath: "",
filePaths: "",
dispatchId: null,
routingDetailId: null,
routingHeaderId: null,
dispatchId: this.$route.query.id,
routingDetailId: this.$route.query.headid,
routingHeaderId: this.$route.query.routid,
type: 1
},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
title: [{ required: true, message: "请填写案例名称", trigger: "blur" }]
},
parms:{
app: 'technology', //服务
eid: this.$u.guid(), //记录id
name: '', //表名process_case
field: '' //字段名
},
};
},
......@@ -59,11 +63,12 @@ export default {
eid: Number
},
created(){
console.log(this.entity.creator)
// console.log(this.entity.creator)
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
this.$refs.refFile.intFiles()
}
},
methods: {
......@@ -71,6 +76,13 @@ export default {
this.$refs.form.validate(v => {
if (v) {
this.disabled = true;
if (this.$refs.refFile.nameList.length > 0) {
// this.entity.filePath = this.$refs.refFile.nameList[0].filePath
this.entity.filePaths = this.parms.eid;
} else {
this.entity.filePath = "";
this.entity.filePaths = "";
}
Api.create(this.entity)
.then(r => {
this.disabled = false;
......
<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('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('creator')">{{entity.creator}}</Filed>
<Filed :span="12" :name="l('filePath')">{{entity.filePath}}</Filed>
<Filed :span="12" :name="l('filePaths')">{{entity.filePaths}}</Filed>
<Filed :span="24" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="24" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="24" :name="l('creator')">{{entity.creator}}</Filed>
<Filed :span="12" :name="l('filePaths')">
<files
ref="refFile"
:parms="parms"
fileFormat
:Photos="true"
:showList="false"
@clickItem="clickData"
/></Filed>
<!-- <Filed :span="12" :name="l('filePaths')">{{entity.filePaths}}</Filed> -->
</Row>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
import Api from "./api";
export default {
name: "Add",
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
code: [{ required: true, message: '必填', trigger: 'blur' }]
}
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }]
},
parms: {
app: "technology",
eid: "",
name: "",
field: ""
}
};
},
props: {
eid: Number
......@@ -39,18 +45,24 @@
}
},
methods: {
clickData(data,liUrl) {
console.log(liUrl)
console.log(data)
window.open(data, "_blank");
},
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
this.$emit('on-load')
})
this.parms.eid = r.result.filePaths;
this.$emit("on-load");
});
},
handleClose() {
this.$emit('on-close')
this.$emit("on-close");
},
l(key) {
key = "process_case" + "." + key;
return this.$t(key)
return this.$t(key);
}
},
watch: {
......@@ -60,5 +72,5 @@
}
}
}
}
};
</script>
\ No newline at end of file
......@@ -46,7 +46,9 @@
<Row :gutter="16">
<Col span="6">
<div class="file">
<Icon type="ios-paper" v-if="row.id%2==0" />
<!-- <img :src="fileUrlDown +row.filePaths" /> -->
<!-- <Icon type="ios-paper" v-if="row.id%2==0" /> -->
<Icon type="ios-paper" v-if="row.filePaths" />
<Icon type="md-film" v-else />
</div>
</Col>
......@@ -76,7 +78,7 @@
</div> -->
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<Modal v-model="modal" :title="title" width="800" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel" :mask-closable="false">
......@@ -95,7 +97,7 @@ export default {
head: {
title: "工艺案例",
author: "henq",
description: "process_case 6/1/2020 5:06:34 PM"
// description: "process_case 6/1/2020 5:06:34 PM"
},
data() {
return {
......@@ -246,7 +248,7 @@ export default {
},
methods: {
laodparme() {
console.log(555);
// console.log(555);
this.$refs.grid.reload(condition);
},
changeCards(carData) {
......
......@@ -8,7 +8,8 @@
</Col>
<Col :span="24">
<FormItem label>
<files ref="refFile" :parms="parms" files />
<!-- <files ref="refFile" :parms="parms" files @clickItem="clickData"/> -->
<files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" />
</FormItem>
<!-- <FormItem :label="l('filePath')" prop="filePath">
<InputFile v-model="entity.filePath"></InputFile>
......@@ -29,28 +30,25 @@ export default {
return {
disabled: false,
entity: {
// creationTime: null,
creatorUserId: this.$store.state.userInfo.userId,
// lastModificationTime: null,
// lastModifierUserId: null,
// isDeleted: null,
// deletionTime: null,
// deleterUserId: null,
title: "",
creator: this.$store.state.userInfo.userName,
content: "",
filePath: "",
filePaths: "",
dispatchId: null,
routingDetailId: null,
routingHeaderId: null,
dispatchId: this.$route.query.id,
routingDetailId: this.$route.query.headid,
routingHeaderId: this.$route.query.routid,
type: 2
},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
title: [{ required: true, message: "请填写工艺名称", trigger: "blur" }]
},
parms:{
parms: {
app: 'technology', //服务
eid: this.$u.guid(), //记录id
name: '', //表名process_case
field: '' //字段名
},
};
},
......@@ -59,18 +57,29 @@ export default {
eid: Number
},
created(){
console.log(this.entity.creator)
// console.log(this.entity.creator)
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
this.$refs.refFile.intFiles()
}
},
methods: {
clickData(data, liUrl) {
this.entity.filePath = liUrl;
},
handleSubmit() {
this.$refs.form.validate(v => {
if (v) {
this.disabled = true;
if (this.$refs.refFile.nameList.length > 0) {
// this.entity.filePath = this.$refs.refFile.nameList[0].filePath
this.entity.filePaths = this.parms.eid;
} else {
this.entity.filePath = "";
this.entity.filePaths = "";
}
Api.create(this.entity)
.then(r => {
this.disabled = false;
......
<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('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('creator')">{{entity.creator}}</Filed>
<Filed :span="12" :name="l('content')">{{entity.content}}</Filed>
<Filed :span="12" :name="l('filePath')">{{entity.filePath}}</Filed>
<Filed :span="12" :name="l('filePaths')">{{entity.filePaths}}</Filed>
<Filed :span="12" :name="l('dispatchId')">{{entity.dispatchId}}</Filed>
<Filed :span="12" :name="l('routingDetailId')">{{entity.routingDetailId}}</Filed>
<Filed :span="12" :name="l('routingHeaderId')">{{entity.routingHeaderId}}</Filed>
<Filed :span="12" :name="l('type')">{{entity.type}}</Filed>
<Filed :span="24" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="24" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="24" :name="l('creator')">{{entity.creator}}</Filed>
<Filed :span="24" :name="l('filePaths')">
<files
ref="refFile"
:parms="parms"
fileFormat
:Photos="true"
:showList="false"
@clickItem="clickData"
/>
</Filed>
</Row>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
import Api from "./api";
export default {
name: "Add",
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
code: [{ required: true, message: '必填', trigger: 'blur' }]
}
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }]
},
parms: {
app: "technology",
eid: "",
name: "",
field: ""
}
};
},
props: {
eid: Number
......@@ -44,18 +45,24 @@
}
},
methods: {
clickData(data,liUrl) {
console.log(liUrl)
console.log(data)
window.open(data, "_blank");
},
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
this.$emit('on-load')
})
this.parms.eid = r.result.filePaths;
this.$emit("on-load");
});
},
handleClose() {
this.$emit('on-close')
this.$emit("on-close");
},
l(key) {
key = "process_case" + "." + key;
return this.$t(key)
return this.$t(key);
}
},
watch: {
......@@ -65,5 +72,5 @@
}
}
}
}
};
</script>
\ No newline at end of file
......@@ -43,7 +43,7 @@
<Row :gutter="16">
<Col span="6">
<div class="file">
<Icon type="ios-paper" v-if="row.id%2==0" />
<Icon type="ios-paper" v-if="row.filePaths" />
<Icon type="md-film" v-else />
</div>
</Col>
......@@ -73,7 +73,7 @@
</div> -->
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide :mask-closable="false">
<Modal v-model="modal" :title="title" width="800" footer-hide :mask-closable="false">
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel" :mask-closable="false">
......
......@@ -80,6 +80,7 @@ export default {
orderId: item.orderId,
executeId: item.executeId,
headid: item.routingHeaderId,
routid: item.routingDetailId,//工序ID
dispatchStatus: item.status
}
});
......
......@@ -330,7 +330,8 @@
height: 59px;
line-height: 60px;
text-align: center;
width: calc(50% - 2px);
width: calc(100% - 0px);
// width: calc(50% - 2px);
}
.gs_del{
background: #2680EB;
......
......@@ -21,7 +21,7 @@
</div>
</div>
<div class="gs_card_box">
<Card class="gs_card" v-for="i of 5" :key="i">
<Card class="gs_card" v-for="i of 1" :key="i">
<p slot="title" class="gs_title">
张三
<span class="fr">02816335{{i}}</span>
......@@ -32,9 +32,9 @@
<span class="b_size">100</span> 工时
</p>
<p class="gs_footer">
<a class="gs_edit" @click="editItem">
<!-- <a class="gs_edit" @click="editItem">
<Icon type="md-create" />
编辑</a>
编辑</a> -->
<a class="gs_del" @click="delItem">
<Icon type="ios-trash-outline" />
删除</a>
......
......@@ -27,7 +27,10 @@
<Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button>
</template>
<template slot="card" slot-scope="{row}">
<div class="body" @click="toExecute(row.id,row.orderId,row.executeId,row.routingHeaderId,row.status)">
<div
class="body"
@click="toExecute(row.id,row.orderId,row.executeId,row.routingHeaderId,row.routingDetailId,row.status)"
>
<Row class="title-i">
<Col :span="10" class="order-code">{{row.productName}}</Col>
<Col :span="10" class="order-code">{{row.mesCode}}</Col>
......@@ -182,6 +185,7 @@ export default {
params.row.orderId,
params.row.executeId,
params.row.routingHeaderId,
params.row.routingDetailId,
params.row.status
)
}
......@@ -212,11 +216,18 @@ export default {
search() {
this.$refs.grid.reload(this.easySearch);
},
toExecute(id, orderId, executeId,headid,status) {
toExecute(id, orderId, executeId, headid, routingDetailId, status) {
//跳转到对应操作页面 获取id:this.$route.query.id
this.$router.push({
path: "/produce/execute",
query: { id: id, orderId: orderId, executeId: executeId,headid:headid,dispatchStatus:status }
query: {
id: id, //工单ID
orderId: orderId, //订单id
executeId: executeId, //订单执行表id
headid: headid, //工艺规程id
routid: routingDetailId, //工序ID
dispatchStatus: status
}
});
},
tdStyle(val) {
......@@ -280,7 +291,7 @@ export default {
//返回img需要显示的src值
let tempUrl = "";
if (url && url.length > 0) {
tempUrl = this.downUrl +url;
tempUrl = this.downUrl + url;
} else {
tempUrl = iconImg + "noPic_product.png";
}
......
......@@ -134,6 +134,7 @@ export default {
},
methods: {
clickData(data, liUrl) {
debugger
this.img = liUrl;
this.entity.productUrl = liUrl;
},
......
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