Commit a10adea4 authored by renjintao's avatar renjintao

new

parents 18015f14 e226e14c
This diff is collapsed.
......@@ -80,7 +80,7 @@
export default {
model: {
prop: "value",
event: "on-change"
event: "on-change",
},
data() {
return {
......@@ -89,7 +89,7 @@ export default {
departId: "",
group: [],
ids: [],
bId:this.bomId,
bId: this.bomId,
};
},
created() {
......@@ -102,48 +102,53 @@ export default {
value: [String, Number, Array],
placeholder: {
type: String,
default: "请选择物料"
default: "请选择物料",
},
multiple: {
type: Boolean,
default: false
default: false,
},
disabled: {
type: Boolean,
default: false
default: false,
},
theme: {
type: String,
default: "select"
default: "select",
},
type: {
type: Number,
default: 0
default: 0,
},
departmentId: {
type: Number,
default: 0
default: 0,
},
roleTitle: {
type: String,
default: ""
default: "",
},
datas: {
//自定义用户数据
type: Array,
default: null
default: null,
},
//物料bomid
bomId: {
type: Number,
default: null
}
default: null,
},
materialType: {
//物料类型
type: String,
default: "",
},
},
methods: {
change(val) {
console.log(val);
let entity = {};
this.data.forEach(e => {
this.data.forEach((e) => {
if (e.id == val) {
entity.name = e.name;
entity.mmcode = e.code;
......@@ -157,17 +162,25 @@ export default {
// 加载物料
materiallist() {
let url = `${material}/material/materiallist`;
let conditions = [];
if (this.materialType) {
conditions = [
{
conditionalType: "In",
fieldName: "categoryId",
fieldValue: this.materialType,
},
];
} else {
conditions = [];
}
this.$api
.post(url, {
// pageIndex: 1,
//departmentId: id,
type: this.type,
conditions: []
// roleTitle: this.roleTitle
// pageSize: 0
conditions: conditions,
})
.then(r => {
this.data = r.result.filter(u => u.status == 3);
.then((r) => {
this.data = r.result.filter((u) => u.status == 3);
if (this.theme == "list") {
this.departmentGroup();
}
......@@ -175,17 +188,16 @@ export default {
let url1 = `${technologyUrl}productinfo/getmaterialids`;
this.$api
.get(url1, {
Id: this.bId
Id: this.bId,
})
.then(res => {
.then((res) => {
if (res.success) {
this.ids = res.result;
let arr = [...this.data].filter(x =>
[...this.ids].some(y => y === x.id)
let arr = [...this.data].filter((x) =>
[...this.ids].some((y) => y === x.id)
);
this.data=arr
this.data = arr;
}
});
}
});
......@@ -194,11 +206,11 @@ export default {
var group = [];
var users = this.$u.clone(this.data);
if (this.name && this.name.length > 0) {
users.map(u => {
users.map((u) => {
u.checked = this.name.indexOf(u.id) > -1;
});
}
group = this.$u.group(users, u => {
group = this.$u.group(users, (u) => {
return u.departmentId;
});
var deps = [];
......@@ -208,7 +220,7 @@ export default {
departmentId: u[0].departmentId,
children: u,
opened: (i = 0),
checked: false
checked: false,
});
});
this.group = deps;
......@@ -226,7 +238,7 @@ export default {
removeItem(item) {
this.group.map((u, i) => {
if (u.departmentId == item.departmentId) {
u.children.map(p => {
u.children.map((p) => {
if (p.id == item.id) {
p.checked = false;
}
......@@ -239,13 +251,13 @@ export default {
//list 时,设置值。
listSetValue() {
var ids = [];
this.checkedItems.map(u => {
this.checkedItems.map((u) => {
ids.push(u.id);
});
this.$emit("on-change", ids);
},
checkAll(item, i) {
item.children.map(u => {
item.children.map((u) => {
u.checked = item.checked;
});
this.$set(this.group, i, this.group[i]);
......@@ -255,19 +267,19 @@ export default {
getSelectItems() {
var items = [];
if (this.theme == "list") {
this.checkedItems.map(u => {
this.checkedItems.map((u) => {
items.push(u);
});
} else {
if (!this.multiple) {
//单选时返回信息
if (this.datas && this.datas.length > 0) {
var item2 = this.datas.filter(u => u.value == this.value);
var item2 = this.datas.filter((u) => u.value == this.value);
if (item2 && item2[0]) {
items.push(item2[0]);
}
} else {
var item1 = this.dic.filter(u => u.value == this.value);
var item1 = this.dic.filter((u) => u.value == this.value);
if (item1 && item1[0]) {
items.push(item1[0]);
}
......@@ -275,15 +287,15 @@ export default {
} else {
//复选时返回
if (this.datas && this.datas.length > 0) {
this.value.forEach(v => {
var item3 = this.dic.filter(u => u.value == v);
this.value.forEach((v) => {
var item3 = this.dic.filter((u) => u.value == v);
if (item3 && item3[0]) {
items.push(item3[0]);
}
});
} else {
this.value.forEach(v => {
var item = this.dic.filter(u => u.value == v);
this.value.forEach((v) => {
var item = this.dic.filter((u) => u.value == v);
if (item && item[0]) {
items.push(item[0]);
}
......@@ -298,21 +310,21 @@ export default {
getSelectNames() {
var names = [];
if (this.theme == "list") {
this.checkedItems.map(u => {
this.checkedItems.map((u) => {
items.push(u.name);
});
} else {
this.getSelectItems().forEach(v => {
this.getSelectItems().forEach((v) => {
names.push(v.label);
});
}
return names;
}
},
},
computed: {
dic() {
let result = [];
this.data.forEach(u => {
this.data.forEach((u) => {
// result.push({
// value: u.id,
// label: u.userName
......@@ -324,43 +336,43 @@ export default {
},
checkedItems() {
var items = [];
this.group.map(u => {
u.children.map(l => {
this.group.map((u) => {
u.children.map((l) => {
if (l.checked) {
items.push(l);
}
});
});
return items;
}
},
},
filters: {
vvv: lis => {
vvv: (lis) => {
return 3;
// return lis.filter(u=>{
// return u.checked==true
// }).lenght;
}
},
},
watch: {
value: {
handler(v, o) {
this.name = v;
},
deep: true
deep: true,
},
departmentId: {
handler(v, o) {
this.getselectuser(v);
},
deep: true
deep: true,
},
datas(v) {
if (v) {
//alert(JSON.stringify(v))
}
}
}
},
},
};
</script>
<style lang="less">
......
......@@ -32,7 +32,7 @@ export default {
return {
keys: "",
expand: false,
list: []
list: [],
};
},
created() {
......@@ -45,19 +45,19 @@ export default {
{
fieldName: "title",
fieldValue: name,
conditionalType: "Like"
}
]
conditionalType: "Like",
},
],
};
this.$api
.post(`${resourceUrl}/storeroomlocation/paged`, params)
.then(r => {
.then((r) => {
let res = r.result.items;
var data = this.$u.toTree(
res,
0,
u => {
u.value=u.id
(u) => {
u.value = u.id;
u.expand = true;
u.selected = false;
u.checked = false;
......@@ -85,36 +85,39 @@ export default {
"span",
{
style: {
color: "#000"
}
color: "#000",
},
},
data.title
)
),
]);
},
change(v, b) {
// console.log(b);
let ids = [];
let productIds = [];
let rootName = [];
ids.push(b.id);
productIds.push(b.value);
if (b.children) {
addId(b.children);
function addId(data) {
data.map(u => {
data.map((u) => {
ids.push(u.id);
productIds.push(u.value);
if (u.children) {
addId(u.children);
}
});
}
}
this.$emit("on-select", b.bomId, b, productIds, ids);
var roots = this.$u.findRoots(this.list, b.id).reverse();
rootName = roots.map((u) => {
return u.title;
});
this.$emit("on-select", b, ids, rootName);
},
hide() {
this.$emit("on-hide");
}
},
},
computed: {
data() {
......@@ -123,7 +126,7 @@ export default {
let result = [];
search(this.keys, items);
function search(keys, data) {
data.map(u => {
data.map((u) => {
if (keys.length < 2) {
u.expand = expand;
result.push(u);
......@@ -138,8 +141,8 @@ export default {
});
}
return result;
}
}
},
},
};
</script>
......
......@@ -30,7 +30,7 @@
</div>
<div class="fg">
<dl>
<dd v-for="(li,i) in checkedItems">
<dd v-for="(li,i) in checkedItems" :key="i">
<div class="flex">
<span class="fg">{{li.userName}}</span>
<a @click="removeItem(li)">
......@@ -73,14 +73,14 @@
export default {
model: {
prop: "value",
event: "on-change"
event: "on-change",
},
data() {
return {
name: this.value,
data: [],
departId: "",
group: []
group: [],
};
},
created() {
......@@ -94,38 +94,43 @@ export default {
value: [String, Number, Array],
placeholder: {
type: String,
default: "请选择人员"
default: "请选择人员",
},
multiple: {
type: Boolean,
default: false
default: false,
},
theme: {
type: String,
default: "select"
default: "select",
},
type: {
type: Number,
default: 0
default: 0,
},
departmentId: {
type: Number,
default: 0
default: 0,
},
roleTitle: {
type: String,
default: ""
default: "",
},
datas: {
//自定义用户数据
type: Array,
default: null
}
default: null,
},
},
methods: {
change(event) {
// console.log(event)
this.$emit("on-change", event);
let name = "";
this.data.forEach((e) => {
if (e.id == event) {
name = e.label;
}
});
this.$emit("on-change", event, name);
},
// 加载人员
getselectuser(id) {
......@@ -135,10 +140,10 @@ export default {
// pageIndex: 1,
departmentId: id,
type: this.type,
roleTitle: this.roleTitle
roleTitle: this.roleTitle,
// pageSize: 0
})
.then(r => {
.then((r) => {
this.data = r.result;
if (this.theme == "list") {
this.departmentGroup();
......@@ -149,11 +154,11 @@ export default {
var group = [];
var users = this.$u.clone(this.data);
if (this.name && this.name.length > 0) {
users.map(u => {
users.map((u) => {
u.checked = this.name.indexOf(u.id) > -1;
});
}
group = this.$u.group(users, u => {
group = this.$u.group(users, (u) => {
return u.departmentId;
});
var deps = [];
......@@ -163,7 +168,7 @@ export default {
departmentId: u[0].departmentId,
children: u,
opened: (i = 0),
checked: false
checked: false,
});
});
this.group = deps;
......@@ -181,7 +186,7 @@ export default {
removeItem(item) {
this.group.map((u, i) => {
if (u.departmentId == item.departmentId) {
u.children.map(p => {
u.children.map((p) => {
if (p.id == item.id) {
p.checked = false;
}
......@@ -194,13 +199,13 @@ export default {
//list 时,设置值。
listSetValue() {
var ids = [];
this.checkedItems.map(u => {
this.checkedItems.map((u) => {
ids.push(u.id);
});
this.$emit("on-change", ids);
},
checkAll(item, i) {
item.children.map(u => {
item.children.map((u) => {
u.checked = item.checked;
});
this.$set(this.group, i, this.group[i]);
......@@ -210,19 +215,19 @@ export default {
getSelectItems() {
var items = [];
if (this.theme == "list") {
this.checkedItems.map(u => {
this.checkedItems.map((u) => {
items.push(u);
});
} else {
if (!this.multiple) {
//单选时返回信息
if (this.datas && this.datas.length > 0) {
var item2 = this.datas.filter(u => u.value == this.value);
var item2 = this.datas.filter((u) => u.value == this.value);
if (item2 && item2[0]) {
items.push(item2[0]);
}
} else {
var item1 = this.dic.filter(u => u.value == this.value);
var item1 = this.dic.filter((u) => u.value == this.value);
if (item1 && item1[0]) {
items.push(item1[0]);
}
......@@ -230,15 +235,15 @@ export default {
} else {
//复选时返回
if (this.datas && this.datas.length > 0) {
this.value.forEach(v => {
var item3 = this.dic.filter(u => u.value == v);
this.value.forEach((v) => {
var item3 = this.dic.filter((u) => u.value == v);
if (item3 && item3[0]) {
items.push(item3[0]);
}
});
} else {
this.value.forEach(v => {
var item = this.dic.filter(u => u.value == v);
this.value.forEach((v) => {
var item = this.dic.filter((u) => u.value == v);
if (item && item[0]) {
items.push(item[0]);
}
......@@ -253,21 +258,21 @@ export default {
getSelectNames() {
var names = [];
if (this.theme == "list") {
this.checkedItems.map(u => {
this.checkedItems.map((u) => {
items.push(u.userName);
});
} else {
this.getSelectItems().forEach(v => {
this.getSelectItems().forEach((v) => {
names.push(v.label);
});
}
return names;
}
},
},
computed: {
dic() {
let result = [];
this.data.forEach(u => {
this.data.forEach((u) => {
// result.push({
// value: u.id,
// label: u.userName
......@@ -279,43 +284,43 @@ export default {
},
checkedItems() {
var items = [];
this.group.map(u => {
u.children.map(l => {
this.group.map((u) => {
u.children.map((l) => {
if (l.checked) {
items.push(l);
}
});
});
return items;
}
},
},
filters: {
vvv: lis => {
vvv: (lis) => {
return 3;
// return lis.filter(u=>{
// return u.checked==true
// }).lenght;
}
},
},
watch: {
value: {
handler(v, o) {
this.name = v;
},
deep: true
deep: true,
},
departmentId: {
handler(v, o) {
this.getselectuser(v);
},
deep: true
deep: true,
},
datas(v) {
if (v) {
//alert(JSON.stringify(v))
}
}
}
},
},
};
</script>
<style lang="less">
......
......@@ -7,7 +7,7 @@
<Icon type="ios-keypad" />
<div class="top_menu_box">
<table class="t_table_box">
<tr>
<!-- <tr>
<td class="t_title" :class="{addclass:isStatic}">
<div class="title">
<Icon type="ios-home" />
......@@ -24,7 +24,7 @@
</li>
</ul>
</td>
</tr>
</tr>-->
<tr v-for="(item,i) in filterSider" :key="i">
<td class="t_title" :class="isClass == item.id ? 'addclass' : '' ">
<div class="title">
......@@ -469,7 +469,7 @@ export default {
}
}
.top_menu_box {
padding: 13px 15px 19px 0;
padding: 12px 15px 20px 0;
display: none;
border-radius: 5px;
position: absolute;
......@@ -500,12 +500,12 @@ export default {
}
tr {
td {
padding: 8px 10px 0px 10px;
padding: 10px 10px 0px 10px;
.table_row_ul {
list-style: none;
border-bottom: 1px solid #172c5d;
text-align: left;
padding-bottom: 3px;
li {
list-style: none;
display: inline-block;
......
......@@ -8,7 +8,7 @@
:high="false"
@on-drag-drop="onDragDrop"
:page="false"
@on-selection-change="onSelect"
@on-change="onSelect"
:batch="true"
:border="true"
:easy="true"
......
......@@ -350,7 +350,10 @@ export default {
background-color: none !important;
}
.home {
padding: 10px 0;
padding: 10px 5px;
width: 100%;
height: 100%;
overflow-x: hidden;
.card-user {
padding: 25px 0 0 15px;
height: 120px;
......
......@@ -5,7 +5,7 @@
</template>
<script>
import iview from "./crm/statistical/index.vue";
import iview from "./home/index.vue";
export default {
components: {
iview
......
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="100">
<Row>
<Col :span="12">
<FormItem :label="l('name')" prop="materialId">
<Materiel v-model="entity.materialId" @on-change="change"></Materiel>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('storeTitle')" prop="storeId">
<StoreSelect v-model="entity.storeId" @on-change="storeChange"></StoreSelect>
<FormItem :label="l('storeTitle')+':'">
<div style="color:#515a6e">{{rootName}}</div>
<!-- <StoreSelect v-model="entity.storeId" @on-change="storeChange"></StoreSelect> -->
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('inputTotal')" prop="total">
<InputNumber v-model="entity.total"></InputNumber>
</FormItem>
<FormItem :label="l('creator')+':'">{{entity.creator}}</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('unitPrice')" prop="unitPrice">
<InputNumber v-model="entity.unitPrice"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('batch')" prop="batch">
<Input v-model="entity.batch"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('certificateOfApproval')" prop="certificateOfApproval">
<Input v-model="entity.certificateOfApproval"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('originalManufacturer')" prop="originalManufacturer">
<Input v-model="entity.originalManufacturer"></Input>
<FormItem :label="l('name')" prop="materialId">
<Materiel v-model="entity.materialId" @on-change="change" :materialType="materialType"></Materiel>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creator')" prop="creator">
{{entity.creator}}
<FormItem :label="l('inputTotal')" prop="total">
<InputNumber v-model="entity.total" style="width:280px"></InputNumber>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<Divider orientation="left">物料属性</Divider>
<Col :span="12" v-if="entity.materialId">
<FormItem label="名称:">
<span>{{entity.name}}</span>
</FormItem>
</Col>
<Col :span="12" v-if="entity.materialId">
<FormItem label="编码:">
<span>{{entity.materialCode}}</span>
</FormItem>
</Col>
<Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title" :prop="li.name" v-if="li.field!='name'&&li.field!='code'">
<Input v-if="li.dataType==0" v-model="entity.json[li.field]"></Input>
<InputNumber
v-if="li.dataType==1||li.dataType==2"
v-model="entity.json[li.field]"
class="w100"
></InputNumber>
<Dictionary v-if="li.dataType==3" v-model="entity.json[li.field]" :code="li.note"></Dictionary>
<Input v-if="li.dataType==5" type="textarea" v-model="entity.json[li.filed]"></Input>
<DatePicker
v-if="li.dataType==4"
v-model="entity.json[li.field]"
type="date"
:placeholder="'选择'+li.title"
></DatePicker>
<InputFile v-if="li.dataType==6" v-model="entity.json[li.field]"></InputFile>
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<InputFile v-if="li.dataType==7" v-model="entity.json[li.field]"></InputFile>
<Input v-if="li.dataType==8" type="textarea" v-model="entity.json[li.field]"></Input>
<state
v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
:value="li.unitName"
code="material.main.unitName"
type="tag"
></state>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
......@@ -55,11 +78,13 @@
</template>
<script>
import Api from "./api";
export default {
name: "Add",
name: "add",
data() {
return {
disabled: false,
fileds: [], //扩展属性
entity: {
name: "",
materialId: "",
......@@ -75,7 +100,8 @@ export default {
creator: this.$store.state.userInfo.userName,
unitPrice: null,
originalManufacturer: "",
remark: ""
remark: "",
json: {},
},
rules: {
materialId: [
......@@ -83,44 +109,37 @@ export default {
required: true,
message: "请选择物料",
type: "string",
trigger: "change"
}
],
storeId: [
{
required: true,
message: "请选择库位",
type: "number",
trigger: "change"
}
trigger: "change",
},
],
total: [
total: [
{
required: true,
message: "请输入入库数量",
type: "number",
trigger: "change"
}
]
}
trigger: "change",
},
],
},
};
},
props: {
v: Object,
eid: Number
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
// v: Object,
eid: Number,
rootName: String,
storeTitle: String,
materialType: String,
},
mounted() {},
methods: {
handleSubmit() {
this.$refs.form.validate(v => {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
this.entity.storeId = this.eid;
this.entity.storeTitle = this.storeTitle;
Api.create(this.entity)
.then(r => {
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
......@@ -129,10 +148,10 @@ export default {
this.$Message.error("保存失败");
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
// console.warn(err);
});
}
});
......@@ -140,35 +159,42 @@ export default {
handleClose() {
this.$emit("on-close");
},
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
this.entity.id = 0;
});
},
change(e) {
this.entity.name = e.name;
this.entity.materialId = e.materialId;
this.entity.materialCode = e.mmcode;
this.entity.json.name = e.name;
this.entity.json.materialCode = e.mmcode;
Api.getmaterialdefinitionproperty({ materialId: e.materialId }).then(
(r) => {
if (r.result) {
this.fileds = r.result.filter(function (item) {
item.span = 12;
if (item.dataType > 4) {
item.span = 24;
}
delete item["id"];
// return item.fieldType != 1;
return item.fieldType;
});
this.fileds.map((u) => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
// this.$set(this.entity.customProperties,u.filed,v)
this.$set(this.entity, u.filed, v);
});
}
}
);
},
storeChange(v, item) {
this.entity.storeId = item.id;
this.entity.storeTitle = item.title;
},
l(key) {
key = "stock" + "." + key;
return this.$t(key);
}
},
watch: {
v() {
this.entity = this.$u.clone(this.v);
},
eid(v) {
if (v > 0) {
this.load(v);
}
}
}
},
watch: {},
};
</script>
......@@ -30,4 +30,11 @@ export default {
pagedStockitem(params) {
return Api.post(`${resourceUrl}/stockitem/paged`, params);
},
getmaterialdefinitionproperty(params){
return Api.get(`${material}/custompropertydefinition/getmaterialdefinitionproperty`,params);
},
list(params){
return Api.post(`${resourceUrl}/stockdetail/list`,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('name')">{{entity.name}}</Filed>
<Filed :span="12" :name="l('materialId')">{{entity.materialId}}</Filed>
<Filed :span="12" :name="l('materialType')">{{entity.materialType}}</Filed>
<Filed :span="12" :name="l('total')">{{entity.total}}</Filed>
<Filed :span="12" :name="l('storeId')">{{entity.storeId}}</Filed>
<Filed :span="12" :name="l('storeTitle')">{{entity.storeTitle}}</Filed>
<Filed :span="12" :name="l('minNum')">{{entity.minNum}}</Filed>
<Filed :span="12" :name="l('brand')">{{entity.brand}}</Filed>
<Filed :span="12" :name="l('specifications')">{{entity.specifications}}</Filed>
<Filed :span="12" :name="l('batch')">{{entity.batch}}</Filed>
<Filed :span="12" :name="l('certificateOfApproval')">{{entity.certificateOfApproval}}</Filed>
<Filed :span="12" :name="l('creator')">{{entity.creator}}</Filed>
<Filed :span="12" :name="l('unitPrice')">{{entity.unitPrice}}</Filed>
<Filed :span="12" :name="l('originalManufacturer')">{{entity.originalManufacturer}}</Filed>
<Filed :span="24" :name="l('remark')">{{entity.remark}}</Filed>
</Row>
<div>
<span class="mr20">物料名称:{{materialName}}</span>
<span class="mr20">物料编码:{{mcode}}</span>
<span>库位:{{storeTitle}}</span>
<DataGrid
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
:tool="false"
:height="treeHeight"
></DataGrid>
<Modal v-model="modal1" title="查看物料属性" @on-ok="ok" @on-cancel="cancel">
<Form ref="form" :label-width="100">
<Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title">
<span>{{li.value}}</span>
<div v-if="li.dataType==5" v-html="li.value"></div>
<InputFile v-if="li.dataType==6" v-model="li.value"></InputFile>
<InputFile v-if="li.dataType==7" v-model="li.value"></InputFile>
<state
v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
:value="li.unitName"
code="material.main.unitName"
type="tag"
></state>
<Dictionary v-if="li.dataType==3" v-model="li.value" :code="li.note"></Dictionary>
</FormItem>
</Col>
</Row>
</Form>
</Modal>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
name: "list",
head: {
title: "入库明细",
author: "henq",
description: "stock_item 7/13/2020 6:04:18 PM",
},
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }]
}
action: Api.indexStockitem,
easySearch: {
materialCode: { op: "Equal", value: this.mcode },
storeId: { op: "In", value: this.storeId },
},
data: [],
modal1: false,
treeHeight: 300,
curId: 0,
fileds: [],
columns: [
{
key: "code",
title: this.l("code"),
align: "left",
easy: true,
high: true,
},
{ key: "total", title: this.l("total"), high: true },
{
key: "nowTotal",
title: this.l("nowTotal"),
high: true,
},
{ key: "batch", title: this.l("batch"), align: "left", high: true },
{
key: "certificateOfApproval",
title: this.l("certificateOfApproval"),
align: "left",
high: true,
},
{
key: "unitPrice",
title: this.l("unitPrice"),
high: true,
},
{
key: "originalManufacturer",
title: this.l("originalManufacturer"),
align: "left",
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "center",
high: true,
},
{
key: "creator",
title: this.l("creatorUserId"),
align: "left",
high: true,
},
{
key: "remark",
title: this.l("remark"),
align: "left",
high: true,
tooltip: true,
},
{
title: "操作",
key: "action",
width: 150,
align: "left",
render: (h, params) => {
return h("div", [
h(
"op",
{
attrs: {
oprate: "detail",
},
on: { click: () => this.detail(params.row) },
},
"查看"
),
]);
},
},
],
cols: [], //
materialName: "",
storeTitle: "",
newData: [],
};
},
props: {
eid: Number
eid: Number,
storeId: Number,
mcode: String,
},
created() {
this.treeHeight = window.innerHeight - 150;
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
this.load();
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.treeHeight = window.screenHeight - 150;
})();
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
this.$emit("on-load");
detail(row) {
this.modal1 = true;
Api.getmaterialdefinitionproperty({ materialId: row.materialId }).then(
(r) => {
if (r.result) {
let fileds = r.result.map(function (item) {
item.span = 12;
item.value = null;
return item;
});
let conditions = [
{
conditionalType: "Equal",
fieldName: "code",
fieldValue: row.code,
},
];
Api.list({
conditions: conditions,
}).then((r) => {
if (r.result) {
let customProperties = r.result[0].customProperties;
for (var f in customProperties) {
fileds.forEach((u, i) => {
if (u.field == f) {
fileds[i].value = customProperties[f];
}
});
}
this.fileds = fileds;
}
});
// console.log(this.fileds);
}
}
);
},
load() {
Api.get({ id: this.eid }).then((r) => {
this.materialName = r.result.name;
this.storeTitle = r.result.storeTitle;
});
},
handleClose() {
this.$emit("on-close");
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
cancel() {
this.curId = 0;
this.modal = false;
},
l(key) {
key = "stock" + "." + key;
return this.$t(key);
}
let vkey = "stock_item" + "." + key;
return this.$t(vkey) || key;
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
}
}
watch: {},
};
</script>
<style lang="less">
</style>
\ No newline at end of file
......@@ -24,8 +24,18 @@
<Button type="primary" @click="add">入库</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide :fullscreen="fscreeen">
<component :is="detail" :eid="curId" :storeId="storeId" :mcode="mCode" @on-close="cancel" @on-ok="ok" />
<Modal v-model="modal" :title="title" width="800" footer-hide :fullscreen="fscreeen">
<component
:is="detail"
:eid="curId"
:rootName="rootName"
:storeTitle="storeTitle"
:materialType="materialType"
:storeId="storeId"
:mcode="mCode"
@on-close="cancel"
@on-ok="ok"
/>
</Modal>
</Content>
</Layout>
......@@ -36,26 +46,29 @@ import Search from "./search";
export default {
name: "list",
components: {
Search
Search,
},
head: {
title: "库存表",
author: "henq",
description: "stock 7/13/2020 11:48:09 AM"
description: "stock 7/13/2020 11:48:09 AM",
},
data() {
return {
action: Api.index,
showMenu: true,
easySearch: {
keys: { op: "name,storeTitle,materialCode", value: null }
keys: { op: "name,storeTitle,materialCode", value: null },
},
fscreeen: false,
modal: false,
title: "新增",
detail: null,
curId: 0,
storeId:null,
storeId: null,
rootName: "",
storeTitle: "",
materialType: "",
mCode: "",
columns: [
{
......@@ -63,19 +76,18 @@ export default {
title: this.l("name"),
align: "left",
easy: true,
high: true
high: true,
},
{
{
key: "materialCode",
title: this.l("materialCode"),
align: "left",
easy: true,
high: true
high: true,
},
{
key: "total",
title: this.l("total"),
align: "right",
high: true,
render: (h, params) => {
let minNum = 0;
......@@ -88,29 +100,34 @@ export default {
props: {
content: "库存不足,总数小于" + minNum,
placement: "top",
disabled: params.row.total > minNum ? true : false
disabled: params.row.total > minNum ? true : false,
},
class: params.row.total > minNum ? "" : "red"
class: params.row.total > minNum ? "" : "red",
},
params.row.total
);
}
},
},
{
key: "minNum",
title: this.l("minNum"),
align: "right",
high: true,
render: (h, params) => {
return h("div", {}, params.row.minNum ? params.row.minNum : "0");
}
},
},
// {
// key: "unitPrice",
// title: this.l("unitPrice"),
// easy: true,
// high: true,
// },
{
key: "storeTitle",
title: this.l("storeTitle"),
align: "left",
easy: true,
high: true
high: true,
},
{
title: "操作",
......@@ -125,18 +142,18 @@ export default {
attrs: {
oprate: "detail",
},
on: { click: () => this.setNum(params.row) }
on: { click: () => this.setNum(params.row) },
},
"设置最低库存"
"预警"
),
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row) }
on: { click: () => this.view(params.row) },
},
"查看"
)
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
// h(
// "op",
......@@ -155,14 +172,14 @@ export default {
// "删除"
// )
]);
}
}
},
},
],
treeData: [],
ocolumn: [],
treeHeight: "",
ids: [],
list: []
list: [],
};
},
created() {
......@@ -187,17 +204,20 @@ export default {
this.$refs.grid.load();
this.modal = false;
this.fscreeen = false;
this.curId = 0;
// this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.fscreeen = false;
this.modal = true;
if (this.curId) {
this.title = "新增";
this.detail = () => import("./add");
this.fscreeen = false;
this.modal = true;
} else {
this.$Message.error("请先选择库房库位");
}
},
copy(id) {
this.curId = id;
......@@ -207,27 +227,27 @@ export default {
},
view(row) {
this.curId = row.id;
this.storeId=row.storeId;
this.storeId = row.storeId;
this.mCode = row.materialCode;
this.title = "详情";
this.detail = () => import("./itemIndex");
this.detail = () => import("./detail");
this.fscreeen = true;
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("删除成功");
}
});
},
// 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;
......@@ -240,13 +260,18 @@ export default {
//this.$Message.info("展开左侧树")
this.showMenu = true;
},
productSearch(id, item, productIds, ids) {
productSearch(item, ids, rootName) {
console.log(item);
this.curId = item.id;
this.storeTitle = item.title;
this.rootName = rootName.join(" / ");
this.materialType = item.materialType;
let where = { storeId: { op: "In", value: ids } };
this.$refs.grid.reload(where);
},
setNum(row) {
this.curId = row.id;
this.title = "设置最低库存";
this.title = "预警";
this.detail = () => import("./setNum");
this.fscreeen = false;
this.modal = true;
......@@ -258,7 +283,7 @@ export default {
//new tree start
initTree() {
var sumData = [];
this.$http.order.getallselecttree().then(res => {
this.$http.order.getallselecttree().then((res) => {
//alert(JSON.stringify(res))
if (res.result) {
for (var i = 0; i < res.result.length; i++) {
......@@ -269,8 +294,8 @@ export default {
this.$Message.error("加载产品树失败!");
}
});
}
}
},
},
};
</script>
<style lang="less">
......
<template>
<div>
<span class="mr20">物料名称:{{materialName}}</span>
<span class="mr20">物料编码:{{mcode}}</span>
<span>库位:{{storeTitle}}</span>
<DataGrid
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
:tool="false"
:height="treeHeight"
></DataGrid>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "list",
head: {
title: "入库明细",
author: "henq",
description: "stock_item 7/13/2020 6:04:18 PM"
},
data() {
return {
action: Api.indexStockitem,
easySearch: {
materialCode: { op: "Equal", value: this.mcode },
storeId: { op: "In", value: this.storeId }
},
data: [],
treeHeight: 300,
curId: 0,
columns: [
{
key: "code",
title: this.l("code"),
align: "left",
easy: true,
high: true
},
{ key: "total", title: this.l("total"), align: "right", high: true },
{
key: "nowTotal",
title: this.l("nowTotal"),
align: "right",
high: true
},
{ key: "batch", title: this.l("batch"), align: "left", high: true },
{
key: "certificateOfApproval",
title: this.l("certificateOfApproval"),
align: "left",
high: true
},
{
key: "unitPrice",
title: this.l("unitPrice"),
align: "right",
high: true
},
{
key: "originalManufacturer",
title: this.l("originalManufacturer"),
align: "left",
high: true
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "center",
high: true
},
{
key: "creator",
title: this.l("creatorUserId"),
align: "left",
high: true,
},
{
key: "remark",
title: this.l("remark"),
align: "left",
high: true,
tooltip: true
}
],
materialName: "",
storeTitle: ""
};
},
props: {
eid: Number,
storeId: Number,
mcode: String
},
created() {
this.treeHeight = window.innerHeight - 150;
},
mounted() {
this.load();
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.treeHeight = window.screenHeight - 150;
})();
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
load() {
Api.get({ id: this.eid }).then(r => {
this.materialName = r.result.name;
this.storeTitle = r.result.storeTitle;
});
},
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
cancel() {
this.curId = 0;
this.modal = false;
},
l(key) {
let vkey = "stock_item" + "." + key;
return this.$t(vkey) || key;
}
},
watch: {
eid(v) {
if (v != 0) {
// this.load(v);
}
}
}
};
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<div>
<div>
<Divider orientation="left">物料属性</Divider>
</div>
<Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title" :prop="li.name">
<Input v-if="li.dataType==0" v-model="entity[li.field]"></Input>
<InputNumber
v-if="li.dataType==1||li.dataType==2"
v-model="entity[li.field]"
class="w100"
></InputNumber>
<Dictionary v-if="li.dataType==3" v-model="entity[li.field]" :code="li.note"></Dictionary>
<Input v-if="li.dataType==5" type="textarea" v-model="entity[li.filed]"></Input>
<DatePicker
v-if="li.dataType==4"
v-model="entity[li.field]"
type="date"
:placeholder="'选择'+li.title"
></DatePicker>
<InputFile v-if="li.dataType==6" v-model="entity[li.field]"></InputFile>
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<InputFile v-if="li.dataType==7" v-model="entity[li.field]"></InputFile>
<Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]"></Input>
<state
v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
:value="li.unitName"
code="material.main.unitName"
type="tag"
></state>
</FormItem>
</Col>
<!-- <Col :span="24">
<div v-html="entity"></div>
</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>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "",
data() {
return {
fileds: [], //扩展属性
};
},
props: {
materialId: Number,
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {},
methods: {
initFiled(v) {
Api.getmaterialdefinitionproperty({ materialId: v }).then((r) => {
if (r.result) {
this.fileds = r.result.filter(function (item) {
item.span = 12;
if (item.dataType > 4) {
item.span = 24;
}
delete item["id"];
return item.fieldType != 1;
});
this.fileds.map((u) => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
// this.$set(this.entity.customProperties,u.filed,v)
this.$set(this.entity, u.filed, v);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "stock" + "." + key;
return this.$t(key);
},
},
watch: {
materialId(v) {
if (v) {
this.initFiled(v);
}
},
},
};
</script>
......@@ -3,12 +3,14 @@
<Row>
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name" disabled></Input>
<div style="color:#515a6e">{{entity.name}}</div>
<!-- <Input v-model="entity.name" disabled></Input> -->
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('storeTitle')" prop="storeTitle">
<Input v-model="entity.storeTitle" disabled></Input>
<div style="color:#515a6e">{{entity.storeTitle}}</div>
<!-- <Input v-model="entity.storeTitle" disabled></Input> -->
</FormItem>
</Col>
<Col :span="12">
......@@ -37,14 +39,14 @@ export default {
materialCode: "",
storeId: null,
storeTitle: "",
minNum: null
minNum: null,
},
rules: {}
rules: {},
};
},
props: {
v: Object,
eid: Number
eid: Number,
},
mounted() {
if (this.eid > 0) {
......@@ -53,18 +55,17 @@ export default {
},
methods: {
handleSubmit() {
if(this.entity.minNum==0)
{
if (this.entity.minNum == 0) {
this.$Message.error("设置最低库存不能小于1");
return
return;
}
let params = {
id: this.entity.id,
minNum: this.entity.minNum
minNum: this.entity.minNum,
};
this.disabled = true;
Api.setminnum(params)
.then(r => {
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("设置成功");
......@@ -73,7 +74,7 @@ export default {
this.$Message.error("设置失败失败");
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
......@@ -83,7 +84,7 @@ export default {
this.$emit("on-close");
},
load(v) {
Api.get({ id: v }).then(r => {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
if (!r.result.minNum) {
this.entity.minNum = 0;
......@@ -93,7 +94,7 @@ export default {
l(key) {
key = "stock" + "." + key;
return this.$t(key);
}
},
},
watch: {
v() {
......@@ -103,7 +104,7 @@ export default {
if (v > 0) {
this.load(v);
}
}
}
},
},
};
</script>
......@@ -83,7 +83,7 @@
</template>
<template slot-scope="{ row, index }" slot="action">
<a @click="remove(index,row)" style="color:#FF7A8B">删除</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>
......@@ -109,7 +109,7 @@ export default {
upId: 0,
code: 0,
status: 0,
codeRuleId: this.nodeInfo.codeRuleId
codeRuleId: this.nodeInfo.codeRuleId,
},
disabled: false,
codeList: [],
......@@ -118,58 +118,58 @@ export default {
title: "序号",
type: "index",
width: 80,
align: "center"
align: "center",
},
{
title: "属性名称",
key: "title",
slot: "title"
slot: "title",
},
{
title: "属性类型",
key: "dataType",
align: "center",
slot: "dataType",
width: 200
width: 200,
},
{
title: "设置",
key: "note",
align: "center",
slot: "note"
slot: "note",
},
{
title: "单位",
key: "unitName",
align: "center",
slot: "unitName",
width: "150"
width: "150",
},
{
title: "必填",
key: "required",
align: "center",
slot: "required",
width: 80
width: 80,
},
{
title: "唯一",
key: "isUnique",
align: "center",
slot: "isUnique",
width: 80
width: 80,
},
{
width: 80,
title: "操作",
slot: "action",
align: "center"
}
align: "center",
},
],
checkList: [],
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
}
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
async fetch({ store, params }) {
......@@ -184,30 +184,35 @@ export default {
{
conditionalType: "In",
fieldName: "fieldType",
fieldValue: "1,2"
fieldValue: "1,2",
},
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: "0"
}
fieldValue: "0",
},
{
conditionalType: "Equal",
fieldName: "codeRuleId",
fieldValue: this.nodeInfo.codeRuleId,
},
];
Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false
}).then(r => {
isDesc: false,
}).then((r) => {
if (r.result) {
var arr = r.result;
this.checkList = arr.filter(function(item) {
this.checkList = arr.filter(function (item) {
item.mid = item.id;
delete item["id"]; //删除属性id
return item.fieldType > 1;
// return item.fieldType > 1;
return true;
});
}
});
Api.getChildren({ id: 582 }).then(r => {
Api.getChildren({ id: 582 }).then((r) => {
if (r.result) {
this.codeList = r.result;
}
......@@ -229,7 +234,7 @@ export default {
},
addNew() {
let maxId = 0;
this.checkList.map(u => {
this.checkList.map((u) => {
if (u.mid > maxId) {
maxId = u.mid;
}
......@@ -245,17 +250,17 @@ export default {
fieldType: 3,
categoryId: 0,
action: 1,
add: 0 //新增标识
add: 0, //新增标识
};
this.checkList.push(obj);
},
handleSubmit() {
this.$refs.form.validate(v => {
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 => {
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
......@@ -263,7 +268,7 @@ export default {
this.$Message.error(r.error.message);
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error(r.error.message);
});
......@@ -272,7 +277,7 @@ export default {
},
handleClose() {
this.$emit("on-close");
}
}
},
},
};
</script>
......@@ -47,7 +47,6 @@
v-model="row.note"
clearable
transfer
@on-change="setRow(row,index)"
>
<Option v-for="item in codeList" :value="item.code" :key="item.code">{{ item.name }}</Option>
......@@ -84,7 +83,7 @@
</template>
<template slot-scope="{ row, index }" slot="action">
<a @click="remove(index,row)" style="color:#FF7A8B">删除</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>
......@@ -108,7 +107,7 @@ export default {
entity: {
upId: 0,
code: 0,
codeRuleId: this.nodeInfo.codeRuleId
codeRuleId: this.nodeInfo.codeRuleId,
},
arr: [],
disabled: false,
......@@ -117,56 +116,56 @@ export default {
title: "序号",
type: "index",
width: 80,
align: "center"
align: "center",
},
{
title: "属性名称",
key: "title",
slot: "title"
slot: "title",
},
{
title: "属性类型",
key: "dataType",
align: "center",
slot: "dataType",
width: 150
width: 150,
},
{
title: "备注",
key: "note",
slot: "note"
slot: "note",
},
{
title: "单位",
key: "unitName",
align: "center",
slot: "unitName"
slot: "unitName",
},
{
title: "必填",
key: "required",
align: "center",
slot: "required",
width: 80
width: 80,
},
{
title: "唯一",
key: "isUnique",
align: "center",
slot: "isUnique",
width: 80
width: 80,
},
{
title: "操作",
slot: "action",
width: 80,
align: "center"
}
align: "center",
},
],
checkList: [],
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
}
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
......@@ -178,7 +177,7 @@ export default {
},
methods: {
get() {
Api.get({ id: this.nodeInfo.id }).then(r => {
Api.get({ id: this.nodeInfo.id }).then((r) => {
if (r.result) {
this.entity = r.result;
this.tableData();
......@@ -190,23 +189,28 @@ export default {
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: this.nodeInfo.id
}
fieldValue: this.nodeInfo.id,
},
{
conditionalType: "Equal",
fieldName: "codeRuleId",
fieldValue: this.nodeInfo.codeRuleId,
},
];
Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false
}).then(r => {
isDesc: false,
}).then((r) => {
if (r.result) {
console.log(r);
r.result.map(u => {
r.result.map((u) => {
u.mid = u.id;
});
this.checkList = r.result;
}
});
Api.getChildren({ id: 582 }).then(r => {
Api.getChildren({ id: 582 }).then((r) => {
if (r.result) {
this.codeList = r.result;
}
......@@ -227,7 +231,7 @@ export default {
},
addNew() {
let maxId = 0;
this.checkList.map(u => {
this.checkList.map((u) => {
if (u.mid > maxId) {
maxId = u.mid;
}
......@@ -243,17 +247,17 @@ export default {
fieldType: 3,
categoryId: 0,
action: 1,
add: 0 //新增标识
add: 0, //新增标识
};
this.checkList.push(obj);
},
handleSubmit() {
this.$refs.form.validate(v => {
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 => {
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
......@@ -261,7 +265,7 @@ export default {
this.$Message.error(r.error.message);
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error(r.error.message);
});
......@@ -270,7 +274,7 @@ export default {
},
handleClose() {
this.$emit("on-close");
}
}
},
},
};
</script>
<template>
<div class="addform">
<Form ref="form" :model="entity" :rules="rules" :label-width="100">
<Row class="rowTitle100">
<Col :span="12">
<FormItem :label="l('nameOfResource')" prop="nameOfResource">
<Input v-model="entity.nameOfResource"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('specifications')" >
<Input v-model="entity.specifications"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('totalNum')" prop="totalNum">
<InputNumber v-model="entity.totalNum" :min="1"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('measuringUnit')" >
<Input v-model="entity.measuringUnit"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('qualityCharacteristics')" >
<Input v-model="entity.qualityCharacteristics"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('batchNo')" >
<Input v-model="entity.batchNo"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('storeTitle')" prop="storeTitle">
<Input v-model="entity.storeTitle" readonly clearable @on-clear="clear" placeholder="请选择..." style="width:274px">
<Button slot="append" @click="selectStoreHouse">选择</Button>
<label slot="append" v-if="false">{{entity.storeId}}</label>
</Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('resourceType')" >
<Dictionary
code="mes_xingchi_resource.resource.resource_type"
v-model="entity.resourceType"
style="width:274px"
></Dictionary>
</FormItem>
</Col>
</Row>
<Row>
<Col span="18">&nbsp;</Col>
<Col span="6">
<Button @click="handleClose" class="ml20">取消</Button>
<Button type="primary" @click="handleSubmit">保存</Button>
</Col>
</Row>
</Form>
<StoreHouse
:show.sync="showStoreHouseTree"
:value.sync="entity.storeId"
:text.sync="entity.storeTitle"
:type='4'
/>
</div>
</template>
<script>
import Api from './api'
import StoreHouse from '@/components/modalTree/storeHouse.vue'
export default {
name: 'Add',
components: {
StoreHouse
},
data() {
return {
entity: {
totalNum:1,
},
rules: {
nameOfResource: [{ required: true, message: '必填', trigger: 'blur' }],
specifications: [{ required: true, message: '必填', trigger: 'blur' }],
totalNum: [{required: true, message: '必填', trigger: 'blur',type: "number" }],
measuringUnit: [{ required: true, message: '必填', trigger: 'blur' }],
qualityCharacteristics: [{ required: true, message: '必填', trigger: 'blur' }],
batchNo: [{ required: true, message: '必填', trigger: 'blur' }],
storeTitle: [{ required: true, message: '必填', trigger: 'blur'}],
resourceType: [{ required: true, message: '必填', trigger: 'blur' }],
},
showStoreHouseTree: false
}
},
props: {
v: Object
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.entity.state="1"
Api.create(this.entity).then((r) => {
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
}
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'resource' + '.' + key
return this.$t(key)
},
//清空库房库位控件信息
clear()
{
this.entity.storeId=null
this.entity.storeTitle=''
},
selectStoreHouse() {
this.showStoreHouseTree = true
}
},
watch: {
v() {
this.entity = this.$clone(this.v)
}
}
}
</script>
import Api from '@/plugins/request'
export default {
// index: `${resourceUrl}/resource/paged`,
index: `${resourceUrl}/resource/pagelist`,
paged(params) {
return Api.post(`${resourceUrl}/resource/paged`, params);
},
get(params) {
return Api.get(`${resourceUrl}/resource/get`, params);
},
create(params) {
return Api.post(`${resourceUrl}/resource/create`, params);
},
update(params) {
return Api.post(`${resourceUrl}/resource/update`, params);
},
//删除:
delete(params) {
return Api.delete(`${resourceUrl}/resource/delete`, {
params: params
});
},
getTree(params) {
let url = `${systemUrl}/storeroomlocation/getlocationfilterperson`;
return Api.get(url,params)
},
//借出
cartCreate(params) {
return Api.post(`${resourceUrl}/trolley/create`, params);
},
//归还列表
cartGetList(params) {
return Api.post(`${resourceUrl}/trolleyitem/paged`, params);
},
//归还
cartGiveBack(params) {
return Api.post(`${resourceUrl}/trolley/giveback`, params);
},
//历史操作
getHistory(params) {
return Api.get(`${resourceUrl}/resourcehistory/gethistory`, params);
},
}
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index:`${resourceUrl}/resource/paged`,
paged(params){
return Api.post(`${resourceUrl}/resource/paged`,params);
},
get(params){
return Api.get(`${resourceUrl}/resource/get`,params);
},
create(params){
return Api.post(`${resourceUrl}/resource/create`,params);
},
update(params){
return Api.post(`${resourceUrl}/resource/update`,params);
},
//删除:
delete(params) {
return Api.delete(`${resourceUrl}/resource/delete`,params);
},
}
\ No newline at end of file
<template>
<div>
<Table border :columns="columns" :data="cartList" class="tableCommon" height="300">
<template slot-scope="{ row, index }" slot="numberAvailable">
<InputNumber
:max="row.numberAvailable1"
:min="1"
v-model="row.numberAvailable"
@on-change="inputOrderCat(row,index)"
></InputNumber>
</template>
</Table>
<Form :model="resource" :label-width="110" class="mt20 mb20" :rules="rules" ref="form">
<Row>
<Col span="9">&nbsp;</Col>
<Col span="8">
<FormItem label="库管员">
<Input v-model="resource.libraryTube" disabled></Input>
</FormItem>
</Col>
<Col span="7">
<FormItem label="领料人" style="width:100%" prop="customerId">
<UserSelect ref="userSelected" v-model="resource.customerId" :type="0" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="20">&nbsp;</Col>
<Col span="4">
<Button @click="handleClose" class="ml20">取消</Button>
<Button type="primary" @click="handleSubmit">借出</Button>
</Col>
</Row>
</Form>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
let userInfo=this.$store.state.admin.user.info;
return {
columns: [
{
key: 'resourceId',
title: this.l('resourceId'),
width: 180
},
{
title: this.l('nameOfResource'),
key: 'nameOfResource'
},
{
title: this.l('specifications'),
key: 'specifications',
width: 100
},
{
title: this.l('measuringUnit'),
key: 'measuringUnit',
width: 100
},
{
title: this.l('qualityCharacteristics'),
key: 'qualityCharacteristics',
width: 100
},
{
title: this.l('batchNo'),
key: 'batchNo',
width: 100
},
{
title: this.l('storeTitle'),
key: 'storeTitle',
width: 100
},
{
title: this.l('numberAvailable'),
key: 'numberAvailable',
width: 120,
slot: 'numberAvailable'
},
{
title: this.l('action'),
key: 'action',
width: 100,
align: 'center',
render: (h, params) => {
return h('div', { class: 'action' }, [
h(
'a',
{
class: 'remove',
on: { click: () => this.remove(params.row.id) }
},
'删除'
)
])
}
}
],
resource: {
libraryTube: userInfo.userName, //库管员
libraryTubeId: userInfo.userId, //库管员ID
customer: '', //领料人
customerId: null, //领料人ID
category: 0, //类别
state: 2, //状态
item: []
},
rules: {
customerId: [
{ required: true, message: '请选择', trigger: 'blur', type: 'number' }
]
}
}
},
props: {
cartList: {
type: [Array],
default: ()=>{
return []
}
}
},
methods: {
handleSubmit() {
var items = []
let count = 0
this.cartList.forEach((data) => {
let objList = Object.assign({}, this.resource)
delete objList.item
objList.resourceId = data.id
objList.count = data.numberAvailable
items.push(objList)
count += 1
})
this.resource.item = items
if (this.resource.customerId == 0) {
}
this.$refs.form.validate((v) => {
if (v) {
Api.cartCreate(this.resource).then((r) => {
if (r.success) {
this.$Message.success('保存成功')
this.$emit('substr', count, -1)
this.$emit('on-ok')
}
})
}
})
},
handleClose() {
this.$emit('on-close')
},
remove(id) {
const index = this.cartList.findIndex(function(item) {
return item.id === id
})
this.cartList.splice(index, 1)
this.$emit('substr', 1, index)
},
l(key) {
let vkey = 'resource' + '.' + key
return this.$t(vkey) || key
},
changeCustom(val) {
this.resource.customerId = val + ''
//this.resource.customer = this.arry2Name(this.userList1, val)
},
arry2Name(arryList, values) {
//类别转换
var codes = arryList
var name = ''
for (let i in codes) {
if (values == codes[i].value) {
name = codes[i].name
}
}
return name
},
inputOrderCat(row, index) {
this.cartList[index].numberAvailable = row.numberAvailable
}
},
watch: {}
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="detail">
<Row>
<Filed :span="12" :name="l('resourceId')">{{entity.resourceId}}</Filed>
<Filed :span="12" :name="l('nameOfResource')">{{entity.nameOfResource}}</Filed>
<Filed :span="12" :name="l('specifications')">{{entity.specifications}}</Filed>
<Filed :span="12" :name="l('measuringUnit')">{{entity.measuringUnit}}</Filed>
<Filed :span="12" :name="l('qualityCharacteristics')">{{entity.qualityCharacteristics}}</Filed>
<Filed :span="12" :name="l('batchNo')">{{entity.batchNo}}</Filed>
<Filed :span="12" :name="l('storeTitle')">{{entity.storeTitle}}</Filed>
<Filed :span="12" :name="l('resourceType')">
<state
code="mes_xingchi_resource.resource.resource_type"
:value="entity.resourceType"
type="text"
></state>
</Filed>
</Row>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
entity: {
resourceType:''
}
}
},
props: {
eid: Number
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result
this.entity.resourceType = r.result.resourceType + ''
this.$emit('on-load')
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'resource' + '.' + key
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
This diff is collapsed.
<template>
<div>
<Table border :columns="columns" :data="data" class="tableCommon" height="300"></Table>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'log',
data() {
return {
data: [],
columns: [
{
title: this.l('action'),
key: 'action',
width: 120,
align:"center",
render: (h, params) => {
return h('state', {
props: {
code: 'mes_xingchi_resource.resource.life_state',
type: 'text',
value: params.row.action + ''
}
})
}
},
{
title: this.l('count'),
key: 'count',
width: 120,
align: 'right'
},
{
title: this.l('numberAvailable'),
key: 'numberAvailable',
width: 120,
align: 'right'
},
{
title: this.l('creationTime'),
key: 'creationTime',
width: 200,
align:"center"
},
{
title: this.l('libraryTube'),
key: 'libraryTube',
align:"center",
}
]
}
},
props: { eid: Number },
methods: {
//数据初始化
load(v) {
Api.getHistory({ id: v }).then((r) => {
if (r.success) {
this.data = r.result
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
let vkey = 'resource' + '.' + key
return this.$t(vkey) || key
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div>
<Input
search
enter-button
placeholder="请输入借出人/名称/编码"
@on-search="easySearch"
v-model="search.name"
style="width:240px"
/>&nbsp;
<Table
border
:columns="columns"
:data="dataList"
class="tableCommon"
@on-selection-change="selectInfo"
height="300"
>
<template slot-scope="{ row, index }" slot="count">
<InputNumber
:max="row.count1"
:min="1"
v-model="row.count"
@on-change="inputOrderCat(row,index)"
></InputNumber>
</template>
</Table>
<Form :label-width="110" class="mt20 mb20">
<Row>
<Col span="15">&nbsp;</Col>
<Col span="9">
<FormItem label="库管员">
<Input v-model="libraryTube" disabled></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col span="16">&nbsp;</Col>
<Col span="8">
<FormItem>
<Button @click="handleClose" class="ml20">取消</Button>
<Button type="primary" @click="handleSubmit">归还</Button>
</FormItem>
</Col>
</Row>
</Form>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
dataList: [],
columns: [
{
type: 'selection',
width: 70,
align: 'center'
},
{
key: 'resourceCode',
title: this.l('resourceCode'),
width: 180
},
{
title: this.l('nameOfResource'),
key: 'nameOfResource'
},
{
title: this.l('specifications'),
key: 'specifications',
width: 100
},
{
title: this.l('measuringUnit'),
key: 'measuringUnit',
width: 100
},
{
title: this.l('qualityCharacteristics'),
key: 'qualityCharacteristics',
width: 100
},
{
title: this.l('batchNo'),
key: 'batchNo',
width: 100
},
{
title: this.l('storeTitle'),
key: 'storeTitle',
width: 100
},
{
title: this.l('count'),
key: 'count',
width: 120,
slot: 'count'
}
],
search: {
name: '',
pageSize: 0,
pageIndex: 0
},
resource: [],
selectList: [],
libraryTube: this.$store.state.userInfo.userName //库管员
}
},
props: {},
methods: {
handleSubmit() {
if (JSON.stringify(this.selectList) != '[]') {
this.resource = this.selectList
Api.cartGiveBack(this.resource).then((r) => {
if (r.success) {
this.$Message.success('归还成功')
this.$emit('on-ok')
}
})
} else {
this.$Message.error('请选择归还的资源')
}
},
handleClose() {
this.$emit('on-close')
},
selectInfo(value) {
this.selectList = []
this.selectList = value
},
l(key) {
let vkey = 'resource' + '.' + key
return this.$t(vkey) || key
},
easySearch() {
this.dataList = []
Api.cartGetList(this.search).then((r) => {
if (r.success) {
let items = []
let dataList1 = []
dataList1 = r.result.items
dataList1.forEach((data) => {
let objList = data
objList.count1 = parseFloat(data.count)
objList.count = parseFloat(data.count)
objList.state = '3'
items.push(objList)
})
this.dataList = items
}
})
},
inputOrderCat(row, index) {
this.dataList[index].count = row.count
}
},
watch: {}
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div>
<Form ref="form" :model="condition" :label-width="100">
<Row class="rowTitle100">
<Col :span="12">
<FormItem :label="l('resourceId')" prop="resourceId">
<Input v-model="condition.resourceId.value"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('nameOfResource')" prop="nameOfResource">
<Input v-model="condition.nameOfResource.value"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('specifications')" prop="specifications">
<Input v-model="condition.specifications.value"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('measuringUnit')" prop="measuringUnit">
<Input v-model="condition.measuringUnit.value"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('qualityCharacteristics')" prop="qualityCharacteristics">
<Input v-model="condition.qualityCharacteristics.value"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('batchNo')" prop="batchNo">
<Input v-model="condition.batchNo.value"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('storeTitle')" prop="storeTitle">
<Input
v-model="condition.storeTitle.value"
readonly
placeholder="请选择..."
style="width:274px"
>
<Button slot="append" @click="selectStoreHouse">选择</Button>
<label slot="append" v-if="false">{{condition.storeId.value}}</label>
</Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('state')" prop="state">
<Dictionary
code="mes_xingchi_resource.resource.state"
v-model="condition.state.value"
style="width:274px"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('resourceType')" prop="resourceType">
<Dictionary
code="mes_xingchi_resource.resource.resource_type"
v-model="condition.resourceType.value"
:multiple="true"
style="width:274px"
></Dictionary>
</FormItem>
</Col>
<!-- <Col :span="12">
<FormItem :label="l('CreationTime')" prop="CreationTime">
<DatePicker
type="daterange"
v-model="condition.CreationTime.value"
placement="bottom-end"
></DatePicker>
</FormItem>
</Col> -->
</Row>
</Form>
<StoreHouse
:show.sync="showStoreHouseTree"
:value.sync="condition.storeId.value"
:text.sync="condition.storeTitle.value"
style="z-index:999999;position: absolute;"
/>
</div>
</template>
<script>
import Api from './api'
import StoreHouse from '@/components/modalTree/storeHouse.vue'
export default {
name: 'Search',
components: {
StoreHouse
},
data() {
return {
condition: {
resourceId: { op: 'Like', value: null },
nameOfResource: { op: 'Equal', value: null },
specifications: { op: 'Equal', value: null },
measuringUnit: { op: 'Equal', value: null },
qualityCharacteristics: { op: 'Equal', value: null },
batchNo: { op: 'Equal', value: null },
storeId: { op: 'Equal', value: null },
storeTitle: { op: 'Equal', value: null },
state: { op: 'Equal', value: null },
resourceType: { op: 'In', value: null },
CreationTime: { op: 'Range', value: null }
},
showStoreHouseTree: false
}
},
props: {
v: Object
},
methods: {
search() {
alert('未实现')
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'resource' + '.' + key
return this.$t(key)
},
selectStoreHouse() {
this.showStoreHouseTree = true
}
},
watch: {
v() {
this.condition = this.$clone(this.v)
}
}
}
</script>
This diff is collapsed.
import Api from '@/plugins/request'
export default {
// index: `${resourceUrl}/resource/paged`,
index: `${resourceUrl}/resource/pagelist`,
paged(params) {
return Api.post(`${resourceUrl}/resource/paged`, params);
},
index: `${resourceUrl}/resourcenew/paged`,
index1: `${resourceUrl}/trolley/paged`, //借出记录
paged(params) { //借出记录查询明细
return Api.post(`${resourceUrl}/trolleyitem/paged`, params);
},
get(params) {
return Api.get(`${resourceUrl}/resource/get`, params);
return Api.get(`${resourceUrl}/resourcenew/get`, params);
},
create(params) {
return Api.post(`${resourceUrl}/resource/create`, params);
},
update(params) {
return Api.post(`${resourceUrl}/resource/update`, params);
return Api.post(`${resourceUrl}/resourcenew/create`, params);
},
// update(params) {
// return Api.post(`${resourceUrl}/resourcenew/update`, params);
// },
//删除:
delete(params) {
return Api.delete(`${resourceUrl}/resource/delete`, {
return Api.delete(`${resourceUrl}/resourcenew/delete`, {
params: params
});
},
......@@ -40,5 +41,8 @@ export default {
getHistory(params) {
return Api.get(`${resourceUrl}/resourcehistory/gethistory`, params);
},
getmaterialdefinitionproperty(params){
return Api.get(`${material}/custompropertydefinition/getmaterialdefinitionproperty`,params);
},
}
\ No newline at end of file
<template>
<div>
<Table border :columns="columns" :data="cartList" class="tableCommon" height="300">
<template slot-scope="{ row, index }" slot="numberAvailable">
<template slot-scope="{ row, index }" slot="count">
<InputNumber
:max="row.numberAvailable1"
:max="row.numberAvailable"
:min="1"
v-model="row.numberAvailable"
v-model="row.count"
@on-change="inputOrderCat(row,index)"
></InputNumber>
</template>
......@@ -20,7 +20,12 @@
</Col>
<Col span="7">
<FormItem label="领料人" style="width:100%" prop="customerId">
<UserSelect ref="userSelected" v-model="resource.customerId" :type="0" />
<UserSelect
ref="userSelected"
v-model="resource.customerId"
:type="0"
@on-change="change"
/>
</FormItem>
</Col>
</Row>
......@@ -35,159 +40,215 @@
</div>
</template>
<script>
import Api from './api'
import Api from "./api";
export default {
name: 'Add',
name: "Add",
data() {
let userInfo=this.$store.state.admin.user.info;
let userInfo = this.$store.state.admin.user.info;
return {
columns: [
{
key: 'resourceId',
title: this.l('resourceId'),
width: 180
key: "resourceCode",
title: this.l("resourceId"),
align: "left",
easy: true,
render: (h, params) => {
return h(
"a",
{
props: {},
style: {},
on: { click: () => this.detail(params.row.id) },
},
params.row.resourceCode
);
},
},
{
title: this.l('nameOfResource'),
key: 'nameOfResource'
key: "nameOfResource",
title: this.l("nameOfResource"),
align: "left",
easy: true,
tooltip: true,
},
{
title: this.l('specifications'),
key: 'specifications',
width: 100
key: "code",
title: "编码",
align: "left",
width: 150,
},
// {
// key: "creatorUserId",
// title: this.l("creatorUserId"),
// hide: false,
// type: "user",
// align: "left",
// },
{
title: this.l('measuringUnit'),
key: 'measuringUnit',
width: 100
key: "totalNum",
title: this.l("totalNum"),
align: "left",
easy: true,
},
{
title: this.l('qualityCharacteristics'),
key: 'qualityCharacteristics',
width: 100
key: "numberAvailable",
title: this.l("numberAvailable"),
align: "left",
easy: true,
},
// {
// key: "storeId",
// title: this.l("storeId"),
// align: "left",
// high: true,
// hide: true,
// },
{
title: this.l('batchNo'),
key: 'batchNo',
width: 100
key: "storeTitle",
title: this.l("storeTitle"),
align: "left",
},
{
title: this.l('storeTitle'),
key: 'storeTitle',
width: 100
key: "state",
title: this.l("state"),
align: "left",
render: (h, params) => {
return h("state", {
props: {
code: "mes_xingchi_resource.resource.state",
type: "text",
value: params.row.state + "",
},
});
},
},
{
title: this.l('numberAvailable'),
key: 'numberAvailable',
width: 120,
slot: 'numberAvailable'
title: this.l("count"),
key: "count",
width: 100,
slot: "count",
},
{
title: this.l('action'),
key: 'action',
title: this.l("action"),
key: "action",
width: 100,
align: 'center',
align: "center",
render: (h, params) => {
return h('div', { class: 'action' }, [
return h("div", { class: "action" }, [
h(
'a',
"a",
{
class: 'remove',
on: { click: () => this.remove(params.row.id) }
class: "remove",
on: { click: () => this.remove(params.row.id) },
},
'删除'
)
])
}
}
"删除"
),
]);
},
},
],
resource: {
libraryTube: userInfo.userName, //库管员
libraryTubeId: userInfo.userId, //库管员ID
customer: '', //领料人
customer: "", //领料人
customerId: null, //领料人ID
category: 0, //类别
state: 2, //状态
item: []
item: [],
},
rules: {
customerId: [
{ required: true, message: '请选择', trigger: 'blur', type: 'number' }
]
}
}
{
required: true,
message: "请选择",
trigger: "blur",
type: "number",
},
],
},
};
},
props: {
cartList: {
type: [Array],
default: ()=>{
return []
}
}
default: () => {
return [];
},
},
},
methods: {
change(val, name) {
this.resource.customer = name;
},
handleSubmit() {
var items = []
let count = 0
this.cartList.forEach((data) => {
let objList = Object.assign({}, this.resource)
delete objList.item
objList.resourceId = data.id
objList.count = data.numberAvailable
items.push(objList)
count += 1
})
this.resource.item = items
if (this.resource.customerId == 0) {
}
this.$refs.form.validate((v) => {
if (v) {
Api.cartCreate(this.resource).then((r) => {
if (r.success) {
this.$Message.success('保存成功')
this.$emit('substr', count, -1)
this.$emit('on-ok')
}
})
if (this.cartList.length > 0) {
var items = [];
let count = 0;
this.cartList.forEach((data) => {
let objList = Object.assign({}, this.resource);
delete objList.item;
console.log(data);
objList.resourceId = data.resourceId;
objList.resourceCode = data.resourceCode;
objList.resourceMainId = data.id;
objList.count = data.count;
items.push(objList);
count += 1;
});
this.resource.item = items;
if (this.resource.customerId == 0) {
}
})
this.$refs.form.validate((v) => {
if (v) {
Api.cartCreate(this.resource).then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("substr", count, -1);
this.$emit("on-ok");
}
});
}
});
} else {
this.$Message.error("借出车不能为空");
}
},
handleClose() {
this.$emit('on-close')
this.$emit("on-close");
},
remove(id) {
const index = this.cartList.findIndex(function(item) {
return item.id === id
})
this.cartList.splice(index, 1)
this.$emit('substr', 1, index)
const index = this.cartList.findIndex(function (item) {
return item.id === id;
});
this.cartList.splice(index, 1);
this.$emit("substr", 1, index);
},
l(key) {
let vkey = 'resource' + '.' + key
return this.$t(vkey) || key
let vkey = "resource" + "." + key;
return this.$t(vkey) || key;
},
changeCustom(val) {
this.resource.customerId = val + ''
this.resource.customerId = val + "";
//this.resource.customer = this.arry2Name(this.userList1, val)
},
arry2Name(arryList, values) {
//类别转换
var codes = arryList
var name = ''
var codes = arryList;
var name = "";
for (let i in codes) {
if (values == codes[i].value) {
name = codes[i].name
name = codes[i].name;
}
}
return name
return name;
},
inputOrderCat(row, index) {
this.cartList[index].numberAvailable = row.numberAvailable
}
this.cartList[index].numberAvailable = row.numberAvailable;
this.cartList[index].count = row.count;
},
},
watch: {}
}
watch: {},
};
</script>
<style>
</style>
\ No newline at end of file
This diff is collapsed.
<template>
<div>
<Table border :columns="columns" :data="data" class="tableCommon" height="300"></Table>
<Table border :columns="columns" :data="data" class="tableCommon" height="300"></Table>
</div>
</template>
<script>
import Api from './api'
import Api from "./api";
export default {
name: 'log',
name: "log",
data() {
return {
data: [],
columns: [
{
title: this.l('action'),
key: 'action',
title: this.l("action"),
key: "action",
width: 120,
align:"center",
align: "center",
render: (h, params) => {
return h('state', {
return h("state", {
props: {
code: 'mes_xingchi_resource.resource.life_state',
type: 'text',
value: params.row.action + ''
}
})
}
code: "mes_xingchi_resource.resource.life_state",
type: "text",
value: params.row.action + "",
},
});
},
},
{
title: this.l('count'),
key: 'count',
width: 120,
align: 'right'
title: this.l("creatorUserId"),
key: "customer",
},
{
title: this.l('numberAvailable'),
key: 'numberAvailable',
width: 120,
align: 'right'
title: "编号",
key: "code",
},
{
title: this.l('creationTime'),
key: 'creationTime',
width: 200,
align:"center"
title: this.l("count"),
key: "count",
},
{
title: this.l('libraryTube'),
key: 'libraryTube',
align:"center",
}
]
}
title: this.l("numberAvailable"),
key: "numberAvailable",
},
{
title: this.l("creationTime"),
key: "creationTime",
align: "center",
},
{
title: this.l("libraryTube"),
key: "libraryTube",
align: "center",
},
],
};
},
props: { eid: Number },
methods: {
//数据初始化
load(v) {
Api.getHistory({ id: v }).then((r) => {
load() {
Api.getHistory({ id: this.eid }).then((r) => {
if (r.success) {
this.data = r.result
this.data = r.result;
}
})
});
},
handleClose() {
this.$emit('on-close')
this.$emit("on-close");
},
l(key) {
let vkey = 'resource' + '.' + key
return this.$t(vkey) || key
}
let vkey = "resource" + "." + key;
return this.$t(vkey) || key;
},
},
mounted() {
this.load();
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
};
</script>
<style>
</style>
\ No newline at end of file
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入领料人名称/记录编号" v-model="easySearch.keys.value" v-width="260" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</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>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
action: Api.index1,
easySearch: {
keys: { op: "serialNumber,customer", value: null },
},
detail: null,
dataList: [],
curId: 0,
modal: false,
title: "归还",
columns: [
{
type: "index",
width: 70,
align: "center",
},
{
title: "借出记录编号",
key: "serialNumber",
},
{
key: "creationTime",
title: "借出时间",
},
{
title: this.l("libraryTube"),
key: "libraryTube",
},
{
title: "领料人",
key: "customer",
},
{
title: "状态",
key: "status",
code: "resource.record.status",
},
{
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() {},
methods: {
details(id) {
this.curId = id;
this.detail = () => import("./return");
this.modal = true;
},
handleClose() {
this.$emit("on-close");
},
selectInfo(value) {
this.selectList = [];
this.selectList = value;
},
l(key) {
let vkey = "resource" + "." + key;
return this.$t(vkey) || key;
},
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: {},
};
</script>
<style>
</style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -25,5 +25,8 @@ export default {
},
deletes(params) {
return Api.post(`${resourceUrl}/storeroomlocation/batchdelete`, params);
}
},
list(params) {
return Api.post(`${material}/category/list`, params);//物料类型列表
},
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -203,6 +203,7 @@ export default {
},
proChange(id, data, listName, roots) {
console.log(listName)
this.entity.levelId = id;
this.entity.levelTitle = listName.join(" / ");
},
......
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