diff --git a/src/views/inm/mioitem.vue b/src/views/inm/mioitem.vue
index f49cc838..dff3460e 100644
--- a/src/views/inm/mioitem.vue
+++ b/src/views/inm/mioitem.vue
@@ -9,8 +9,7 @@
- 发货标签
- 打印
+ 打印
{{
mioObj.number
@@ -52,6 +51,7 @@
>{{ mioObj.customer_name }}
+ 大箱标签:第{{ item }}箱
@@ -322,7 +322,6 @@ import packDialog from "./packPrint_form.vue";
import checkDialog from "./mioitem_check.vue";
import print from "./../setting/print/A4.vue";
import scFileImport from "@/components/scFileImport";
-import { index } from "d3";
export default {
name: "mioitem",
components: {
@@ -359,6 +358,7 @@ export default {
mioObj: {},
mioitemObj: {},
wprList:[],
+ indexArr:[],
selection: [],
tableData:[],
tableDatas:[],
@@ -425,14 +425,19 @@ export default {
that.mioObj = res;
that.mioType = res.type;
that.belongDeptId = res.belong_dept;
+ let items = res.items;
+ let indexArr = [];
+ items.forEach((item)=>{
+ if(indexArr.indexOf(item.pack_index) == -1){
+ indexArr.push(item.pack_index);
+ }
+ })
+ that.indexArr = indexArr;
});
},
//添加
table_add() {
let that = this;
- // console.log(this.$refs.table);
- // console.log(this.$refs.table.tableData);
- // console.log(that.mioType);
let tableData = this.$refs.table.tableData;
let datas = [];
tableData.forEach(item => {
@@ -470,6 +475,7 @@ export default {
that.$API.inm.mio.packmioitem.req(that.mioObj.id,params).then((res) => {
that.$message.success("装箱成功");
that.showPack = false;
+ that.getMio();
that.$refs.table.refresh();
});
},
@@ -542,11 +548,8 @@ export default {
},
//本地更新数据
handleSaveSuccess(data, mode) {
- if (mode == "add") {
- this.$refs.table.refresh();
- } else if (mode == "edit") {
- this.$refs.table.refresh();
- }
+ this.getMio();
+ this.$refs.table.refresh();
},
handlePackSuccess(){},
handleCheckSuccess() {
@@ -643,13 +646,14 @@ export default {
that.printSetting();
}
},
- printSaleOut(row,type){
+ printSaleOut(row,type,index){
let that = this;
that.packType = type;
that.mioitemObj = row;
this.dialog.pack = true;
that.$nextTick(() => {
- that.$refs.packDialog.open();
+ let total = that.indexArr.length;
+ that.$refs.packDialog.open(index,total);
});
},
upSuccess1(res, close) {
diff --git a/src/views/inm/packPrint_form.vue b/src/views/inm/packPrint_form.vue
index add98c94..bf789752 100644
--- a/src/views/inm/packPrint_form.vue
+++ b/src/views/inm/packPrint_form.vue
@@ -137,8 +137,6 @@ export default {
},
mounted() {
let that = this;
- console.log(that.type);
- console.log(that.mioObj);
that.$nextTick(() => {
if(that.type=="in"){//里面的小箱子
that.form.name = that.mioObj.material_?that.mioObj.material_.name:'';
@@ -146,21 +144,36 @@ export default {
that.form.batch = that.mioObj.batch;
that.form.count = that.mioObj.count;
}else{//外面的大箱子
- let date = new Date();
- that.form.date = that.$TOOL.dateFormat2(date);
- console.log(that.form.date);
let items = that.mioObj.items;
- that.form.date = that.mioObj.date;
- that.form.packNum = items.length;
- that.form.pack = items.map(item=>item.count).reduce((a,b)=>a+b);
that.form.name = items[0].material_.name;
that.form.model = items[0].material_.model;
+ that.form.batch = items[0].batch;
}
})
},
methods: {
//显示
- open() {
+ open(index,total) {
+ let that = this;
+ let date = new Date();
+ that.form.date = that.$TOOL.dateFormat2(date);
+ if(index&&total){
+ that.form.packNum = total;
+ that.form.pack = index+'/'+total;
+ that.$nextTick(() => {
+ let totalCount = 0;
+ let items = that.mioObj.items;
+ that.form.name = items[0].material_.name;
+ that.form.model = items[0].material_.model;
+ that.form.batch = items[0].batch;
+ items.forEach(item=>{
+ if(item.pack_index==index){
+ totalCount += Number(item.count);
+ }
+ })
+ that.form.count = totalCount;
+ })
+ }
this.visible = true;
return this;
},