|
@@ -8,7 +8,7 @@
|
|
<van-tab title="基本信息" :name="1" />
|
|
<van-tab title="基本信息" :name="1" />
|
|
</van-tabs> -->
|
|
</van-tabs> -->
|
|
|
|
|
|
- <van-form @submit="onSubmit" @failed="onFailed" label-align="top" style="margin-top: 20px">
|
|
|
|
|
|
+ <van-form @failed="onFailed" label-align="top" style="margin-top: 20px">
|
|
<van-cell-group inset>
|
|
<van-cell-group inset>
|
|
<van-field v-model="formData.businessTypeName" readonly :label="$t('waitInbound.dataSource')" />
|
|
<van-field v-model="formData.businessTypeName" readonly :label="$t('waitInbound.dataSource')" />
|
|
<van-field v-model="formData.businessCode" readonly label="入库单号" />
|
|
<van-field v-model="formData.businessCode" readonly label="入库单号" />
|
|
@@ -75,7 +75,7 @@
|
|
<div v-show="row.isArrow" style="margin-top:5px;margin-bottom:10px">
|
|
<div v-show="row.isArrow" style="margin-top:5px;margin-bottom:10px">
|
|
<div style="display:flex;margin-bottom:8px ;align-items:center">
|
|
<div style="display:flex;margin-bottom:8px ;align-items:center">
|
|
<van-field v-model="row.addQuantity" type="digit" label="" class="aa" placeholder="请输入临时登记数量"
|
|
<van-field v-model="row.addQuantity" type="digit" label="" class="aa" placeholder="请输入临时登记数量"
|
|
- style="background-color:#f7f7f7;" />
|
|
|
|
|
|
+ style="background-color:#f7f7f7;" @keyup.enter="handleStag(row,index)" />
|
|
<van-button type="success" size="small" style="width:60px;margin-left:10px" @click="handleStag(row,index)">暂存</van-button>
|
|
<van-button type="success" size="small" style="width:60px;margin-left:10px" @click="handleStag(row,index)">暂存</van-button>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
@@ -112,14 +112,12 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</van-cell-group>
|
|
</van-cell-group>
|
|
-
|
|
|
|
- <div style="margin-top: 5px;padding:0 5px">
|
|
|
|
- <van-button round block type="primary" native-type="submit" style="height:30px">
|
|
|
|
- {{$t('common.submit')}}
|
|
|
|
- </van-button>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
</van-form>
|
|
</van-form>
|
|
|
|
+ <div style="margin-top: 5px;padding:0 5px">
|
|
|
|
+ <van-button round block type="primary" style="height:30px" @click="onSubmit">
|
|
|
|
+ {{$t('common.submit')}}
|
|
|
|
+ </van-button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -199,13 +197,15 @@ const businessType = ref([
|
|
{ label: "退货出库", value: "4" },
|
|
{ label: "退货出库", value: "4" },
|
|
]);
|
|
]);
|
|
|
|
|
|
-const getProductList = () => {
|
|
|
|
|
|
+const getProductList = (flag = false) => {
|
|
|
|
+ let arr = proxy.deepClone(formData.value.productList);
|
|
proxy.post("/excessGoodsDetails/list", { stockWaitId: route.query.id }).then(
|
|
proxy.post("/excessGoodsDetails/list", { stockWaitId: route.query.id }).then(
|
|
(res) => {
|
|
(res) => {
|
|
if (res && res.data && res.data.length > 0) {
|
|
if (res && res.data && res.data.length > 0) {
|
|
formData.value.productList = res.data.map((x) => ({
|
|
formData.value.productList = res.data.map((x) => ({
|
|
...x,
|
|
...x,
|
|
productCode: x.productCustomCode,
|
|
productCode: x.productCustomCode,
|
|
|
|
+ isArrow: false,
|
|
quantity: x.excessGoodsRegisterList
|
|
quantity: x.excessGoodsRegisterList
|
|
? x.excessGoodsRegisterList.reduce(
|
|
? x.excessGoodsRegisterList.reduce(
|
|
(total, y) => (total += Number(y.quantity)),
|
|
(total, y) => (total += Number(y.quantity)),
|
|
@@ -213,6 +213,17 @@ const getProductList = () => {
|
|
)
|
|
)
|
|
: 0,
|
|
: 0,
|
|
}));
|
|
}));
|
|
|
|
+ if (
|
|
|
|
+ flag &&
|
|
|
|
+ arr &&
|
|
|
|
+ arr.length > 0 &&
|
|
|
|
+ arr.length == formData.value.productList.length
|
|
|
|
+ ) {
|
|
|
|
+ for (let i = 0; i < formData.value.productList.length; i++) {
|
|
|
|
+ const element = formData.value.productList[i];
|
|
|
|
+ element.isArrow = arr[i].isArrow || false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
selectGoodStore.setGood(formData.value.productList);
|
|
selectGoodStore.setGood(formData.value.productList);
|
|
} else {
|
|
} else {
|
|
formData.value.productList = [];
|
|
formData.value.productList = [];
|
|
@@ -265,7 +276,7 @@ const handleStag = (row, index) => {
|
|
proxy.post("/excessGoodsRegister/add", obj).then((res) => {
|
|
proxy.post("/excessGoodsRegister/add", obj).then((res) => {
|
|
row.addQuantity = "";
|
|
row.addQuantity = "";
|
|
// getSonList({ stockWaitId: formData.value.id }, index);
|
|
// getSonList({ stockWaitId: formData.value.id }, index);
|
|
- getProductList();
|
|
|
|
|
|
+ getProductList(true);
|
|
return showSuccessToast("暂存成功");
|
|
return showSuccessToast("暂存成功");
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
@@ -289,7 +300,7 @@ const handleDeleteRow = (row, index) => {
|
|
const handleDelete = (row, index, sonRow) => {
|
|
const handleDelete = (row, index, sonRow) => {
|
|
proxy.post("/excessGoodsRegister/delete", { id: sonRow.id }).then((res) => {
|
|
proxy.post("/excessGoodsRegister/delete", { id: sonRow.id }).then((res) => {
|
|
// getSonList({ stockWaitId: formData.value.id }, index);
|
|
// getSonList({ stockWaitId: formData.value.id }, index);
|
|
- getProductList();
|
|
|
|
|
|
+ getProductList(true);
|
|
return showSuccessToast("删除成功");
|
|
return showSuccessToast("删除成功");
|
|
});
|
|
});
|
|
};
|
|
};
|