|
|
@@ -11,10 +11,13 @@
|
|
|
<div class="mt-3">
|
|
|
|
|
|
<span class="mt-3" >
|
|
|
- <button class="btn btn-sm" @click="listMode?listMode=false:listMode=true" :class="listMode?'btn-dark':'btn-outline-dark'">
|
|
|
- <span v-if="!listMode">切换为列表</span>
|
|
|
- <span v-if="listMode">切换为盘点</span>
|
|
|
- </button>
|
|
|
+ <a :href="'{{url('inventory/stockInventory/enterStockInventory')}}/'+inventory.id+'?listMode=true'"><button class="btn btn-sm btn-outline-dark" v-if="!listMode">切换为列表</button></a>
|
|
|
+ <a :href="'{{url('inventory/stockInventory/enterStockInventory')}}/'+inventory.id+'?listMode=false'"><button class="btn btn-sm btn-outline-dark" v-if="listMode &&inventory.status!='已完成'">切换为盘点</button></a>
|
|
|
+ <span><button class="btn btn-sm btn-outline-info" v-if="inventory.status==='复盘中' &&!listMode" @click="盘点任务完结(inventory.id,inventory.owner.name,inventory.type)">完结</button></span>
|
|
|
+{{-- <button class="btn btn-sm" @click="listMode?listMode=false:listMode=true" :class="listMode?'btn-dark':'btn-outline-dark'">--}}
|
|
|
+ {{-- <span v-if="!listMode">切换为列表</span>--}}
|
|
|
+ {{-- <span v-if="listMode">切换为盘点</span>--}}
|
|
|
+ {{-- </button>--}}
|
|
|
</span>
|
|
|
<span class="form-group mb-5">
|
|
|
<label class="text-muted">货主:</label><span class="font-weight-bold">@{{ inventory.owner.name }}</span>
|
|
|
@@ -64,8 +67,8 @@
|
|
|
</span>
|
|
|
<span class="form-group ml-4">
|
|
|
<label for="barcode" class="text-secondary font-weight-bold">请输产品条码</label>
|
|
|
- <input id="barcode" name="barcode" @keypress="inputSwitch($event)"
|
|
|
- type="text" value="@if(old('barcode')){{old('barcode')}}@endif" class="form-control input" autocomplete="off" @blur="searchBarcode">
|
|
|
+ <input id="barcode" name="barcode" @keypress="inputSwitch($event)"
|
|
|
+ type="text" value="@if(old('barcode')){{old('barcode')}}@endif" class="form-control input" autocomplete="off" @blur="searchBarcode">
|
|
|
</span>
|
|
|
<span class="form-group ml-4">
|
|
|
<label for="count" class="text-secondary font-weight-bold">请输盘点数</label>
|
|
|
@@ -74,80 +77,92 @@
|
|
|
</span>
|
|
|
|
|
|
<span v-if="inventory.status=='复盘中'" class="form-group ml-4">
|
|
|
- <label for="count" class="text-secondary font-weight-bold">上一次盘点数</label>
|
|
|
+ <label for="count" class="text-secondary">上一次盘点数:</label>
|
|
|
<span v-if="!inventoryMissionRecord.re_checked_amount">
|
|
|
- <input type="text" id="count" @keypress="inputSwitch($event)"
|
|
|
- name="count" v-model="inventoryMissionRecord.verified_amount" class="form-control input" readonly>
|
|
|
+ <span class="font-weight-bold" >@{{ inventoryMissionRecord.verified_amount }}</span>
|
|
|
</span>
|
|
|
<span v-if="inventoryMissionRecord.re_checked_amount">
|
|
|
- <input type="text" id="count" @keypress="inputSwitch($event)"
|
|
|
- name="count" v-model="inventoryMissionRecord.re_checked_amount" class="form-control input" readonly>
|
|
|
+ <span class="font-weight-bold">@{{ inventoryMissionRecord.re_checked_amount }}</span>
|
|
|
</span>
|
|
|
</span>
|
|
|
+
|
|
|
<span v-if="inventory.status=='复盘中'" class="form-group ml-4">
|
|
|
- <label for="count" class="text-secondary font-weight-bold">盘点差异数</label>
|
|
|
- <input type="text" id="difference_amount" @keypress="inputSwitch($event)"
|
|
|
- name="difference_amount" v-model="inventoryMissionRecord.difference_amount" class="form-control input" readonly>
|
|
|
+ <label for="count" class="text-secondary">盘点差异数:</label>
|
|
|
+ <span v-if="inventoryMissionRecord.difference_amount" class="font-weight-bold">@{{ inventoryMissionRecord.difference_amount }}</span>
|
|
|
</span>
|
|
|
</form>
|
|
|
|
|
|
|
|
|
- <table class="table table-sm table-striped table-bordered table-hover text-nowrap d-none d-md-block mt-2">
|
|
|
- <tr>
|
|
|
- <th>序号</th>
|
|
|
- <th>库位</th>
|
|
|
- <th>产品名</th>
|
|
|
- <th>产品条码</th>
|
|
|
- <th>产品编码</th>
|
|
|
- <th>生产日期</th>
|
|
|
- <th>失效日期</th>
|
|
|
- <th>入库日期</th>
|
|
|
- <th>批号</th>
|
|
|
- <th>ERP属性仓</th>
|
|
|
- <th>质量状态</th>
|
|
|
- <th>库存数量</th>
|
|
|
- <th>可用数量</th>
|
|
|
- <th>盘点数量</th>
|
|
|
- <th>复盘数量</th>
|
|
|
- <th>盘点差异</th>
|
|
|
- <th>分配数量</th>
|
|
|
- </tr>
|
|
|
- <tr v-for="(inventoryMission,i) in inventoryMissions" v-if="inventoryMission.checked==='是'||inventory.status==='复盘中'||listMode" @click="selectedColor(inventoryMission.id)"
|
|
|
- :style="{'font-weight': inventory.id==selectedStyle?'bold':''}" :class="[
|
|
|
+ <div class="card-header pt-0">
|
|
|
+ <div id="form"></div>
|
|
|
+ </div>
|
|
|
+ <div class="card-body pt-1">
|
|
|
+ <label for="all" class="d-none" id="cloneCheckAll">
|
|
|
+ <input id="all" type="checkbox" @click="checkAll($event)">全选
|
|
|
+ </label>
|
|
|
+ <table class="table table-sm table-bordered d-none text-nowrap " id="headerRoll"></table>
|
|
|
+ <table class="table table-sm table-hover table-striped d-none d-xl-block p-0 text-nowrap table-bordered" id="headerParent">
|
|
|
+ <tr class="p-0" id="header"></tr>
|
|
|
+ <tr v-for="(inventoryMission,i) in inventoryMissions" v-if="inventoryMission.checked==='是'||inventory.status==='复盘中'||listMode" @click="selectedColor(inventoryMission.id)"
|
|
|
+ :style="{'font-weight': inventory.id==selectedStyle?'bold':''}" :class="[
|
|
|
inventoryMission.mark==='已复盘有差异'?'td-cool':'',
|
|
|
inventoryMission.mark==='已复盘无差异'?'td-cool text-muted':'',
|
|
|
inventoryMission.mark==='未复盘有差异'?'td-warm font-weight-bold':'',
|
|
|
inventoryMission.mark==='无差异'?'text-muted':'',
|
|
|
inventoryMission.mark==='未盘'?'td-yellow':'',
|
|
|
]">
|
|
|
- <td>@{{ i+1 }}</td>
|
|
|
- <td>@{{ inventoryMission.location }}</td>
|
|
|
- <td v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.name }}</td>
|
|
|
- <td v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.barcode }}</td>
|
|
|
- <td v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.sku }}</td>
|
|
|
- <td >@{{ inventoryMission.produced_at }}</td>
|
|
|
- <td >@{{ inventoryMission.valid_at }}</td>
|
|
|
- <td >@{{ inventoryMission.stored_at }}</td>
|
|
|
- <td class="text-muted">@{{ inventoryMission.batch_number }}</td>
|
|
|
- <td >@{{ inventoryMission.erp_type_position }}</td>
|
|
|
- <td >
|
|
|
- <span v-if="listMode">@{{ inventoryMission.quality }}</span>
|
|
|
- <select v-else class="form-control-sm" name="quality" id="quality" v-model="inventoryMission.quality"
|
|
|
- @change="updateQuality(inventoryMission.id,inventoryMission.location,inventoryMission.commodity.sku,inventoryMission.quality,inventory.owner.code)">
|
|
|
- <option value="正品">正品</option>
|
|
|
- <option value="残次">残次</option>
|
|
|
- </select>
|
|
|
- </td>
|
|
|
- <td >@{{ inventoryMission.stored_amount }}</td>
|
|
|
- <td >@{{ inventoryMission.valid_amount }}</td>
|
|
|
- <td>@{{ inventoryMission.verified_amount }}</td>
|
|
|
- <td>@{{ inventoryMission.re_checked_amount }}</td>
|
|
|
- <td>@{{ inventoryMission.difference_amount }}</td>
|
|
|
- <td>@{{ inventoryMission.occupied_amount }}</td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
+ <td>
|
|
|
+ <input type="checkbox" :value="inventoryMission.id" v-model="checkData">
|
|
|
+ </td>
|
|
|
+ <td>@{{ i+1 }}</td>
|
|
|
+ <td>@{{ inventoryMission.location }}</td>
|
|
|
+ <td v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.name }}</td>
|
|
|
+ <td v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.barcode }}</td>
|
|
|
+ <td v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.sku }}</td>
|
|
|
+ <td >@{{ inventoryMission.produced_at }}</td>
|
|
|
+ <td >@{{ inventoryMission.valid_at }}</td>
|
|
|
+ <td class="text-muted">@{{ inventoryMission.batch_number }}</td>
|
|
|
+
|
|
|
+ <td v-if="inventoryMission.stockInventoryPersons &&!listMode" class="text-muted" :rowspan="inventoryMission.is_multi_row?2:''">
|
|
|
+ <a href="#" v-if="inventoryMission.stockInventoryPersons.length>0" class="dropdown-toggle" data-toggle="dropdown">
|
|
|
+ @{{ inventoryMission.stockInventoryPersons[0].mark }}<b class="caret"></b>
|
|
|
+ </a>
|
|
|
+ <div style="position: absolute;width:320px;margin-left:-100px;background-color: white;max-height:150px ;overflow-y:auto" class="small mt-0 dropdown-menu">
|
|
|
+ <table class="table table-sm table-striped table-bordered">
|
|
|
+ <tr>
|
|
|
+ <th>盘点人</th>
|
|
|
+ <th>时间</th>
|
|
|
+ </tr>
|
|
|
+ <tr v-for="stockInventoryPerson in inventoryMission.stockInventoryPersons">
|
|
|
+ <td>@{{ stockInventoryPerson.mark }}</td>
|
|
|
+ <td>@{{ stockInventoryPerson.created_at }}</td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </td><td v-if="listMode"></td>
|
|
|
|
|
|
- <table class="table table-striped table-sm table-bordered table-hover p-0 d-block d-md-none" style="background: rgb(255, 255, 255);" >
|
|
|
+ <td >@{{ inventoryMission.erp_type_position }}</td>
|
|
|
+ <td >
|
|
|
+ <span v-if="listMode">@{{ inventoryMission.quality }}</span>
|
|
|
+ <select v-else class="form-control-sm" name="quality" id="quality" v-model="inventoryMission.quality"
|
|
|
+ @change="updateQuality(inventoryMission.id,inventoryMission.location,inventoryMission.commodity.sku,inventoryMission.quality,inventory.owner.code)">
|
|
|
+ <option value="正品">正品</option>
|
|
|
+ <option value="残次">残次</option>
|
|
|
+ </select>
|
|
|
+ </td>
|
|
|
+ <td >@{{ inventoryMission.stored_amount }}</td>
|
|
|
+ <td >@{{ inventoryMission.valid_amount }}</td>
|
|
|
+ <td>@{{ inventoryMission.verified_amount }}</td>
|
|
|
+ <td>@{{ inventoryMission.re_checked_amount }}</td>
|
|
|
+ <td>@{{ inventoryMission.difference_amount }}</td>
|
|
|
+ <td>@{{ inventoryMission.occupied_amount }}</td>
|
|
|
+ <td v-if="!listMode">
|
|
|
+ <span class="btn btn-sm btn-outline-danger" @click="删除盘点记录(inventoryMission.id,inventoryMission.inventory_account_id,inventoryMission.commodity.name)">删除</span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <table id="listOnPad" class="table table-striped table-sm table-bordered table-hover p-0 d-table d-xl-none" style="background: rgb(255, 255, 255);" >
|
|
|
<tbody>
|
|
|
<tr v-for="inventoryMission in inventoryMissions" v-if="inventoryMission.checked==='是'||inventory.status==='复盘中'||listMode"
|
|
|
:class="[
|
|
|
@@ -163,7 +178,7 @@
|
|
|
<span class="mr-3 text-nowrap"><span class="font-weight-bold">库位:</span><span style="color:#af7651">@{{ inventoryMission.location }}</span></span>
|
|
|
<span class="mr-3 text-nowrap"><span class="font-weight-bold">产品名称:</span><span style="color:#af7651" v-if="inventoryMission.commodity">@{{ inventoryMission.commodity.name }}</span></span>
|
|
|
<span class="mr-3 text-nowrap">
|
|
|
- <span class="font-weight-bold">产品条码:</span>
|
|
|
+ <span class="font-weight-bold">质量状态:</span>
|
|
|
<span v-if="listMode">@{{ inventoryMission.quality }}</span>
|
|
|
<select v-else class="form-control-sm" name="quality" id="quality"
|
|
|
v-model="inventoryMission.quality"
|
|
|
@@ -178,6 +193,11 @@
|
|
|
<span class="mr-3 text-nowrap"><span style="color:#783000" class="font-weight-bold">复盘数量:</span><span style="color:#af7651">@{{ inventoryMission.re_checked_amount }}</span></span>
|
|
|
<span class="mr-3 text-nowrap"><span style="color:#783000" class="font-weight-bold">盘点差异:</span><span >@{{ inventoryMission.difference_amount }}</span></span>
|
|
|
</div>
|
|
|
+ <div v-if="!listMode">
|
|
|
+ <span class="mr-3 text-nowrap"><span class="font-weight-bold">操作:</span>
|
|
|
+ <span class="btn btn-sm btn-outline-danger" @click="删除盘点记录(inventoryMission.id,inventoryMission.inventory_account_id,inventoryMission.commodity.name)">删除</span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</td>
|
|
|
@@ -190,12 +210,44 @@
|
|
|
@endsection
|
|
|
|
|
|
@section('lastScript')
|
|
|
+ {{-- <script type="text/javascript" src="{{asset('js/queryForm/export200818a.js')}}"></script>--}}
|
|
|
+ {{-- <script type="text/javascript" src="{{asset('js/queryForm/queryForm200828a.js')}}"></script>--}}
|
|
|
+ <script type="text/javascript" src="{{asset('js/queryForm/header200826b.js')}}"></script>
|
|
|
<script>
|
|
|
+ let hideHeaderTitle = function (){
|
|
|
+ let $listOnPad = $('#listOnPad');
|
|
|
+ let $headerRoll = $('#headerRoll');
|
|
|
+ if($listOnPad.css('display')!=='none'){
|
|
|
+ $headerRoll.attr('hidden',true)
|
|
|
+ }else{
|
|
|
+ $headerRoll.attr('hidden',false)
|
|
|
+ $headerRoll.find('tr').css('width',$(document).width());
|
|
|
+ }
|
|
|
+ };
|
|
|
+ window.onresize= hideHeaderTitle;
|
|
|
+ window.onscroll=hideHeaderTitle;
|
|
|
let listVue = new Vue({
|
|
|
el: "#list",
|
|
|
data: {
|
|
|
inventory:{!! $inventoryAccount!!},
|
|
|
- inventoryMissions:{!! $inventoryAccountMissions !!},
|
|
|
+ {{--inventoryMissions:{!! $inventoryAccountMissions !!},--}}
|
|
|
+ inventoryMissions : [
|
|
|
+ @foreach($inventoryAccountMissions as $inventoryMission)
|
|
|
+ {id:'{{$inventoryMission->id}}',location:'{{$inventoryMission->location}}',
|
|
|
+ created_at:'{{$inventoryMission->created_at}}', commodity:{!! $inventoryMission->commodity !!},
|
|
|
+ commodity_name:'{{$inventoryMission->commodity ? $inventoryMission->commodity->name : ''}}',
|
|
|
+ commodity_sku:'{{$inventoryMission->commodity ? $inventoryMission->commodity->sku : ''}}',
|
|
|
+ commodity_barcode:'{{$inventoryMission->commodity ? $inventoryMission->commodity->barcode : ''}}',
|
|
|
+ stockInventoryPersons:{!! $inventoryMission->stockInventoryPersons !!},
|
|
|
+ produced_at:'{{$inventoryMission->produced_at}}', valid_at:'{{$inventoryMission->valid_at}}', verified_amount:'{{$inventoryMission->verified_amount}}',
|
|
|
+ stored_amount:'{{$inventoryMission->stored_amount}}', valid_amount:'{{$inventoryMission->valid_amount}}',
|
|
|
+ stored_at:'{{$inventoryMission->stored_at}}', batch_number:'{{$inventoryMission->batch_number}}',
|
|
|
+ erp_type_position:'{{$inventoryMission->erp_type_position}}', quality:'{{$inventoryMission->quality}}',
|
|
|
+ difference_amount:'{{$inventoryMission->difference_amount}}', occupied_amount:'{{$inventoryMission->occupied_amount}}',
|
|
|
+ checked:'{{$inventoryMission->checked}}', returned:'{{$inventoryMission->returned}}',
|
|
|
+ re_checked_amount:'{{$inventoryMission->re_checked_amount}}'},
|
|
|
+ @endforeach
|
|
|
+ ],
|
|
|
checkData: [],
|
|
|
selectedStyle:'',
|
|
|
inventoryMissionRecord:{},
|
|
|
@@ -220,13 +272,59 @@
|
|
|
if(listMode==='true'){_this.listMode=true;return;}
|
|
|
_this.listMode=false;
|
|
|
})();
|
|
|
+ let column = [
|
|
|
+ {name:'cloneCheckAll',customization:true,type:'checkAll',column:'id',
|
|
|
+ dom:$('#cloneCheckAll').removeClass('d-none'), neglect: true},
|
|
|
+ {name:'index',value: '序号', neglect: true},
|
|
|
+ {name:'location',value: '库位'},
|
|
|
+ {name: 'commodity_name', value: '产品名'},
|
|
|
+ {name: 'commodity_barcode', value: '产品条码'},
|
|
|
+ {name:'commodity_sku',value: '产品编码'},
|
|
|
+ {name: 'produced_at', value: '生产日期', neglect: true},
|
|
|
+ {name: 'valid_at', value: '失效日期', neglect: true},
|
|
|
+ {name: 'batch_number', value: '批号', neglect: true},
|
|
|
+ {name: 'stockInventoryPersons',value: '盘点人', neglect: true},
|
|
|
+ {name: 'erp_type_position', value: 'ERP属性仓', neglect: true},
|
|
|
+ {name: 'quality', value: '质量状态', neglect: true},
|
|
|
+ {name: 'stored_amount', value: '库存数量', neglect: true},
|
|
|
+ {name: 'valid_amount', value: '可用数量', neglect: true},
|
|
|
+ {name: 'verified_amount', value: '盘点数量', neglect: true},
|
|
|
+ {name: 're_checked_amount', value: '复盘数量', neglect: true},
|
|
|
+ {name: 'difference_amount', value: '复盘差异', neglect: true},
|
|
|
+ {name: 'occupied_amount', value: '分配数量', neglect: true},
|
|
|
+ {name: 'remove', value: '', neglect: true},
|
|
|
+ ];
|
|
|
+ setTimeout(function () {
|
|
|
+ let header = new Header({
|
|
|
+ el: "#header",
|
|
|
+ column: column,
|
|
|
+ data: _this.inventoryMissions,
|
|
|
+ restorationColumn: 'id',
|
|
|
+ fixedTop:($('#form').height())+2,
|
|
|
+ vue:listVue,
|
|
|
+ });
|
|
|
+ header.init();
|
|
|
+ },0);
|
|
|
},
|
|
|
methods:{
|
|
|
+ //全选事件
|
|
|
+ checkAll(e) {
|
|
|
+ if (e.target.checked) {
|
|
|
+ this.inventoryMissions.forEach((el) => {
|
|
|
+ if (!el.id) this.checkData.push(el.id);
|
|
|
+ if (el.id && this.checkData.indexOf(el.id) === -1) {
|
|
|
+ this.checkData.push(el.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.checkData = [];
|
|
|
+ }
|
|
|
+ },
|
|
|
inputSwitch(e){
|
|
|
if(e.key==='Enter') {
|
|
|
let inputs = $("#form .input");
|
|
|
let idx = inputs.index($(e.target)); // 获取当前焦点输入框所处的位置
|
|
|
- let location=document.getElementById('inventoryInput').value;
|
|
|
+ let location=document.getElementById('inventoryInput').value.trim();
|
|
|
if (idx == 2) { // 判断是否是最后一个输入框
|
|
|
if (location==''){
|
|
|
document.getElementById('inventoryInput').focus();
|
|
|
@@ -248,45 +346,66 @@
|
|
|
}
|
|
|
this.selectedStyle=id;
|
|
|
},
|
|
|
- //验证输入盘点产品条码对应是否有商品
|
|
|
+ //验证输入盘点产品条码对应是否有商品并且查询出初盘时的盘点记录
|
|
|
searchBarcode(){
|
|
|
let _this=this;
|
|
|
let barcode=document.getElementById('barcode').value.trim();
|
|
|
- let location=document.getElementById('inventoryInput').value;
|
|
|
+ let location=document.getElementById('inventoryInput').value.trim();
|
|
|
let inventoryId=_this.inventory.id;
|
|
|
let barcodes=[];
|
|
|
_this.inventoryMissions.forEach(function (inventoryMission) {
|
|
|
barcodes.push(inventoryMission.commodity.barcode);
|
|
|
});
|
|
|
if (!barcodes.includes(barcode)){
|
|
|
- if (barcode!=''){
|
|
|
+ if (barcode!==''){
|
|
|
tempTip.setDuration(2000);
|
|
|
tempTip.show('输入的产品条码没有对应的产品!');
|
|
|
}
|
|
|
}else {
|
|
|
- //根据该库存和产品条码查询该条盘点记录
|
|
|
- let url='{{url('inventory/searchStockInventoryRecord')}}';
|
|
|
- axios.post(url,{location:location,barcode:barcode,inventoryId:inventoryId}).then(function (response) {
|
|
|
- if (!response.data.success){
|
|
|
+ if (location===''){
|
|
|
+ document.getElementById('inventoryInput').focus();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (_this.inventory.status==='复盘中'){
|
|
|
+ //根据该库存和产品条码查询该条盘点记录
|
|
|
+ let url='{{url('inventory/searchStockInventoryRecord')}}';
|
|
|
+ axios.post(url,{location:location,barcode:barcode,inventoryId:inventoryId}).then(function (response) {
|
|
|
+ if (!response.data.success){
|
|
|
+ tempTip.setDuration(2000);
|
|
|
+ tempTip.show('复盘!'+' '+response.data.data);
|
|
|
+ }else {
|
|
|
+ _this.inventoryMissionRecord=response.data.data;
|
|
|
+ }
|
|
|
+ }).catch(function (err) {
|
|
|
tempTip.setDuration(2000);
|
|
|
- tempTip.show('复盘!'+' '+response.data.data);
|
|
|
- }else {
|
|
|
- _this.inventoryMissionRecord=response.data.data;
|
|
|
- }
|
|
|
- }).catch(function (err) {
|
|
|
- tempTip.setDuration(2000);
|
|
|
- tempTip.show('网络错误'+err);
|
|
|
- });
|
|
|
+ tempTip.show('网络错误'+err);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
//提交盘点
|
|
|
submitStockInventory(){
|
|
|
let _this=this;
|
|
|
- let url='{{url('inventory/stockInventory')}}';
|
|
|
let location=document.getElementById('inventoryInput').value.trim();
|
|
|
let barcode=document.getElementById('barcode').value.trim();
|
|
|
let count=document.getElementById('count').value.trim();
|
|
|
let inventoryId=_this.inventory.id;
|
|
|
+ let locations=[];
|
|
|
+ _this.inventoryMissions.forEach(function (inventoryMission) {
|
|
|
+ locations.push(inventoryMission.location);
|
|
|
+ });
|
|
|
+ if (location===''){
|
|
|
+ document.getElementById('inventoryInput').focus();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (_this.inventory.status==='盘点中'||_this.inventory.status==='待盘点'){
|
|
|
+ if (!locations.includes(location)){
|
|
|
+ if(!confirm('该'+location+'库位在系统盘点记录中不存在!'+'确定是否需要添加至系统盘点记录中?')){return};
|
|
|
+ this.增加系统之外的库位记录(location,barcode,count,inventoryId);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let url='{{url('inventory/stockInventory')}}';
|
|
|
axios.post(url,{location:location,barcode:barcode,count:count,inventoryId:inventoryId})
|
|
|
.then(function (response) {
|
|
|
if (!response.data.success){
|
|
|
@@ -300,11 +419,13 @@
|
|
|
_this.inventory.check_surplus=response.data.inventory.check_surplus;
|
|
|
}
|
|
|
_this.inventoryMissions.every(function (inventoryMission,i) {
|
|
|
- if (inventoryMission.id===response.data.inventoryMission.id){
|
|
|
+
|
|
|
+ if (parseInt(inventoryMission.id)===parseInt(response.data.inventoryMission.id)){
|
|
|
inventoryMission.checked=response.data.inventoryMission.checked;
|
|
|
inventoryMission.verified_amount=response.data.inventoryMission.verified_amount;
|
|
|
inventoryMission.difference_amount=response.data.inventoryMission.difference_amount;
|
|
|
inventoryMission.re_checked_amount=response.data.inventoryMission.re_checked_amount;
|
|
|
+ inventoryMission.stockInventoryPersons=response.data.stockInventoryPersons;
|
|
|
_this.inventoryMissions.splice(i,1)
|
|
|
_this.inventoryMissions.unshift(inventoryMission);
|
|
|
return false;
|
|
|
@@ -314,7 +435,6 @@
|
|
|
_this.重排序并标记全列表类型(_this.inventoryMissions);
|
|
|
tempTip.setDuration(3000);
|
|
|
tempTip.showSuccess('盘点成功!');
|
|
|
-
|
|
|
}).catch(function (err) {
|
|
|
tempTip.setDuration(2000);
|
|
|
tempTip.show('盘点失败!'+'网络错误'+err);
|
|
|
@@ -363,10 +483,10 @@
|
|
|
_this.inventoryMissions.forEach(function (mission,i){
|
|
|
switch(mission.checked){
|
|
|
case '已复核':
|
|
|
- if(mission.difference_amount){_this.已复盘有差异列.push(mission); mission.mark='已复盘有差异';return;}
|
|
|
+ if(parseInt(mission.difference_amount)){_this.已复盘有差异列.push(mission); mission.mark='已复盘有差异';return;}
|
|
|
_this.已复盘无差异列.push(mission); mission.mark='已复盘无差异'; return;
|
|
|
case '是':
|
|
|
- if(mission.difference_amount){_this.未复盘有差异列.push(mission); mission.mark='未复盘有差异'; return;}
|
|
|
+ if(parseInt(mission.difference_amount)){_this.未复盘有差异列.push(mission); mission.mark='未复盘有差异'; return;}
|
|
|
_this.无差异列.push(mission); mission.mark='无差异'; return;
|
|
|
case '否':
|
|
|
_this.未盘列.push(mission); mission.mark='未盘'; return;
|
|
|
@@ -429,8 +549,89 @@
|
|
|
}
|
|
|
迭代查重转移(inventoryMissions)
|
|
|
return 结果列;
|
|
|
- }
|
|
|
- ,
|
|
|
+ },
|
|
|
+ 删除盘点记录(inventoryAccountMissionId,inventoryAccountId,name){
|
|
|
+ let _this=this;
|
|
|
+ if(!confirm('确定要删除商品为:“'+name+'”的盘点记录吗?')){return};
|
|
|
+ let url = '{{url('inventory/删除盘点记录')}}';
|
|
|
+ axios.post(url,{inventoryAccountMissionId:inventoryAccountMissionId,inventoryAccountId:inventoryAccountId}).then(
|
|
|
+ function (response) {
|
|
|
+ if(!response.data.success){
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.show('盘点单号:'+id+'删除失败!');
|
|
|
+ }else {
|
|
|
+ _this.inventoryMissions.every(function (inventoryAccountMission,i) {
|
|
|
+ if (response.data.data>0&&inventoryAccountMission.id===inventoryAccountMissionId){
|
|
|
+ _this.inventoryMissions.splice(i,1);
|
|
|
+ return false;
|
|
|
+ }else {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ });
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.showSuccess('盘点记录:'+inventoryAccountMissionId+'删除成功!');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ).catch(function (err) {
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.show('删除失败,网络链接错误!'+err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ 盘点任务完结(id,owner_name,type){
|
|
|
+ let _this=this;
|
|
|
+ if(!confirm('确定完结货主为:“'+owner_name+'”的“'+type+'”任务吗?')){return};
|
|
|
+ let url = '{{url('inventory/盘点任务完结')}}/'+id;
|
|
|
+ axios.get(url).then(function (response) {
|
|
|
+ if(!response.data.success){
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.show('修改完结状态失败!');
|
|
|
+ }else {
|
|
|
+ if (response.data.data.id===id){
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.showSuccess('货主为:“'+owner_name+'”的“'+type+'”任务完结成功');
|
|
|
+ window.setTimeout(function () {
|
|
|
+ window.location.href='{{url('inventory/stockInventory/mission')}}';
|
|
|
+ },1000);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(function (err) {
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.show('修改完结状态失败! '+err);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ 增加系统之外的库位记录(location,barcode,count,inventoryId){
|
|
|
+ let _this=this;
|
|
|
+ let url='{{url('inventory/增加系统之外的库位记录')}}';
|
|
|
+ axios.post(url,{location:location,barcode:barcode,count:count,inventoryId:inventoryId}).then(
|
|
|
+ function (response) {
|
|
|
+ if(!response.data.success){
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.show('增加系统之外的库位记录失败!');
|
|
|
+ }else {
|
|
|
+ _this.inventoryMissions.push(response.data.data);
|
|
|
+ _this.inventoryMissions.every(function (inventoryAccountMission,i) {
|
|
|
+ if (parseInt(inventoryAccountMission.id)===parseInt(response.data.data.id)){
|
|
|
+ _this.inventoryMissions.splice(i,1)
|
|
|
+ _this.inventoryMissions.unshift(inventoryAccountMission);
|
|
|
+ return false;
|
|
|
+ }else {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ });
|
|
|
+ _this.重排序并标记全列表类型(_this.inventoryMissions);
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.showSuccess('增加系统之外的库位记录成功!');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ).catch(function (err) {
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.show('增加系统之外的库位记录失败,网络链接错误!'+err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// 单条排序并着色(inventoryMission){
|
|
|
// let _this=this;
|
|
|
// let 所在临时分类列=[];
|