LAPTOP-16IUEB3P\Lenovo 2 лет назад
Родитель
Сommit
381a1b5db6

+ 1 - 1
src/views/material/manage/components/GroupDialog.vue

@@ -26,7 +26,7 @@
             </el-table-column>
             <el-table-column label="选择" align="center">
                <template slot-scope="scope">
-            	 <el-radio class="radio" v-model="radio" :label="scope.row.id"><i></i></el-radio>
+            	   <el-radio class="radio" v-model="radio" :label="scope.row.id"><i></i></el-radio>
                </template>
             </el-table-column>
           </el-table>

+ 185 - 0
src/views/technology/route/components/ProductModal.vue

@@ -0,0 +1,185 @@
+<template>
+  <el-dialog
+    title="选择产品"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="80%"
+  >
+    <el-card shadow="never">
+      <ProductSearch @search="reload" />
+      <ele-split-layout
+        width="244px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div class="ele-border-lighter split-layout-right-content">
+          <AssetTree
+            ref="assetTreeRef"
+            id="9"
+            @handleNodeClick="handleNodeClick"
+          />
+        </div>
+        <!-- 表格 -->
+        <template v-slot:content>
+          <ele-pro-table
+            ref="table"
+            :columns="columns"
+            :datasource="datasource"
+            height="calc(100vh - 350px)"
+            :need-page="false"
+            class="dict-table"
+            @cell-click="cellClick"
+          >
+            <!-- 表头工具栏 -->
+            <template v-slot:action="{ row }">
+              <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+ import AssetTree from '@/components/AssetTree';
+ import ProductSearch from './product-search.vue'
+ import { getList } from '@/api/classifyManage/itemInformation';
+export default {
+   components: { AssetTree, ProductSearch },
+  data () {
+    return {
+      visible: false,
+      // 表格列配置
+      columns: [
+        {
+          columnKey: 'index',
+          type: 'index',
+          width: 45,
+          align: 'center',
+          reserveSelection: true
+        },
+        {
+          prop: 'code',
+          label: '产品编码'
+        },
+        {
+          prop: 'name',
+          label: '产品名称',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'brandNum',
+          label: '牌号'
+        },
+        {
+          prop: 'modelType',
+          label: '型号'
+        },
+        {
+          prop: 'measuringUnit',
+          label: '计量单位'
+        },
+        {
+          prop: 'packingUnit',
+          label: '包装单位'
+        },
+        {
+          action: 'action',
+          slot: 'action',
+          align: 'center',
+          label: '选择'
+        }
+      ],
+      categoryLevelId: '9',
+      radio:null
+    }
+  },
+
+  watch: {
+
+  },
+  methods: {
+    /* 表格数据源 */
+    datasource ({ page, where, limit }) {
+      return getList({
+        ...where,
+        pageNum: page,
+        size: limit,
+        categoryLevelId: this.categoryLevelId
+      });
+    },
+    handleNodeClick (data) {
+      this.categoryLevelId = data.id;
+      this.reload();
+    },
+    /* 刷新表格 */
+    reload () {
+      this.$refs.table.reload();
+    },
+    open(item){
+      if(item){
+        this.current = {
+          id:item.categoryId,
+          name: item.categoryName,
+          code:item.categoryCode
+        }
+        this.radio = item.categoryId
+      }
+      this.visible = true
+    },
+
+    // 单击获取id
+    cellClick (row) {
+        this.current = row
+        this.radio = row.id
+    },
+    handleClose () {
+      this.visible = false
+      this.current = null
+      this.radio = ''
+    },
+    selected(){
+       if(!this.current){
+         return this.$message.warning('请选择工作中心')
+       }
+       this.$emit('changeProduct',this.current)
+       this.handleClose()
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.tree_col {
+  border: 1px solid #eee;
+  padding: 10px 0;
+  box-sizing: border-box;
+  height: 500px;
+  overflow: auto;
+}
+.table_col {
+  padding-left: 10px;
+  ::v-deep .el-table th.el-table__cell {
+    background: #f2f2f2;
+  }
+}
+.pagination {
+  text-align: right;
+  padding: 10px 0;
+}
+.btns {
+  text-align: center;
+  padding: 10px 0;
+}
+.topsearch{
+	margin-bottom:15px;
+}
+</style>

+ 103 - 0
src/views/technology/route/components/product-search.vue

@@ -0,0 +1,103 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="77px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="10">
+      <el-col v-bind="styleResponsive ? { md: 8 } : { span: 8 }">
+        <el-form-item label="产品编码">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 8 } : { span: 8 }">
+        <el-form-item label="产品名称">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 8 } : { span: 8 }">
+        <el-form-item label="牌号">
+          <el-input clearable v-model="where.brandNum" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 8 } : { span: 8 }">
+        <el-form-item label="型号">
+          <el-input clearable v-model="where.modelType" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 8 } : { span: 8 }">
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+
+          <el-button
+            @click="reset"
+            icon="el-icon-refresh"
+            class="ele-btn-icon"
+            size="medium"
+            >重置</el-button
+          >
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data () {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        code: '',
+        brandNum: '',
+        modelType: ''
+      };
+      return {
+        defaultWhere,
+        // 表单数据
+        where: { ...defaultWhere },
+        treeData:[]
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive () {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created() {
+    },
+    methods: {
+
+      /* 搜索 */
+      search () {
+        if (this.where.appType === 0) {
+          this.where.appType = '';
+        }
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset () {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>
+
+<style>
+  .ele-form-actions {
+    display: inline-block;
+    transform: translate(0);
+    transition: all;
+  }
+</style>

+ 169 - 0
src/views/technology/route/components/production/components/WorkCenter.vue

@@ -0,0 +1,169 @@
+<template>
+  <el-dialog
+    title="选择工作中心"
+    :visible.sync="centerVisible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="60%"
+  >
+    <div>
+      <el-row>
+        <el-col :span="24" class="table_col">
+          <el-table
+            :data="tableData"
+            height="450"
+            highlight-current-row
+            @row-click="single"
+          >
+            <el-table-column label="工作中心编码" prop="code" width="200"></el-table-column>
+            <el-table-column label="工作中心名称" prop="name"></el-table-column>
+            <el-table-column label="工作中心类别" prop="categoryType">
+               <template slot-scope="scope">
+                 {{ checkcategoryType(scope.row.categoryType) }}
+               </template>
+            </el-table-column>
+            <el-table-column label="负责人" prop="leaderUserName">
+            </el-table-column>
+            <el-table-column label="选择" align="center">
+               <template slot-scope="scope">
+            	 <el-radio class="radio" v-model="radio" :label="scope.row.id"><i></i></el-radio>
+               </template>
+            </el-table-column>
+          </el-table>
+         <div class="pagination">
+            <el-pagination
+              background
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="total"
+              :page-sizes="[10, 20, 50, 100]"
+              :page-size="pagination.size"
+              :current-page.sync="pagination.pageNum"
+              @current-change="handleCurrent"
+              @size-change="handleSize"
+            >
+            </el-pagination>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+ import work from '@/api/technology/work';
+export default {
+  data () {
+    return {
+      centerVisible: false,
+      tableData: [],
+      search:{},
+      pagination: {
+        pageNum: 1,
+        size: 10,
+      },
+      total: 0,
+      radio: '',
+      current:null,
+      categoryTypes: [
+        { label: '设备', value: 0 },
+        { label: '设备组', value: 1 },
+        { label: '人工', value: 2 },
+        { label: '人工组', value: 3 },
+        { label: '生产线', value: 4 },
+        { label: '委外生产', value: 5 }
+      ],
+    }
+  },
+
+  watch: {
+
+  },
+  methods: {
+    open(item){
+      if(item){
+        this.current = {
+          id:item.workCenterId,
+          name: item.workCenterName
+        }
+        this.radio = item.workCenterId
+      }
+      this.centerVisible = true
+      this.getList()
+    },
+
+    // 单击获取id
+    single (row) {
+        this.current = row
+        this.radio = row.id
+    },
+
+    handleClose () {
+      this.centerVisible = false
+      this.current = null
+      this.radio = ''
+    },
+    handleCurrent (page) {
+      this.pagination.pageNum = page
+      this.getList()
+    },
+    handleSize (size) {
+      this.pagination.pageNum = 1
+      this.pagination.size = size
+      this.getList()
+    },
+    getList(){
+      let params = {...this.pagination}
+      work.list(params).then(res=>{
+         this.tableData = res.list
+         this.total = res.count
+      })
+    },
+    selected(){
+       if(!this.current){
+         return this.$message.warning('请选择工作中心')
+       }
+       this.$emit('changeCenter',this.current)
+       this.handleClose()
+    },
+
+    /*回显类别 */
+    checkcategoryType (value) {
+      return this.categoryTypes.find((f) => f.value == value).label;
+    },
+
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.tree_col {
+  border: 1px solid #eee;
+  padding: 10px 0;
+  box-sizing: border-box;
+  height: 500px;
+  overflow: auto;
+}
+.table_col {
+  padding-left: 10px;
+  ::v-deep .el-table th.el-table__cell {
+    background: #f2f2f2;
+  }
+}
+.pagination {
+  text-align: right;
+  padding: 10px 0;
+}
+.btns {
+  text-align: center;
+  padding: 10px 0;
+}
+.topsearch{
+	margin-bottom:15px;
+}
+</style>

+ 39 - 9
src/views/technology/route/components/production/components/user-edit.vue

@@ -30,12 +30,20 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="控制码:" prop="controlId">
-            <el-input v-model="form.controlId" placeholder="请输入" />
+            <el-select v-model="form.controlId" @change="chooseControl">
+              <el-option
+                v-for="item in controlList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item label="工作中心:" prop="workCenterId">
-            <el-input placeholder="请输入" v-model="form.workCenterId" />
+          <el-form-item label="工作中心:" prop="workCenterName">
+             <el-input @click.native="chooseWorkCenter" v-model="form.workCenterName" readonly/>
           </el-form-item>
         </el-col>
         <el-col :span="8">
@@ -163,17 +171,22 @@
         保存
       </el-button>
     </template>
+
+    <!-- 工作中心弹窗 -->
+    <WorkCenter ref="centerRefs" @changeCenter='determineChoose'/>
   </ele-modal>
 </template>
 
 <script>
   import producetask from '@/api/technology/production';
+  import WorkCenter from './WorkCenter.vue';
   const defaultForm = {
     id: null,
     code: '',
     name: '',
     controlId: '',
     workCenterId: '',
+    workCenterName:'',
     timeUnit: '',
     intervalTime: {
       nextShortPreTime: '', // 时间单位转换后的下一个短周期的时间,格式为YYYY-MM-DDTHH'
@@ -195,11 +208,15 @@
   };
 
   export default {
+    components:{
+       WorkCenter
+    },
     props: {
       // 弹窗是否打开
       visible: Boolean,
       // 修改回显的数据
-      data: Object
+      data: Object,
+      controlList:Array
     },
     data() {
       return {
@@ -224,8 +241,8 @@
           controlId: [
             { required: true, message: '请选择控制码', trigger: 'blur' }
           ],
-          workCenterId: [
-            { required: true, message: '请选择工作中心', trigger: 'blur' }
+          workCenterName: [
+            { required: true, message: '请选择工作中心', trigger: 'change' }
           ],
           timeUnit: [
             { required: true, message: '请选择时间单位', trigger: 'blur' }
@@ -254,6 +271,22 @@
       }
     },
     methods: {
+      chooseControl(val){
+        if(val){
+          this.controlList.map(item=>{
+              if(item.id==val){
+                 this.$set(this.form,'controlName',item.name)
+              }
+          })
+        }
+      },
+      chooseWorkCenter(){
+         this.$refs.centerRefs.open(this.form)
+      },
+      determineChoose(row){
+          this.$set(this.form,'workCenterName',row.name)
+          this.$set(this.form,'workCenterId',row.id)
+      },
       /* 保存编辑 */
       save() {
         this.$refs.form.validate((valid) => {
@@ -263,14 +296,11 @@
           if (!this.isUpdate) {
             delete this.form.id;
           }
-
           this.form.workBeat.beatTimes = this.totalTime;
-
           this.loading = true;
           this.$message.success('修改成功');
           this.loading = false;
           this.updateVisible(false);
-
           // producetask
           //   .save(this.form)
           //   .then((msg) => {

+ 31 - 17
src/views/technology/route/components/user-edit.vue

@@ -42,20 +42,17 @@
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item label="产品编码:" prop="categoryId">
-            <el-input
-              placeholder="点击选择产品编码"
-              v-model="form.categoryId"
-            />
+          <el-form-item label="产品编码:" prop="categoryCode">
+             <el-input
+               placeholder="点击选择产品编码"
+               disabled
+               v-model="form.categoryCode"
+             />
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item label="产品名称:" prop="categoryId">
-            <el-input
-              placeholder="点击选择产品编码"
-              disabled
-              v-model="form.categoryId"
-            />
+          <el-form-item label="产品名称:" prop="categoryName">
+            <el-input @click.native="chooseProduct" v-model="form.categoryName" readonly/>
           </el-form-item>
         </el-col>
         <el-col :span="8">
@@ -85,16 +82,21 @@
         保存
       </el-button>
     </template>
+
+    <!-- 选择产品弹窗 -->
+    <ProductModal ref="productRefs" @changeProduct='determineChoose'/>
   </ele-modal>
 </template>
 
 <script>
-  // import { emailReg, phoneReg } from 'ele-admin';
+  import ProductModal from './ProductModal.vue';
   import route from '@/api/technology/route';
-
   import { addUsers, putUsers } from '@/api/system/user';
 
   export default {
+    components:{
+       ProductModal
+    },
     props: {
       // 弹窗是否打开
       visible: Boolean,
@@ -109,14 +111,15 @@
         status: -1,
         categoryId: '',
         version: '1.0',
-        id: ''
+        id: '',
+        categoryCode: '',
+        categoryName: ''
       };
       return {
         defaultForm,
         fList: [], //仓库列表
         categoryCode: '',
         categoryName: '',
-
         // 表单数据
         form: { ...defaultForm },
 
@@ -137,8 +140,11 @@
           factoryId: [
             { required: true, message: '请输入工艺路线', trigger: 'blur' }
           ],
-          categoryId: [
-            { required: true, message: '请选择产品编码', trigger: 'blur' }
+          categoryCode: [
+            { required: true, message: '请选择产品编码', trigger: 'change' }
+          ],
+          categoryName: [
+            { required: true, message: '请选择产品名称', trigger: 'change' }
           ],
           status: [
             { required: true, message: '请输入工艺路线版本', trigger: 'blur' }
@@ -163,6 +169,14 @@
       }
     },
     methods: {
+      chooseProduct(){
+         this.$refs.productRefs.open(this.form)
+      },
+      determineChoose(row){
+          this.$set(this.form,'categoryName',row.name)
+          this.$set(this.form,'categoryId',row.id)
+          this.$set(this.form,'categoryCode',row.code)
+      },
       /* 保存编辑 */
       save() {
         this.$refs.form.validate((valid) => {

+ 14 - 2
src/views/technology/route/components/user-taskinstance.vue

@@ -92,6 +92,7 @@
     <!-- 编辑弹窗 -->
     <user-edit
       :visible.sync="showEdit"
+      :controlList="controlList"
       :data="current"
       @done="reload"
       ref="userEdit"
@@ -110,7 +111,7 @@
   import Production from './production';
   import UserEdit from './production/components/user-edit.vue';
   import UserSetting from './production/components/user-setting.vue';
-
+  import control from '@/api/technology/control';
   export default {
     components: { Production, UserEdit, UserSetting },
     props: {
@@ -175,7 +176,8 @@
         showEdit: false,
         current: {},
         removeList: [],
-        tableData: []
+        tableData: [],
+        controlList:[]
       };
     },
 
@@ -206,11 +208,21 @@
       },
       /* 打开编辑弹窗 */
       openEdit(row) {
+        this.getControlList()
         this.current = row;
         this.showEdit = true;
         this.$refs.userEdit.$refs.form &&
           this.$refs.userEdit.$refs.form.clearValidate();
       },
+      
+      getControlList(){
+         const params = {
+           pageNum: 1, size: -1
+         }
+         control.list().then(res=>{
+            this.controlList = res.list
+         })
+      },
       /*配置工艺参数 */
       openSetting(row) {
         if (!row.id) {

+ 1 - 1
src/views/technology/route/index.vue

@@ -155,7 +155,7 @@
             columnKey: 'action',
             label: '操作',
             width: 220,
-            align: 'center',
+            align: 'left',
             resizable: false,
             slot: 'action',
             showOverflowTooltip: true