|
|
|
@ -464,6 +464,27 @@
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="选择库存类型"
|
|
|
|
|
:visible.sync="dialogVisible"
|
|
|
|
|
@close="resetForm"
|
|
|
|
|
>
|
|
|
|
|
<el-form>
|
|
|
|
|
<el-form-item label="库存类型" required>
|
|
|
|
|
<el-select v-model="selectedType" placeholder="请选择库存类型">
|
|
|
|
|
<el-option label="质检" value="2"></el-option>
|
|
|
|
|
<el-option label="冻结" value="3"></el-option>
|
|
|
|
|
<el-option label="非限制" value="1"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="dialogVisible = false">取消</el-button>
|
|
|
|
|
<el-button type="primary" @click="confirmSelection">确认</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -488,6 +509,8 @@ export default {
|
|
|
|
|
total: 0,
|
|
|
|
|
// 成品生产入库表格数据
|
|
|
|
|
putList: [],
|
|
|
|
|
dialogVisible: false, // 控制对话框的显示与隐藏
|
|
|
|
|
selectedType: '', // 存储用户选择的库存类型
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
@ -616,18 +639,55 @@ export default {
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "添加成品生产入库";
|
|
|
|
|
},
|
|
|
|
|
/** 过账按钮操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
// /** 过账按钮操作 */
|
|
|
|
|
// handleUpdate(row) {
|
|
|
|
|
// const ids = row.id || this.ids;
|
|
|
|
|
// let postData = this.ids.map(id => ({ id: id }));
|
|
|
|
|
// console.log(postData)
|
|
|
|
|
// this.$modal.confirm('是否进行过账').then(function() {
|
|
|
|
|
// return SAPPut(JSON.stringify(postData));
|
|
|
|
|
// }).then(() => {
|
|
|
|
|
// this.getList();
|
|
|
|
|
// this.$modal.msgSuccess("过账完成");
|
|
|
|
|
// }).catch(() => {});
|
|
|
|
|
// },
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
// 确保 ids 是数组
|
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
|
let postData = this.ids.map(id => ({ id: id }));
|
|
|
|
|
console.log(postData)
|
|
|
|
|
this.$modal.confirm('是否进行过账').then(function() {
|
|
|
|
|
return SAPPut(JSON.stringify(postData));
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("过账完成");
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 检查是否有可过账的记录
|
|
|
|
|
if (!this.ids || this.ids.length === 0) {
|
|
|
|
|
this.$message.error("没有可过账的记录");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 打开对话框
|
|
|
|
|
this.dialogVisible = true;
|
|
|
|
|
},
|
|
|
|
|
confirmSelection() {
|
|
|
|
|
if (!this.selectedType) {
|
|
|
|
|
this.$message.error("请选择库存类型");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 构造请求数据
|
|
|
|
|
const postData = this.ids.map(id => ({ id: id, attr3: this.selectedType }));
|
|
|
|
|
|
|
|
|
|
// 发送请求
|
|
|
|
|
SAPPut(JSON.stringify(postData))
|
|
|
|
|
.then(() => {
|
|
|
|
|
this.getList(); // 更新列表
|
|
|
|
|
this.$message.success("过账完成");
|
|
|
|
|
this.resetForm(); // 重置表单
|
|
|
|
|
this.dialogVisible = false; // 关闭对话框
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
this.$message.error("过账失败: " + error.message);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
resetForm() {
|
|
|
|
|
this.selectedType = ''; // 重置选择
|
|
|
|
|
},
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
handleUpdateKEN(row) {
|
|
|
|
|
this.reset();
|
|
|
|
|