mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-12 10:00:56 +08:00
优化代码
This commit is contained in:
parent
f2b69e828a
commit
3ecb58acf8
@ -9,6 +9,7 @@
|
|||||||
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
|
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th class="text-center"><input type="checkbox" class="i-checks" @click="checkAll($event)"></th>
|
||||||
<th class="text-center"><span><vc:i18n name="物品类型" namespace="resourceEnterManage"></vc:i18n></span></th>
|
<th class="text-center"><span><vc:i18n name="物品类型" namespace="resourceEnterManage"></vc:i18n></span></th>
|
||||||
<th class="text-center"><span><vc:i18n name="物品名称" namespace="resourceEnterManage"></vc:i18n></span></th>
|
<th class="text-center"><span><vc:i18n name="物品名称" namespace="resourceEnterManage"></vc:i18n></span></th>
|
||||||
<th class="text-center"><span><vc:i18n name="物品规格" namespace="resourceEnterManage"></vc:i18n></span></th>
|
<th class="text-center"><span><vc:i18n name="物品规格" namespace="resourceEnterManage"></vc:i18n></span></th>
|
||||||
@ -24,6 +25,9 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="resourceEnter in resourceEnterManageInfo.purchaseApplyDetailVo">
|
<tr v-for="resourceEnter in resourceEnterManageInfo.purchaseApplyDetailVo">
|
||||||
|
<td class="text-center">
|
||||||
|
<input type="checkbox" class="i-checks checkItem" v-bind:value="resourceEnter.resId" v-model="resourceEnterManageInfo.selectResIds">
|
||||||
|
</td>
|
||||||
<td class="text-center">{{resourceEnter.rstName ? resourceEnter.rstName : '-'}}</td>
|
<td class="text-center">{{resourceEnter.rstName ? resourceEnter.rstName : '-'}}</td>
|
||||||
<td class="text-center">{{resourceEnter.resName}}</td>
|
<td class="text-center">{{resourceEnter.resName}}</td>
|
||||||
<td class="text-center">{{resourceEnter.specName ? resourceEnter.specName : '-'}}</td>
|
<td class="text-center">{{resourceEnter.specName ? resourceEnter.specName : '-'}}</td>
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
resOrderType: '',
|
resOrderType: '',
|
||||||
purchaseApplyDetailVo: [],
|
purchaseApplyDetailVo: [],
|
||||||
resourceSuppliers: [],
|
resourceSuppliers: [],
|
||||||
|
selectResIds: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_initMethod: function() {
|
_initMethod: function() {
|
||||||
@ -92,7 +93,19 @@
|
|||||||
_submit: function() {
|
_submit: function() {
|
||||||
//校验 是否填写正确
|
//校验 是否填写正确
|
||||||
let msg = '';
|
let msg = '';
|
||||||
|
let _tmpPurchaseApplyDetailVo = [];
|
||||||
$that.resourceEnterManageInfo.purchaseApplyDetailVo.forEach(function(item) {
|
$that.resourceEnterManageInfo.purchaseApplyDetailVo.forEach(function(item) {
|
||||||
|
$that.resourceEnterManageInfo.selectResIds.forEach(selectItem => {
|
||||||
|
if (item.resId == selectItem) {
|
||||||
|
_tmpPurchaseApplyDetailVo.push(item);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
if (_tmpPurchaseApplyDetailVo.length < 1) {
|
||||||
|
vc.toast('请选择入库物品')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_tmpPurchaseApplyDetailVo.forEach(function(item) {
|
||||||
console.log(item);
|
console.log(item);
|
||||||
if (!item.hasOwnProperty("purchaseQuantity") || !item.purchaseQuantity || parseInt(item.purchaseQuantity) < 0) {
|
if (!item.hasOwnProperty("purchaseQuantity") || !item.purchaseQuantity || parseInt(item.purchaseQuantity) < 0) {
|
||||||
msg = '采购数量未填写';
|
msg = '采购数量未填写';
|
||||||
@ -109,6 +122,7 @@
|
|||||||
vc.toast(msg);
|
vc.toast(msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$that.resourceEnterManageInfo.purchaseApplyDetailVo = _tmpPurchaseApplyDetailVo;
|
||||||
vc.http.apiPost(
|
vc.http.apiPost(
|
||||||
'/purchase/resourceEnter',
|
'/purchase/resourceEnter',
|
||||||
JSON.stringify($that.resourceEnterManageInfo), {
|
JSON.stringify($that.resourceEnterManageInfo), {
|
||||||
@ -152,7 +166,19 @@
|
|||||||
vc.toast("处理失败:" + errInfo);
|
vc.toast("处理失败:" + errInfo);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
|
checkAll: function(e) {
|
||||||
|
var checkObj = document.querySelectorAll('.checkItem'); // 获取所有checkbox项
|
||||||
|
if (e.target.checked) { // 判定全选checkbox的勾选状态
|
||||||
|
for (var i = 0; i < checkObj.length; i++) {
|
||||||
|
if (!checkObj[i].checked) { // 将未勾选的checkbox选项push到绑定数组中
|
||||||
|
vc.component.resourceEnterManageInfo.selectResIds.push(checkObj[i].value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else { // 如果是去掉全选则清空checkbox选项绑定数组
|
||||||
|
vc.component.resourceEnterManageInfo.selectResIds = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})(window.vc);
|
})(window.vc);
|
||||||
@ -18,6 +18,7 @@
|
|||||||
<th scope="col" class="text-center"><span><vc:i18n name="编号" namespace="printPurchaseApply"></vc:i18n></span></th>
|
<th scope="col" class="text-center"><span><vc:i18n name="编号" namespace="printPurchaseApply"></vc:i18n></span></th>
|
||||||
<th scope="col" class="text-center"><span><vc:i18n name="名称" namespace="printPurchaseApply"></vc:i18n></span></th>
|
<th scope="col" class="text-center"><span><vc:i18n name="名称" namespace="printPurchaseApply"></vc:i18n></span></th>
|
||||||
<th scope="col" class="text-center"><span><vc:i18n name="编码规格" namespace="printPurchaseApply"></vc:i18n></span></th>
|
<th scope="col" class="text-center"><span><vc:i18n name="编码规格" namespace="printPurchaseApply"></vc:i18n></span></th>
|
||||||
|
<th scope="col" class="text-center"><span><vc:i18n name="参考价格" namespace="printPurchaseApply"></vc:i18n></span></th>
|
||||||
<th scope="col" class="text-center"><span><vc:i18n name="申请数量" namespace="printPurchaseApply"></vc:i18n></span></th>
|
<th scope="col" class="text-center"><span><vc:i18n name="申请数量" namespace="printPurchaseApply"></vc:i18n></span></th>
|
||||||
<th scope="col" class="text-center"><span><vc:i18n name="采购数量" namespace="printPurchaseApply"></vc:i18n></span></th>
|
<th scope="col" class="text-center"><span><vc:i18n name="采购数量" namespace="printPurchaseApply"></vc:i18n></span></th>
|
||||||
<th scope="col" class="text-center"><span><vc:i18n name="备注" namespace="printPurchaseApply"></vc:i18n></span></th>
|
<th scope="col" class="text-center"><span><vc:i18n name="备注" namespace="printPurchaseApply"></vc:i18n></span></th>
|
||||||
@ -28,13 +29,16 @@
|
|||||||
<th scope="row" class="text-center">{{index +1}}</th>
|
<th scope="row" class="text-center">{{index +1}}</th>
|
||||||
<td class="text-center">{{item.resName}}</td>
|
<td class="text-center">{{item.resName}}</td>
|
||||||
<td class="text-center">{{item.resCode}}</td>
|
<td class="text-center">{{item.resCode}}</td>
|
||||||
|
<td class="text-center">{{item.price}}</td>
|
||||||
<td class="text-center">{{item.quantity}}</td>
|
<td class="text-center">{{item.quantity}}</td>
|
||||||
<td class="text-center">{{item.purchaseQuantity? item.purchaseQuantity : '-'}}</td>
|
<td class="text-center">{{item.purchaseQuantity? item.purchaseQuantity : '-'}}</td>
|
||||||
<td class="text-center">{{item.remark}}</td>
|
<td class="text-center">{{item.remark}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row" class="text-center"><span><vc:i18n name="备注" namespace="printPurchaseApply"></vc:i18n></span></th>
|
<th scope="row" class="text-center"><span><vc:i18n name="备注" namespace="printPurchaseApply"></vc:i18n></span></th>
|
||||||
<td colspan="5">{{printPurchaseApplyInfo.description}}</td>
|
<td colspan="4">{{printPurchaseApplyInfo.description}}</td>
|
||||||
|
<td class="text-center">参考总价格</td>
|
||||||
|
<td>{{printPurchaseApplyInfo.totalPrice}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr height="60px">
|
<tr height="60px">
|
||||||
<td colspan="2" class="text-center " style="vertical-align:middle;"><span><vc:i18n name="厂家签字" namespace="printPurchaseApply"></vc:i18n></span></td>
|
<td colspan="2" class="text-center " style="vertical-align:middle;"><span><vc:i18n name="厂家签字" namespace="printPurchaseApply"></vc:i18n></span></td>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user