|
@@ -87,8 +87,67 @@
|
|
|
@click="bindProcess(row)"
|
|
|
>绑定</el-button
|
|
|
>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ link
|
|
|
+ icon="el-icon-link"
|
|
|
+ @click="toGroup(row)"
|
|
|
+ >工序分组</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
+
|
|
|
+ <el-drawer v-model="drawer" title="I am the title" :with-header="false">
|
|
|
+ <el-descriptions title="工序分组">
|
|
|
+ <el-descriptions-item>同一个分组,排产将排到同个工位上</el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ <el-divider />
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-input
|
|
|
+ v-model="input3"
|
|
|
+ clearable
|
|
|
+ placeholder="请输入分组名称"
|
|
|
+ style="width: 70%"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <el-button @click="addGroup" type="primary">添加分组</el-button>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+ <el-form v-model="groups" label-width="auto" style="max-width: 600px;margin-top: 15px;">
|
|
|
+ <el-form-item v-for="(item,index) in groups" :label="item.group">
|
|
|
+ <el-select
|
|
|
+ v-model="item.list"
|
|
|
+ multiple
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ placeholder="Select"
|
|
|
+ style="width: 240px"
|
|
|
+ >
|
|
|
+<!-- <template #header>
|
|
|
+ <el-checkbox v-model="checked" @change="selectAll(key)"
|
|
|
+ >全选</el-checkbox
|
|
|
+ >
|
|
|
+ </template>-->
|
|
|
+ <el-option
|
|
|
+ v-for="item in routeOperations"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.operationName"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ <el-button type="danger" @click="delGroup(index)" text>删除</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="drawer = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="groupSave()"> 确定 </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-drawer>
|
|
|
<CommonTable
|
|
|
ref="ctableRef"
|
|
|
tableTitle="添加产品"
|
|
@@ -102,7 +161,7 @@
|
|
|
width="500"
|
|
|
align-center
|
|
|
>
|
|
|
- <el-form :model="tmpForm" label-width="auto" style="max-width: 800px">
|
|
|
+ <el-form :model="tmpForm" label-width="auto" style="max-width: 800px;">
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="工艺路线编号">
|
|
@@ -131,29 +190,47 @@ import { ref, getCurrentInstance } from "vue";
|
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
|
import dictDataUtil from "@/common/configs/dictDataUtil";
|
|
|
import { useDictionaryStore } from "@/store";
|
|
|
-import { copyRoute } from "@/api/craft/route/index";
|
|
|
+import { copyRoute,queryGroups,saveGroups } from "@/api/craft/route/index";
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
-import { syncAps } from "@/api/aps";
|
|
|
// 数据字典相关
|
|
|
const { dicts } = useDictionaryStore();
|
|
|
+const drawer = ref(false)
|
|
|
+const input3 = ref("");
|
|
|
+const groups = ref([{group: 'A',list: [1,2,3]}])
|
|
|
+const addGroup = () => {
|
|
|
+ if (!input3.value) {
|
|
|
+ ElMessage.error("请输入分组名称!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (groups.value.find(item => item.group === input3.value)) {
|
|
|
+ ElMessage.error("分组名称重复");
|
|
|
+ } else {
|
|
|
+ groups.value.push({group: input3.value,list: []})
|
|
|
+ input3.value = ""
|
|
|
+ }
|
|
|
+};
|
|
|
|
|
|
-const apsSync = () => {
|
|
|
- ElMessageBox.confirm("是否同步所选中数据?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }).then(async () => {
|
|
|
- let param = { type: 4, codes: toDeleteIds.value };
|
|
|
- syncAps(param).then((data) => {
|
|
|
- if (data.code === "200") {
|
|
|
- ElMessage.success(data.msg);
|
|
|
- } else {
|
|
|
- ElMessage.error(data.msg);
|
|
|
- }
|
|
|
+const delGroup = ((index)=>{
|
|
|
+ groups.value.splice(index,1)
|
|
|
+})
|
|
|
+const checked = ref(false);
|
|
|
+const selectAll = (key) => {
|
|
|
+ /*if (checked.value) {
|
|
|
+ groups.value[key] = [];
|
|
|
+ nodesData.value.map((item) => {
|
|
|
+ groupData.value[key].push(item.operationId);
|
|
|
});
|
|
|
- });
|
|
|
+ } else {
|
|
|
+ groupData.value[key] = [];
|
|
|
+ }*/
|
|
|
};
|
|
|
-
|
|
|
+const toGroup = ((row)=>{
|
|
|
+ queryGroups(row.id).then((res)=>{
|
|
|
+ drawer.value = true;
|
|
|
+ groups.value = res.data.groups;
|
|
|
+ routeOperations.value = res.data.operations;
|
|
|
+ })
|
|
|
+})
|
|
|
// 传入一个url,后面不带/
|
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
useCrud({
|
|
@@ -163,21 +240,14 @@ const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
Methords; //增删改查
|
|
|
const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
|
-// checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
|
|
|
-// const permission = reactive({
|
|
|
-// delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
|
|
|
-// addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
|
|
|
-// editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
|
|
|
-// menu: true,
|
|
|
-// });
|
|
|
let centerDialogVisible = ref(false);
|
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
const tmpForm = ref({});
|
|
|
-
|
|
|
onMounted(() => {
|
|
|
// console.log("crudRef", crudRef)
|
|
|
dataList();
|
|
|
});
|
|
|
+const routeOperations = ref([])
|
|
|
const doEdit = (row, index) => {
|
|
|
row.prodtName1 = row.prodtName;
|
|
|
crudRef.value && crudRef.value.rowEdit(row, index);
|
|
@@ -227,6 +297,16 @@ const copyRow = (row) => {
|
|
|
crudRef.value.rowAdd();
|
|
|
};
|
|
|
|
|
|
+const groupSave = () => {
|
|
|
+ if(!groups.value){
|
|
|
+ ElMessage.error("请设置分组信息")
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ saveGroups(groups.value).then((res)=>{
|
|
|
+ ElMessage.success(res.msg)
|
|
|
+ drawer.value = false
|
|
|
+ });
|
|
|
+};
|
|
|
const renameRoute = () => {
|
|
|
tmpForm.value.id;
|
|
|
tmpForm.value.processRouteCode;
|
|
@@ -253,6 +333,7 @@ const bindProcess = (row) => {
|
|
|
// 设置表格列或者其他自定义的option
|
|
|
option.value = Object.assign(option.value, {
|
|
|
selection: true,
|
|
|
+ viewBtn: false,
|
|
|
labelWidth: 100,
|
|
|
editBtn: false,
|
|
|
delBtn: false,
|