|
@@ -70,6 +70,17 @@ export default {
|
|
|
remark: "",
|
|
|
changeProductList: [],
|
|
|
},
|
|
|
+ openOne: false,
|
|
|
+ formOne: {},
|
|
|
+ rules: {
|
|
|
+ inQuantity: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请输入接收数量",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -154,15 +165,25 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
handleReceive(row) {
|
|
|
- this.$confirm("是否确认接收 ?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }).then(() => {
|
|
|
- API.receive({ id: row.id, inQuantity: row.outQuantity }).then(() => {
|
|
|
- this.msgSuccess("接收成功");
|
|
|
- this.getList();
|
|
|
- });
|
|
|
+ this.openOne = true;
|
|
|
+ this.formOne = {
|
|
|
+ id: row.id,
|
|
|
+ inQuantity: "",
|
|
|
+ canSum: Number(row.outQuantity),
|
|
|
+ };
|
|
|
+ },
|
|
|
+ handleSubmitOne() {
|
|
|
+ this.$refs.formOne.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if (Number(this.formOne.inQuantity) > this.formOne.canSum) {
|
|
|
+ return this.msgInfo("数量不可大于调出数量");
|
|
|
+ }
|
|
|
+ API.receive(this.formOne).then(() => {
|
|
|
+ this.msgSuccess("接收成功");
|
|
|
+ this.openOne = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
|
|
@@ -259,7 +280,9 @@ export default {
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
type="text"
|
|
|
- v-if="scope.row.inStatus === 0"
|
|
|
+ v-if="
|
|
|
+ scope.row.inStatus === 0 && Number(scope.row.outQuantity) > 0
|
|
|
+ "
|
|
|
@click="handleReceive(scope.row)"
|
|
|
>接收
|
|
|
</el-button>
|
|
@@ -291,6 +314,40 @@ export default {
|
|
|
ref="sendTransfer"
|
|
|
></send-transfer>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ title="接收"
|
|
|
+ :visible.sync="openOne"
|
|
|
+ v-if="openOne"
|
|
|
+ width="30%"
|
|
|
+ top="20vh"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ ref="formOne"
|
|
|
+ :model="formOne"
|
|
|
+ :rules="rules"
|
|
|
+ label-width="100px"
|
|
|
+ label-position="right"
|
|
|
+ >
|
|
|
+ <el-form-item label="调出数量" prop="canSum">
|
|
|
+ <el-input v-model="formOne.canSum" size="small" disabled> </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="接收数量" prop="inQuantity">
|
|
|
+ <el-input
|
|
|
+ v-model="formOne.inQuantity"
|
|
|
+ placeholder="请输入接收数量"
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div style="text-align: center; margin-top: 15px">
|
|
|
+ <el-button size="small" @click="openOne = false">取消 </el-button>
|
|
|
+ <el-button type="primary" size="small" @click="handleSubmitOne">
|
|
|
+ 确定</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|