ysy 2 jaren geleden
bovenliggende
commit
648eca9273

+ 60 - 0
src/views/produceOrder/components/schedule-search.vue

@@ -0,0 +1,60 @@
+<!-- 搜索表单 -->
+<template>
+    <el-form label-width="77px" size="small" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
+        <el-row :gutter="10">
+            <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+                <el-form-item label="名称:">
+                    <el-input clearable size="small" v-model="where.name" placeholder="请输入排班组名称" />
+                </el-form-item>
+            </el-col>
+
+
+            <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+                <el-form-item>
+                    <el-button size="small" type="primary" icon="el-icon-search" class="ele-btn-icon" @click="search">
+                        查询
+                    </el-button>
+                    <el-button size="small" type="primary" icon="el-icon-refresh-left" class="ele-btn-icon" @click="reset">
+                        重置
+                    </el-button>
+                    <slot></slot>
+                </el-form-item>
+            </el-col>
+        </el-row>
+    </el-form>
+</template>
+  
+<script>
+export default {
+    data() {
+        // 默认表单数据
+        const defaultWhere = {
+            name: '',
+
+
+        };
+        return {
+            // 表单数据
+            where: { ...defaultWhere }
+        };
+    },
+    computed: {
+        // 是否开启响应式布局
+        styleResponsive() {
+            return this.$store.state.theme.styleResponsive;
+        }
+    },
+    methods: {
+        /* 搜索 */
+        search() {
+            this.$emit('search', this.where);
+        },
+        /*  重置 */
+        reset() {
+            this.where = { ...this.defaultWhere };
+            this.search();
+        }
+    }
+};
+</script>
+  

+ 42 - 8
src/views/produceOrder/components/scheduleDialog.vue

@@ -1,10 +1,20 @@
 <template>
 <template>
-    <el-dialog :title="title" :visible.sync="visible" v-if="visible" :before-close="handleClose"
-        :close-on-click-modal="false" :close-on-press-escape="false" append-to-body width="75%">
-        <el-card shadow="never">
+    <el-dialog title="选择排班" :visible.sync="visible" v-if="visible" :before-close="handleClose"
+        :close-on-click-modal="false" :close-on-press-escape="false" append-to-body width="60%">
+
+
 
 
+
+        <el-card shadow="never">
+            <scheduleSearch @search="reload"></scheduleSearch>
             <ele-pro-table ref="table" :columns="columns" :datasource="datasource" row-key="id" height="calc(100vh - 350px)"
             <ele-pro-table ref="table" :columns="columns" :datasource="datasource" row-key="id" height="calc(100vh - 350px)"
                 class="dict-table" @cell-click="cellClick">
                 class="dict-table" @cell-click="cellClick">
+
+
+                <template v-slot:status="{ row }">
+                    {{ row.status == 1 ? '发布' : '草稿' }}
+                </template>
+
                 <!-- 表头工具栏 -->
                 <!-- 表头工具栏 -->
                 <template v-slot:action="{ row }">
                 <template v-slot:action="{ row }">
                     <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
                     <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
@@ -23,8 +33,11 @@
 import {
 import {
     teamqueuepage,
     teamqueuepage,
 } from '@/api/workforceManagement/schedule';
 } from '@/api/workforceManagement/schedule';
+import scheduleSearch from './schedule-search.vue'
 export default {
 export default {
-    components: {},
+    components: {
+        scheduleSearch
+    },
     data() {
     data() {
         return {
         return {
             visible: false,
             visible: false,
@@ -63,8 +76,9 @@ export default {
                     label: '选择'
                     label: '选择'
                 }
                 }
             ],
             ],
-            title: null,
-            categoryLevelId: null,
+
+
+            type: null,
             radio: null,
             radio: null,
             idx: null,
             idx: null,
 
 
@@ -75,11 +89,20 @@ export default {
     watch: {
     watch: {
 
 
     },
     },
+
+    computed: {
+        // 是否开启响应式布局
+        styleResponsive() {
+            return this.$store.state.theme.styleResponsive;
+        }
+    },
+
     methods: {
     methods: {
         /* 表格数据源 */
         /* 表格数据源 */
         datasource({ page, where, limit }) {
         datasource({ page, where, limit }) {
             let data = teamqueuepage({
             let data = teamqueuepage({
                 ...where,
                 ...where,
+                // status: 1,
                 pageNum: page,
                 pageNum: page,
                 size: limit
                 size: limit
             });
             });
@@ -89,10 +112,20 @@ export default {
 
 
         /* 刷新表格 */
         /* 刷新表格 */
         reload(where) {
         reload(where) {
-            this.isCategory = false
             this.$refs.table.reload({ pageNum: 1, where: where });
             this.$refs.table.reload({ pageNum: 1, where: where });
         },
         },
         open(item, type, idx) {
         open(item, type, idx) {
+            this.type = type
+            this.idx = idx
+            if (item) {
+                this.current = {
+                    id: item.classeId,
+                    name: item.classeName,
+                }
+
+                this.radio = item.classeId
+            }
+
             this.visible = true
             this.visible = true
         },
         },
 
 
@@ -100,6 +133,7 @@ export default {
 
 
 
 
 
 
+
         // 单击获取id
         // 单击获取id
         cellClick(row) {
         cellClick(row) {
             this.current = row
             this.current = row
@@ -114,7 +148,7 @@ export default {
             if (!this.current) {
             if (!this.current) {
                 return this.$message.warning('请选择排班组')
                 return this.$message.warning('请选择排班组')
             }
             }
-            this.$emit('changeProduct', this.title, this.current, this.idx)
+            this.$emit('changeProduct', this.current, this.type, this.idx)
             this.handleClose()
             this.handleClose()
         },
         },
     }
     }

+ 21 - 8
src/views/produceOrder/components/unpackDialog.vue

@@ -74,8 +74,9 @@
               message: '请选择排班',
               message: '请选择排班',
               trigger: 'change'
               trigger: 'change'
             }">
             }">
-           
-           <el-input readonly v-model="scope.row.classeName" @click.native="openClasse(scope.row, 1, scope.$index)"></el-input>
+
+              <el-input readonly v-model="scope.row.classeName"
+                @click.native="openClasse(scope.row, 1, scope.$index)"></el-input>
             </el-form-item>
             </el-form-item>
           </template>
           </template>
 
 
@@ -122,8 +123,9 @@
               message: '请选择排班',
               message: '请选择排班',
               trigger: 'change'
               trigger: 'change'
             }]">
             }]">
-           
-           <el-input readonly v-model="scope.row.classeName" @click.native="openClasse(scope.row, 2, scope.$index)"></el-input>
+
+              <el-input readonly v-model="scope.row.classeName"
+                @click.native="openClasse(scope.row, 2, scope.$index)"></el-input>
 
 
             </el-form-item>
             </el-form-item>
           </template>
           </template>
@@ -148,7 +150,7 @@
 
 
       </el-form>
       </el-form>
 
 
-      <scheduleDialog ref="scheduleRef"></scheduleDialog>
+      <scheduleDialog ref="scheduleRef" @changeProduct="changeProduct"></scheduleDialog>
 
 
     </div>
     </div>
     <div slot="footer">
     <div slot="footer">
@@ -331,11 +333,22 @@ export default {
     },
     },
 
 
 
 
-    openClasse(row,type, idx) {
-        this.$refs.scheduleRef.open(row,type,idx)
+    openClasse(row, type, idx) {
+      this.$refs.scheduleRef.open(row, type, idx)
     },
     },
-    confirm() {
 
 
+    changeProduct(list, type, idx) {
+
+      if (type == 1) {
+        this.$set(this.form.surplusUnpack[idx], 'classeId', list.id)
+        this.$set(this.form.surplusUnpack[idx], 'classeName', list.name)
+      } else if (type == 2) {
+        this.$set(this.form.unpackList[idx], 'classeId', list.id)
+        this.$set(this.form.unpackList[idx], 'classeName', list.name)
+      }
+
+    },
+    confirm() {
 
 
       this.$refs.form.validate(async (value) => {
       this.$refs.form.validate(async (value) => {
         if (value) {
         if (value) {