领用还回修改+备件

This commit is contained in:
2022-07-05 16:51:05 +08:00
parent 1575290605
commit c94bd6df55
3 changed files with 29 additions and 12 deletions

View File

@@ -96,9 +96,12 @@ export default {
async _queryIODis (e) {
let res = await queryIODis(e, this.$store.getters.materObj.iostorinvdtl_id)
if (res.code === '1') {
if (this.dataList.indexOf(res.content) > -1) {
} else {
if (!this.dataList.length) {
this.dataList.push(res.content)
} else {
if (JSON.stringify(this.dataList).indexOf(JSON.stringify(res.content)) == -1) {
this.dataList.push(res.content)
}
}
} else {
this.Dialog(res.desc)
@@ -109,6 +112,9 @@ export default {
let res = await confirmDis('0', this.$store.getters.materObj, this.dataList)
if (res.code === '1') {
this.toast(res.desc)
this.$router.push({
path: '/SparePartInstore'
})
} else {
this.Dialog(res.desc)
}

View File

@@ -98,9 +98,12 @@ export default {
async _queryIODis (e) {
let res = await queryIODis(e, this.$store.getters.materObj.iostorinvdtl_id)
if (res.code === '1') {
if (this.dataList.indexOf(res.content) > -1) {
} else {
if (!this.dataList.length) {
this.dataList.push(res.content)
} else {
if (JSON.stringify(this.dataList).indexOf(JSON.stringify(res.content)) == -1) {
this.dataList.push(res.content)
}
}
} else {
this.Dialog(res.desc)
@@ -111,6 +114,9 @@ export default {
let res = await confirmDis('1', this.$store.getters.materObj, this.dataList)
if (res.code === '1') {
this.toast(res.desc)
this.$router.push({
path: '/SparePartOutstore'
})
} else {
this.Dialog(res.desc)
}

View File

@@ -15,7 +15,7 @@
<tr>
<th>备件唯一编码</th>
</tr>
<tr v-for="e in dataList" :key="e.sparepart_only_id" @click="toCheck(e)" :class="{'checked': e.sparepart_only_id === pkId}">
<tr v-for="e in dataList" :key="e.sparepart_only_id">
<td>{{e.sparepart_only_id}}</td>
</tr>
</table>
@@ -31,7 +31,7 @@
<th>源单类型</th>
<th>关联设备</th>
</tr>
<tr v-for="e in dataList" :key="e.sparepart_only_id" @click="toCheck(e)" :class="{'checked': e.sparepart_only_id === pkId}">
<tr v-for="e in dataList" :key="e.sparepart_only_id">
<td>{{e.material_name}}</td>
<td>{{e.material_model}}</td>
<td>{{e.material_spec}}</td>
@@ -45,7 +45,7 @@
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled1" @click="toSure">确认入库</button>
<button class="btn submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled1" @click="_confirmReturn">确认入库</button>
</section>
</section>
</template>
@@ -82,13 +82,18 @@ export default {
async _queryReturnDis () {
let res = await queryReturnDis(this.val1)
if (res.code === '1') {
this.dataList.map((el) => {
if (el.sparepart_only_id === this.val1) {
this.dataList.push(res.content)
} else {
this.toast('关联设备不一致')
this.dataList.length && this.dataList.map((el) => {
if (el.sparepart_only_id !== this.val1) {
if (el.device_code === res.content.device_code) {
this.dataList.push(res.content)
} else {
this.toast('关联设备不一致')
}
}
})
if (!this.dataList.length) {
this.dataList.push(res.content)
}
} else {
this.Dialog(res.desc)
}