|
@@ -9,11 +9,12 @@
|
|
|
<van-tab title="基本信息" :name="1" />
|
|
|
</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" ref="formDom">
|
|
|
<van-cell-group inset v-show="active==1">
|
|
|
<van-field v-model="formData.businessTypeName" readonly :label="$t('waitInbound.dataSource')" />
|
|
|
<van-field v-model="formData.businessCode" readonly label="入库单号" />
|
|
|
<van-field v-model="formData.code" readonly label="物流信息" />
|
|
|
+ <van-field v-model="formData.subCode" readonly label="物流副单号" />
|
|
|
<van-field v-model="formData.warehouseName" is-link label="仓库名称" readonly :placeholder="'请选择仓库名称'" @click="typeModal = true"
|
|
|
:rules="[{ required: true, message: '请选择仓库名称'}]" required />
|
|
|
<van-field v-model="formData.arrivalRemark" label="到货物流备注" type="textarea" />
|
|
@@ -72,7 +73,8 @@
|
|
|
</div>
|
|
|
<div v-show="row.isArrow" style="margin-top:5px;margin-bottom:10px">
|
|
|
<div style="display:flex;margin-bottom:8px ;align-items:center">
|
|
|
- <van-field v-model="row.addQuantity" type="digit" label="" placeholder="请输入临时清点数量" style="background-color:#f7f7f7;" />
|
|
|
+ <van-field v-model="row.addQuantity" type="digit" label="" placeholder="请输入临时清点数量" 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>
|
|
|
</div>
|
|
|
<div>
|
|
@@ -142,7 +144,8 @@
|
|
|
</div>
|
|
|
<div v-show="row.isArrow" style="margin-top:5px;margin-bottom:10px">
|
|
|
<div style="display:flex;margin-bottom:8px ;align-items:center">
|
|
|
- <van-field v-model="row.addQuantity" type="digit" label="" placeholder="请输入临时清点数量" style="background-color:#f7f7f7;" />
|
|
|
+ <van-field v-model="row.addQuantity" type="digit" label="" placeholder="请输入临时清点数量" 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>
|
|
|
</div>
|
|
|
<div>
|
|
@@ -181,14 +184,12 @@
|
|
|
</table>
|
|
|
</div>
|
|
|
</van-cell-group>
|
|
|
-
|
|
|
- <div style="margin-top: 5px">
|
|
|
- <van-button round block type="primary" native-type="submit" style="height:30px">
|
|
|
- {{$t('common.submit')}}
|
|
|
- </van-button>
|
|
|
- </div>
|
|
|
-
|
|
|
</van-form>
|
|
|
+ <div style="margin-top: 5px">
|
|
|
+ <van-button round block type="primary" style="height:30px" @click="onSubmit">
|
|
|
+ {{$t('common.submit')}}
|
|
|
+ </van-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -232,22 +233,29 @@ const onConfirm = ({ selectedOptions }) => {
|
|
|
};
|
|
|
|
|
|
const onClickLeft = () => history.back();
|
|
|
-
|
|
|
+const formDom = ref(null);
|
|
|
const onSubmit = () => {
|
|
|
- const list = formData.value.stockWaitDetailsList;
|
|
|
- const total = list.reduce((total, x) => (total += Number(x.quantity)), 0);
|
|
|
- if (!(total > 0)) {
|
|
|
- return showFailToast("清点累计不能为0");
|
|
|
- }
|
|
|
- proxy.post("/stockWait/addByWdly", formData.value).then(
|
|
|
+ formDom.value.validate().then(
|
|
|
(res) => {
|
|
|
- setTimeout(() => {
|
|
|
- showSuccessToast(proxy.$t("manualInbound.warehousingSuccess"));
|
|
|
- proxy.$router.push("/main/waitInbound");
|
|
|
- }, 500);
|
|
|
+ const list = formData.value.stockWaitDetailsList;
|
|
|
+ const total = list.reduce((total, x) => (total += Number(x.quantity)), 0);
|
|
|
+ if (!(total > 0)) {
|
|
|
+ return showFailToast("清点累计不能为0");
|
|
|
+ }
|
|
|
+ proxy.post("/stockWait/addByWdly", formData.value).then(
|
|
|
+ (res) => {
|
|
|
+ showSuccessToast("操作成功");
|
|
|
+ setTimeout(() => {
|
|
|
+ proxy.$router.push("/main/waitInbound");
|
|
|
+ }, 500);
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ return showFailToast(err.message);
|
|
|
+ }
|
|
|
+ );
|
|
|
},
|
|
|
(err) => {
|
|
|
- return showFailToast(err.message);
|
|
|
+ return showFailToast("数据未填完整");
|
|
|
}
|
|
|
);
|
|
|
};
|
|
@@ -282,6 +290,7 @@ onMounted(() => {
|
|
|
),
|
|
|
warehouseId: "",
|
|
|
code: json.logisticsCompanyName + "( " + json.code + " )",
|
|
|
+ subCode: json.subCode,
|
|
|
stockWaitDetailsList: res.stockWaitDetailsList.map((x) => ({
|
|
|
...x,
|
|
|
arrivalQuantity: x.quantity,
|