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

入库管理

parent 988b6e2c
...@@ -320,6 +320,7 @@ export default { ...@@ -320,6 +320,7 @@ export default {
this.list = r.result.items; this.list = r.result.items;
} }
this.search.total = r.result.totalCount || r.result.count; this.search.total = r.result.totalCount || r.result.count;
}); });
} }
}, },
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<Row> <Row>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('storeTitle')" prop="storeId"> <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> --> <!-- <StoreSelect v-model="entity.storeId" @on-change="storeChange"></StoreSelect> -->
</FormItem> </FormItem>
</Col> </Col>
...@@ -15,17 +15,17 @@ ...@@ -15,17 +15,17 @@
<Materiel v-model="entity.materialId" @on-change="change" :materialType="materialType"></Materiel> <Materiel v-model="entity.materialId" @on-change="change" :materialType="materialType"></Materiel>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <!-- <Col :span="12">
<FormItem :label="l('certificateOfApproval')" prop="certificateOfApproval"> <FormItem :label="l('certificateOfApproval')" prop="certificateOfApproval">
<Input v-model="entity.certificateOfApproval"></Input> <Input v-model="entity.certificateOfApproval"></Input>
</FormItem> </FormItem>
</Col> </Col>-->
<Col :span="12"> <Col :span="12">
<FormItem :label="l('inputTotal')" prop="total"> <FormItem :label="l('inputTotal')" prop="total">
<InputNumber v-model="entity.total" style="width:280px"></InputNumber> <InputNumber v-model="entity.total" style="width:280px"></InputNumber>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <!-- <Col :span="12">
<FormItem :label="l('unitPrice')" prop="unitPrice"> <FormItem :label="l('unitPrice')" prop="unitPrice">
<InputNumber v-model="entity.unitPrice" style="width:280px"></InputNumber> <InputNumber v-model="entity.unitPrice" style="width:280px"></InputNumber>
</FormItem> </FormItem>
...@@ -40,8 +40,7 @@ ...@@ -40,8 +40,7 @@
<FormItem :label="l('originalManufacturer')" prop="originalManufacturer"> <FormItem :label="l('originalManufacturer')" prop="originalManufacturer">
<Input v-model="entity.originalManufacturer"></Input> <Input v-model="entity.originalManufacturer"></Input>
</FormItem> </FormItem>
</Col> </Col>-->
<Col :span="24"> <Col :span="24">
<FormItem :label="l('remark')" prop="remark"> <FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input> <Input v-model="entity.remark" type="textarea" :rows="5"></Input>
...@@ -54,24 +53,24 @@ ...@@ -54,24 +53,24 @@
<Row> <Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span"> <Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title" :prop="li.name"> <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 <InputNumber
v-if="li.dataType==1||li.dataType==2" v-if="li.dataType==1||li.dataType==2"
v-model="entity[li.field]" v-model="entity.json[li.field]"
class="w100" class="w100"
></InputNumber> ></InputNumber>
<Dictionary v-if="li.dataType==3" v-model="entity[li.field]" :code="li.note"></Dictionary> <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[li.filed]"></Input> <Input v-if="li.dataType==5" type="textarea" v-model="entity.json[li.filed]"></Input>
<DatePicker <DatePicker
v-if="li.dataType==4" v-if="li.dataType==4"
v-model="entity[li.field]" v-model="entity.json[li.field]"
type="date" type="date"
:placeholder="'选择'+li.title" :placeholder="'选择'+li.title"
></DatePicker> ></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" /> --> <!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<InputFile v-if="li.dataType==7" v-model="entity[li.field]"></InputFile> <InputFile v-if="li.dataType==7" v-model="entity.json[li.field]"></InputFile>
<Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]"></Input> <Input v-if="li.dataType==8" type="textarea" v-model="entity.json[li.field]"></Input>
<state <state
v-if="li.unitName&&(li.dataType==1||li.dataType==2)" v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
:value="li.unitName" :value="li.unitName"
...@@ -112,7 +111,9 @@ export default { ...@@ -112,7 +111,9 @@ export default {
unitPrice: null, unitPrice: null,
originalManufacturer: "", originalManufacturer: "",
remark: "", remark: "",
json: {},
}, },
materialId: null, materialId: null,
rules: { rules: {
materialId: [ materialId: [
...@@ -142,9 +143,7 @@ export default { ...@@ -142,9 +143,7 @@ export default {
materialType: String, materialType: String,
}, },
mounted() { mounted() {
// if (this.eid > 0) {
// this.load(this.eid);
// }
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
...@@ -174,12 +173,6 @@ export default { ...@@ -174,12 +173,6 @@ export default {
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
}, },
// load(v) {
// Api.get({ id: v }).then((r) => {
// this.entity = r.result;
// this.entity.id = 0;
// });
// },
change(e) { change(e) {
this.entity.name = e.name; this.entity.name = e.name;
this.materialId = e.materialId; this.materialId = e.materialId;
...@@ -194,7 +187,8 @@ export default { ...@@ -194,7 +187,8 @@ export default {
item.span = 24; item.span = 24;
} }
delete item["id"]; delete item["id"];
return item.fieldType != 1; // return item.fieldType != 1;
return item.fieldType;
}); });
this.fileds.map((u) => { this.fileds.map((u) => {
let v = ""; let v = "";
...@@ -208,25 +202,12 @@ export default { ...@@ -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) { l(key) {
key = "stock" + "." + key; key = "stock" + "." + key;
return this.$t(key); return this.$t(key);
}, },
}, },
watch: { watch: {},
// v() {
// this.entity = this.$u.clone(this.v);
// },
// eid(v) {
// if (v > 0) {
// this.load(v);
// }
// },
},
}; };
</script> </script>
...@@ -33,4 +33,8 @@ export default { ...@@ -33,4 +33,8 @@ export default {
getmaterialdefinitionproperty(params){ getmaterialdefinitionproperty(params){
return Api.get(`${material}/custompropertydefinition/getmaterialdefinitionproperty`,params); return Api.get(`${material}/custompropertydefinition/getmaterialdefinitionproperty`,params);
}, },
list(params){
return Api.post(`${resourceUrl}/stockdetail/list`,params); //物料动态属性展示
},
} }
...@@ -11,6 +11,27 @@ ...@@ -11,6 +11,27 @@
:tool="false" :tool="false"
:height="treeHeight" :height="treeHeight"
></DataGrid> ></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> </div>
</template> </template>
<script> <script>
...@@ -20,57 +41,59 @@ export default { ...@@ -20,57 +41,59 @@ export default {
head: { head: {
title: "入库明细", title: "入库明细",
author: "henq", author: "henq",
description: "stock_item 7/13/2020 6:04:18 PM" description: "stock_item 7/13/2020 6:04:18 PM",
}, },
data() { data() {
return { return {
action: Api.indexStockitem, action: Api.indexStockitem,
easySearch: { easySearch: {
materialCode: { op: "Equal", value: this.mcode }, materialCode: { op: "Equal", value: this.mcode },
storeId: { op: "In", value: this.storeId } storeId: { op: "In", value: this.storeId },
}, },
data: [], data: [],
modal1: false,
treeHeight: 300, treeHeight: 300,
curId: 0, curId: 0,
fileds: [],
columns: [ columns: [
{ {
key: "code", key: "code",
title: this.l("code"), title: this.l("code"),
align: "left", align: "left",
easy: true, 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", key: "nowTotal",
title: this.l("nowTotal"), title: this.l("nowTotal"),
align: "right",
high: true high: true,
}, },
{ key: "batch", title: this.l("batch"), align: "left", high: true }, { key: "batch", title: this.l("batch"), align: "left", high: true },
{ {
key: "certificateOfApproval", key: "certificateOfApproval",
title: this.l("certificateOfApproval"), title: this.l("certificateOfApproval"),
align: "left", align: "left",
high: true high: true,
}, },
{ {
key: "unitPrice", key: "unitPrice",
title: this.l("unitPrice"), title: this.l("unitPrice"),
align: "right",
high: true high: true,
}, },
{ {
key: "originalManufacturer", key: "originalManufacturer",
title: this.l("originalManufacturer"), title: this.l("originalManufacturer"),
align: "left", align: "left",
high: true high: true,
}, },
{ {
key: "creationTime", key: "creationTime",
title: this.l("creationTime"), title: this.l("creationTime"),
align: "center", align: "center",
high: true high: true,
}, },
{ {
key: "creator", key: "creator",
...@@ -83,17 +106,39 @@ export default { ...@@ -83,17 +106,39 @@ export default {
title: this.l("remark"), title: this.l("remark"),
align: "left", align: "left",
high: true, 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: "", materialName: "",
storeTitle: "" storeTitle: "",
newData: [],
}; };
}, },
props: { props: {
eid: Number, eid: Number,
storeId: Number, storeId: Number,
mcode: String mcode: String,
}, },
created() { created() {
this.treeHeight = window.innerHeight - 150; this.treeHeight = window.innerHeight - 150;
...@@ -112,8 +157,45 @@ export default { ...@@ -112,8 +157,45 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { 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() { load() {
Api.get({ id: this.eid }).then(r => { Api.get({ id: this.eid }).then((r) => {
this.materialName = r.result.name; this.materialName = r.result.name;
this.storeTitle = r.result.storeTitle; this.storeTitle = r.result.storeTitle;
}); });
...@@ -123,9 +205,6 @@ export default { ...@@ -123,9 +205,6 @@ export default {
this.modal = false; this.modal = false;
this.curId = 0; this.curId = 0;
}, },
search() {
this.$refs.grid.reload(this.easySearch);
},
cancel() { cancel() {
this.curId = 0; this.curId = 0;
this.modal = false; this.modal = false;
...@@ -133,15 +212,9 @@ export default { ...@@ -133,15 +212,9 @@ export default {
l(key) { l(key) {
let vkey = "stock_item" + "." + key; let vkey = "stock_item" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
} },
}, },
watch: { watch: {},
eid(v) {
if (v != 0) {
// this.load(v);
}
}
}
}; };
</script> </script>
<style lang="less"> <style lang="less">
......
...@@ -116,13 +116,12 @@ export default { ...@@ -116,13 +116,12 @@ export default {
return h("div", {}, params.row.minNum ? params.row.minNum : "0"); return h("div", {}, params.row.minNum ? params.row.minNum : "0");
}, },
}, },
{ // {
key: "unitPrice", // key: "unitPrice",
title: this.l("unitPrice"), // title: this.l("unitPrice"),
// easy: true,
easy: true, // high: true,
high: true, // },
},
{ {
key: "storeTitle", key: "storeTitle",
title: this.l("storeTitle"), title: this.l("storeTitle"),
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
<Row> <Row>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('name')" prop="name"> <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> --> <!-- <Input v-model="entity.name" disabled></Input> -->
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('storeTitle')" prop="storeTitle"> <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> --> <!-- <Input v-model="entity.storeTitle" disabled></Input> -->
</FormItem> </FormItem>
</Col> </Col>
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
</template> </template>
<template slot-scope="{ row, index }" slot="action"> <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> </template>
</Table> </Table>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button> <Button type="dashed" long @click="addNew" class="mt10">新增属性</Button>
...@@ -189,7 +189,7 @@ export default { ...@@ -189,7 +189,7 @@ export default {
{ {
conditionalType: "Equal", conditionalType: "Equal",
fieldName: "categoryId", fieldName: "categoryId",
fieldValue: "0" fieldValue: "0",
}, },
{ {
conditionalType: "Equal", conditionalType: "Equal",
...@@ -207,7 +207,8 @@ export default { ...@@ -207,7 +207,8 @@ export default {
this.checkList = arr.filter(function (item) { this.checkList = arr.filter(function (item) {
item.mid = item.id; item.mid = item.id;
delete item["id"]; //删除属性id delete item["id"]; //删除属性id
return item.fieldType > 1; // return item.fieldType > 1;
return true;
}); });
} }
}); });
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
</template> </template>
<template slot-scope="{ row, index }" slot="action"> <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> </template>
</Table> </Table>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button> <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