Commit 5b3ab026 authored by 仇晓婷's avatar 仇晓婷

入库管理

parent 988b6e2c
......@@ -320,6 +320,7 @@ export default {
this.list = r.result.items;
}
this.search.total = r.result.totalCount || r.result.count;
});
}
},
......
......@@ -3,7 +3,7 @@
<Row>
<Col :span="12">
<FormItem :label="l('storeTitle')" prop="storeId">
<div style="color:#999">{{rootName}}</div>
<div style="color:#515a6e">{{rootName}}</div>
<!-- <StoreSelect v-model="entity.storeId" @on-change="storeChange"></StoreSelect> -->
</FormItem>
</Col>
......@@ -15,17 +15,17 @@
<Materiel v-model="entity.materialId" @on-change="change" :materialType="materialType"></Materiel>
</FormItem>
</Col>
<Col :span="12">
<!-- <Col :span="12">
<FormItem :label="l('certificateOfApproval')" prop="certificateOfApproval">
<Input v-model="entity.certificateOfApproval"></Input>
</FormItem>
</Col>
</Col>-->
<Col :span="12">
<FormItem :label="l('inputTotal')" prop="total">
<InputNumber v-model="entity.total" style="width:280px"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<!-- <Col :span="12">
<FormItem :label="l('unitPrice')" prop="unitPrice">
<InputNumber v-model="entity.unitPrice" style="width:280px"></InputNumber>
</FormItem>
......@@ -40,8 +40,7 @@
<FormItem :label="l('originalManufacturer')" prop="originalManufacturer">
<Input v-model="entity.originalManufacturer"></Input>
</FormItem>
</Col>
</Col>-->
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input>
......@@ -54,24 +53,24 @@
<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>
<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[li.field]"
v-model="entity.json[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>
<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[li.field]"
v-model="entity.json[li.field]"
type="date"
:placeholder="'选择'+li.title"
></DatePicker>
<InputFile v-if="li.dataType==6" v-model="entity[li.field]"></InputFile>
<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[li.field]"></InputFile>
<Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]"></Input>
<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"
......@@ -112,7 +111,9 @@ export default {
unitPrice: null,
originalManufacturer: "",
remark: "",
json: {},
},
materialId: null,
rules: {
materialId: [
......@@ -142,9 +143,7 @@ export default {
materialType: String,
},
mounted() {
// if (this.eid > 0) {
// this.load(this.eid);
// }
},
methods: {
handleSubmit() {
......@@ -174,12 +173,6 @@ 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.materialId = e.materialId;
......@@ -194,7 +187,8 @@ export default {
item.span = 24;
}
delete item["id"];
return item.fieldType != 1;
// return item.fieldType != 1;
return item.fieldType;
});
this.fileds.map((u) => {
let v = "";
......@@ -208,25 +202,12 @@ export default {
}
);
},
// storeChange(v, item) {
// console.log(item.id)
// 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>
......@@ -33,4 +33,8 @@ export default {
getmaterialdefinitionproperty(params){
return Api.get(`${material}/custompropertydefinition/getmaterialdefinitionproperty`,params);
},
list(params){
return Api.post(`${resourceUrl}/stockdetail/list`,params); //物料动态属性展示
},
}
......@@ -11,6 +11,27 @@
: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>
......@@ -20,57 +41,59 @@ export default {
head: {
title: "入库明细",
author: "henq",
description: "stock_item 7/13/2020 6:04:18 PM"
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 }
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
high: true,
},
{ key: "total", title: this.l("total"), align: "right", high: true },
{ key: "total", title: this.l("total"), high: true },
{
key: "nowTotal",
title: this.l("nowTotal"),
align: "right",
high: true
high: true,
},
{ key: "batch", title: this.l("batch"), align: "left", high: true },
{
key: "certificateOfApproval",
title: this.l("certificateOfApproval"),
align: "left",
high: true
high: true,
},
{
key: "unitPrice",
title: this.l("unitPrice"),
align: "right",
high: true
high: true,
},
{
key: "originalManufacturer",
title: this.l("originalManufacturer"),
align: "left",
high: true
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "center",
high: true
high: true,
},
{
key: "creator",
......@@ -83,17 +106,39 @@ export default {
title: this.l("remark"),
align: "left",
high: true,
tooltip: 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: ""
storeTitle: "",
newData: [],
};
},
props: {
eid: Number,
storeId: Number,
mcode: String
mcode: String,
},
created() {
this.treeHeight = window.innerHeight - 150;
......@@ -112,8 +157,45 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
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 => {
Api.get({ id: this.eid }).then((r) => {
this.materialName = r.result.name;
this.storeTitle = r.result.storeTitle;
});
......@@ -123,9 +205,6 @@ export default {
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
cancel() {
this.curId = 0;
this.modal = false;
......@@ -133,15 +212,9 @@ export default {
l(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">
......
......@@ -116,13 +116,12 @@ export default {
return h("div", {}, params.row.minNum ? params.row.minNum : "0");
},
},
{
key: "unitPrice",
title: this.l("unitPrice"),
easy: true,
high: true,
},
// {
// key: "unitPrice",
// title: this.l("unitPrice"),
// easy: true,
// high: true,
// },
{
key: "storeTitle",
title: this.l("storeTitle"),
......
......@@ -3,13 +3,13 @@
<Row>
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<div style="color:#999">{{entity.name}}</div>
<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">
<div style="color:#999">{{entity.storeTitle}}</div>
<div style="color:#515a6e">{{entity.storeTitle}}</div>
<!-- <Input v-model="entity.storeTitle" disabled></Input> -->
</FormItem>
</Col>
......
......@@ -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>
......@@ -189,7 +189,7 @@ export default {
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: "0"
fieldValue: "0",
},
{
conditionalType: "Equal",
......@@ -207,7 +207,8 @@ export default {
this.checkList = arr.filter(function (item) {
item.mid = item.id;
delete item["id"]; //删除属性id
return item.fieldType > 1;
// return item.fieldType > 1;
return true;
});
}
});
......
......@@ -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>
......
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