20250516修改
This commit is contained in:
parent
6b978fa93b
commit
27e5cc3524
@ -41,7 +41,7 @@
|
||||
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun
|
||||
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.67:8080/pms-am'; // wenzhang
|
||||
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao
|
||||
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv
|
||||
window.SITE_CONFIG['apiURL'] = 'http://172.16.33.89:8080/pms-am'; // xv
|
||||
// window.SITE_CONFIG['apiURL'] = 'http://localhost:3000/p//////ms-am'; // xv
|
||||
</script>
|
||||
<% } %>
|
||||
|
166
src/views/modules/pms/blenderBatch/components/BulkEdit.vue
Normal file
166
src/views/modules/pms/blenderBatch/components/BulkEdit.vue
Normal file
@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="dialog-just-form"
|
||||
:visible="dialogVisible"
|
||||
@close="handleClose"
|
||||
:close-on-click-modal="false"
|
||||
width="'50%'">
|
||||
<!-- title -->
|
||||
<div slot="title" class="dialog-title">
|
||||
<h1 class="">批量编辑</h1>
|
||||
</div>
|
||||
|
||||
<!-- form -->
|
||||
<el-form ref="dataForm" :model="dataForm" :rules="rules" v-loading="loading">
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="配方" prop="bomid">
|
||||
<el-select
|
||||
v-model="dataForm.bomid"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择版本">
|
||||
<el-option v-for="(bom) in bomList" :key="bom.value" :label="bom.label" :value="bom.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-form-item label="重量" prop="batchSize">
|
||||
<el-input v-model="dataForm.batchSize" clearable placeholder="请输入重量"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<!-- footer -->
|
||||
<div slot="footer">
|
||||
<el-button type="primary" @click="handleBtnClick('保存')" :loading="btnLoading">保存</el-button>
|
||||
<el-button @click="handleBtnClick('取消')">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "BulkBomEdit",
|
||||
components: {},
|
||||
props: {
|
||||
blenderOrderId: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
dataForm: {
|
||||
bomid: null,
|
||||
batchSize: null
|
||||
},
|
||||
rules: {
|
||||
bomid: { required: true, message: "配方不能为空", trigger: "blur" },
|
||||
batchSize: [
|
||||
{ required: true, message: "重量不能为空", trigger: "blur" },
|
||||
{ type: "number", message: "重量必须为数字", trigger: "blur", transform: (value) => Number(value) },
|
||||
],
|
||||
},
|
||||
bomList: [],
|
||||
btnLoading: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
blenderOrderId: {
|
||||
handler(val) {},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 初始化
|
||||
init() {
|
||||
this.getBomList();
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
// 获得混料订单的同配方号配方所有版本
|
||||
async getBomList() {
|
||||
this.loading = true;
|
||||
const { data: res } = await this.$http.post("/pms/blenderBatch/getBomsByBOrder", {
|
||||
blenderOrderId: this.blenderOrderId,
|
||||
});
|
||||
this.loading = false;
|
||||
if (res.code == 0) {
|
||||
this.bomList = res.data.list.map((item) => {
|
||||
return {
|
||||
label: item.version,
|
||||
value: item.id,
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 按钮事件
|
||||
handleBtnClick(type) {
|
||||
switch (type) {
|
||||
case "保存":
|
||||
this.$refs.dataForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('确定批量编辑配方吗?', "提示", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "我再想想",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
this.btnLoading = true;
|
||||
this.$http.put("/pms/blenderBatch/updateBatchs", {
|
||||
blenderOrderId: this.blenderOrderId,
|
||||
bomId: this.dataForm.bomid,
|
||||
batchSize: this.dataForm.batchSize
|
||||
}).then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
this.$message.success(type + "成功");
|
||||
this.handleClose(true);
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
this.btnLoading = false;
|
||||
}).catch((err) => {})
|
||||
}).catch((err) => {});
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "取消":
|
||||
this.handleClose();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleClose(refresh = false) {
|
||||
this.dialogVisible = false;
|
||||
setTimeout(() => {
|
||||
this.$emit("destroy", refresh);
|
||||
}, 500);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog-just-form >>> .el-dialog__body {
|
||||
/* padding-top: 16px !important;
|
||||
padding-bottom: 16px !important; */
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.el-select,
|
||||
.el-cascader,
|
||||
.el-date-editor {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.dialog-just-form >>> .el-dialog__header {
|
||||
padding: 10px 20px 10px;
|
||||
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
|
||||
}
|
||||
</style>
|
@ -27,6 +27,7 @@
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
|
||||
<edit ref="edit" v-if="dialogVisible" :blenderOrderId="blenderOrderId" @destroy="handleDestroy('edit', $event)" />
|
||||
<bulk-edit ref="bulkEdit" v-if="dialogVisibleEdit" :blenderOrderId="blenderOrderId" @destroy="handleDestroy('bulkEdit', $event)" />
|
||||
<Overlay v-if="overlayVisible" />
|
||||
</div>
|
||||
</template>
|
||||
@ -36,6 +37,7 @@ import BaseListTable from "@/components/BaseListTable.vue";
|
||||
import BaseSearchForm from "@/components/BaseSearchForm.vue";
|
||||
import DialogJustForm from "./DialogJustForm.vue";
|
||||
import edit from "./edit.vue";
|
||||
import BulkEdit from "./BulkEdit.vue";
|
||||
import Overlay from "@/components/Overlay.vue";
|
||||
import moment from "moment";
|
||||
|
||||
@ -46,6 +48,7 @@ export default {
|
||||
BaseListTable,
|
||||
DialogJustForm,
|
||||
edit,
|
||||
BulkEdit,
|
||||
Overlay,
|
||||
},
|
||||
props: {
|
||||
@ -122,6 +125,7 @@ export default {
|
||||
return {
|
||||
editVisible: false,
|
||||
dialogVisible: false,
|
||||
dialogVisibleEdit: false,
|
||||
topBtnConfig: null,
|
||||
totalPage: 0,
|
||||
page: 1,
|
||||
@ -152,6 +156,12 @@ export default {
|
||||
this.getList();
|
||||
}
|
||||
break;
|
||||
case "bulkEdit":
|
||||
this.dialogVisibleEdit = false;
|
||||
if (refresh) {
|
||||
this.getList();
|
||||
}
|
||||
break;
|
||||
case "detail":
|
||||
this.dialogVisible = false;
|
||||
break;
|
||||
@ -329,6 +339,9 @@ export default {
|
||||
case "新增":
|
||||
this.openDialog();
|
||||
break;
|
||||
case "批量编辑":
|
||||
this.openDialogEdit();
|
||||
break;
|
||||
case "导入":
|
||||
this.openUploadDialog();
|
||||
break;
|
||||
@ -414,6 +427,13 @@ export default {
|
||||
this.$refs["edit"].init(row_id, detail_mode);
|
||||
});
|
||||
},
|
||||
// 批量编辑
|
||||
openDialogEdit() {
|
||||
this.dialogVisibleEdit = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["bulkEdit"].init();
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -66,10 +66,23 @@ export default function () {
|
||||
},
|
||||
{
|
||||
button: {
|
||||
type: "plain",
|
||||
type: "primary",
|
||||
name: "新增",
|
||||
permission: "",
|
||||
permission :''
|
||||
},
|
||||
bind: {
|
||||
plain: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
button: {
|
||||
type: "success",
|
||||
name: "批量编辑",
|
||||
permission :''
|
||||
},
|
||||
bind: {
|
||||
plain: true,
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -153,10 +153,20 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="Add on" prop="sapParam1" :rules="null">
|
||||
<el-input
|
||||
<el-select
|
||||
v-model="dataForm.sapParam1"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="mode.includes('detail')"
|
||||
v-bind="{ placeholder: '输入addon' }"></el-input>
|
||||
v-bind="{ placeholder: '请选择addon' }">
|
||||
<el-option
|
||||
v-for="opt in dictList.addon"
|
||||
:key="opt.dictLabel + opt.dictValue"
|
||||
:label="opt.dictLabel"
|
||||
:value="opt.dictLabel">
|
||||
<span>{{ opt.dictLabel }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -546,7 +556,6 @@ import { pick as __pick } from "@/utils/filters";
|
||||
// import moment from "moment";
|
||||
import InputsArea from "./InputsArea.vue";
|
||||
import { getDictDataList } from "@/utils";
|
||||
|
||||
export default {
|
||||
name: "DialogJustForm",
|
||||
components: { InputsArea },
|
||||
@ -695,6 +704,7 @@ export default {
|
||||
promiseList: [],
|
||||
bomId: null,
|
||||
btnLoading: false,
|
||||
dictList:JSON.parse(localStorage.getItem("dictList") || {})
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -28,7 +28,7 @@ module.exports = {
|
||||
},
|
||||
proxy: {
|
||||
'/pms-am/ureport/preview': {
|
||||
target: 'http://192.168.1.62:8080/' // TODO: 线上发布时需修改此处
|
||||
target: 'http://172.16.33.89:8080/' // TODO: 线上发布时需修改此处
|
||||
},
|
||||
// '/pms/order/importExcelOrder': {
|
||||
// target: 'http://192.168.1.21:8080/' // TODO: 线上发布时需修改此处
|
||||
|
Loading…
Reference in New Issue
Block a user