Prechádzať zdrojové kódy

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

quwangxin 3 rokov pred
rodič
commit
84fdd053e1

+ 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>

+ 169 - 0
src/views/technology/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>

+ 32 - 10
src/views/technology/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">
+               <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,18 +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 +207,15 @@
     }
   };
   export default {
+    components:{
+       WorkCenter
+    },
     props: {
       // 弹窗是否打开
       visible: Boolean,
       // 修改回显的数据
-      data: Object
+      data: Object,
+      controlList:Array
     },
     data() {
       return {
@@ -224,8 +240,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' }
@@ -234,7 +250,8 @@
         // 提交状态
         loading: false,
         // 是否是修改
-        isUpdate: false
+        isUpdate: false,
+        chooseItem:null,
       };
     },
     computed: {
@@ -253,6 +270,13 @@
       }
     },
     methods: {
+      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) => {
@@ -294,9 +318,7 @@
         if (visible) {
           if (this.data) {
             console.log(111111);
-
             const res = await producetask.getById(this.data.id);
-
             this.$util.assignObject(this.form, {
               ...res
             });

+ 15 - 4
src/views/technology/production/index.vue

@@ -83,6 +83,7 @@
     <user-edit
       :visible.sync="showEdit"
       :data="current"
+      :controlList="controlList"
       @done="reload"
       ref="userEdit"
     />
@@ -99,9 +100,8 @@
   import UserSearch from './components/user-search.vue';
   import UserEdit from './components/user-edit.vue';
   import UserSetting from './components/user-setting.vue';
-
   import producetask from '@/api/technology/production';
-
+  import control from '@/api/technology/control';
   export default {
     name: 'technologyProduction',
     components: {
@@ -169,7 +169,8 @@
         // 是否显示编辑弹窗
         showEdit: false,
         // 是否显示参数弹窗
-        showSetting: false
+        showSetting: false,
+        controlList:[]
       };
     },
     methods: {
@@ -195,10 +196,20 @@
       },
       /* 打开编辑弹窗 */
       openEdit(row) {
+        this.getControlList()
         this.current = row;
         this.showEdit = true;
         this.$refs.userEdit.$refs.form &&
-          this.$refs.userEdit.$refs.form.clearValidate();
+        this.$refs.userEdit.$refs.form.clearValidate();
+      },
+
+      getControlList(){
+         const params = {
+           pageNum: 1, size: -1
+         }
+         control.list().then(res=>{
+            this.controlList = res.list
+         })
       },
 
       /* 删除 */

+ 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

+ 89 - 0
src/views/technology/version/components/user-search.vue

@@ -0,0 +1,89 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="80px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row>
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 4 }">
+        <el-form-item label="产品编码:">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 4 }">
+        <el-form-item label="产品名称:">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 4 }">
+        <el-form-item label="版本号:">
+          <el-input
+            clearable
+            v-model="where.version"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 4 }">
+        <el-form-item label="版本名称:">
+          <el-input
+            clearable
+            v-model="where.versionName"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <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">重置</el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        code: '',
+        name: '',
+        version: '',
+        versionName: ''
+      };
+      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>

+ 215 - 4
src/views/technology/version/index.vue

@@ -1,9 +1,220 @@
 <template>
-  <div>666</div>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <!-- 搜索表单 -->
+      <user-search @search="reload" />
+      <!-- 数据表格 -->
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        :selection.sync="selection"
+        row-key="code"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:toolbar>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="openEdit()"
+          >
+            新建
+          </el-button>
+        </template>
+
+        <!-- 状态列 -->
+        <template v-slot:status="{ row }">
+          {{ checkStatus(row) }}
+        </template>
+
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit(row)"
+          >
+            修改
+          </el-link>
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除当前工序吗?"
+            @confirm="remove(row)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+        </template>
+      </ele-pro-table>
+    </el-card>
+
+  </div>
 </template>
 
 <script>
-  export default {};
-</script>
+  import UserSearch from './components/user-search.vue';
+  import route from '@/api/technology/route';
+  export default {
+    name: 'technologyVersion',
+    components: {
+      UserSearch,
+    },
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'selection',
+            type: 'selection',
+            width: 45,
+            align: 'center',
+            fixed: 'left'
+          },
+
+          {
+            prop: 'code',
+            label: '产品编码',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'name',
+            label: '产品名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            align: 'center',
+            prop: 'categoryCode',
+            label: '版本号',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'categoryName',
+            label: '版本名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'version',
+            label: '工艺路线编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'status',
+            label: '工艺版本号',
+            align: 'center',
+            slot: 'status',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
 
-<style></style>
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 220,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        // 表格选中数据
+        selection: [],
+        // 当前编辑数据
+        current: null,
+        // 是否显示编辑弹窗
+        showEdit: false,
+        // 是否显示导入弹窗
+        showImport: false,
+        statusList: [
+          { label: '草稿', value: -1 },
+          { label: '失效', value: 0 },
+          { label: '生效', value: 1 }
+        ]
+      };
+    },
+    methods: {
+      /* 表格数据源 */
+      async datasource({ page, limit, where, order }) {
+        const res = await route.list({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit
+        });
+        return res;
+      },
+      checkStatus(row) {
+        let obj = this.statusList.find((it) => it.value == row.status);
+        return obj.label;
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where: where });
+      },
+      /* 打开编辑弹窗 */
+      openEdit(row) {
+        this.current = row;
+        this.showEdit = true;
+        this.$refs.userEdit.$refs.form &&
+          this.$refs.userEdit.$refs.form.clearValidate();
+      },
+
+      /* 删除 */
+      remove(row) {
+        const loading = this.$loading({ lock: true });
+
+        route
+          .delete(row.id)
+          .then((msg) => {
+            loading.close();
+            this.$message.success('删除' + msg);
+            this.reload();
+          })
+          .catch((e) => {
+            loading.close();
+            // this.$message.error(e.message);
+          });
+      },
+      /* 批量删除 */
+      removeBatch() {
+        if (!this.selection.length) {
+          this.$message.error('请至少选择一条数据');
+          return;
+        }
+        this.$confirm('确定要删除选中的工序吗?', '提示', {
+          type: 'warning'
+        })
+          .then(() => {
+            const loading = this.$loading({ lock: true });
+            producetask
+              .delete(this.selection.map((d) => d.id))
+              .then((msg) => {
+                loading.close();
+                this.$message.success('删除' + msg);
+                this.reload();
+              })
+              .catch((e) => {
+                loading.close();
+                // this.$message.error(e.message);
+              });
+          })
+          .catch(() => {});
+      }
+    }
+  };
+</script>

+ 20 - 19
src/views/technology/work/index.vue

@@ -35,9 +35,9 @@
         <template v-slot:categoryType="{ row }">
           {{ checkcategoryType(row.categoryType) }}
         </template>
-        <template v-slot:leaderUserId="{ row }">
+<!--        <template v-slot:leaderUserId="{ row }">
           {{ checkleaderUserId(row.leaderUserId) }}
-        </template>
+        </template> -->
         <!-- 状态列 -->
 
         <!-- 操作列 -->
@@ -91,7 +91,7 @@
       UserSearch,
       UserEdit
     },
-    data() {
+    data () {
       return {
         // 表格列配置
         columns: [
@@ -129,9 +129,9 @@
             align: 'center'
           },
           {
-            prop: 'leaderUserId',
+            prop: 'leaderUserName',
             label: '负责人',
-            slot: 'leaderUserId',
+            // slot: 'leaderUserId',
             showOverflowTooltip: true,
             align: 'center'
           },
@@ -169,32 +169,33 @@
         loading: false
       };
     },
-    created() {
+    created () {
       this.getfLise();
       this.getUserPage();
     },
     methods: {
       /*回显工厂 */
-      checkfactoryId(id) {
+      checkfactoryId (id) {
         let obj = this.fList.find((f) => f.id == id);
         return obj?.name;
       },
       /*回显类别 */
-      checkcategoryType(value) {
+      checkcategoryType (value) {
         return this.categoryTypes.find((f) => f.value == value).label;
       },
       /*回显负责人 */
-      checkleaderUserId(id) {
+      checkleaderUserId (id) {
         let obj = this.userList.find((f) => f.id == id);
         return obj?.name;
       },
-      /*厂房列表 */
-      async getUserPage() {
+      /*人员列表 */
+      async getUserPage () {
         const res = await work.getUserPage();
         this.userList = res.list;
       },
-      /*人员列表 */
-      async getfLise() {
+      /*厂房列表 */
+
+      async getfLise () {
         const res = await route.Flist({
           pageNum: 1,
           size: -1,
@@ -203,7 +204,7 @@
         this.fList = res.list;
       },
       /* 表格数据源 */
-      async datasource({ page, limit, where, order }) {
+      async datasource ({ page, limit, where, order }) {
         const res = await work.list({
           ...where,
           ...order,
@@ -214,22 +215,22 @@
       },
 
       /* 刷新表格 */
-      reload(where) {
+      reload (where) {
         this.$refs.table.reload({ page: 1, where: where });
       },
       /* 打开编辑弹窗 */
-      openEdit(row) {
+      openEdit (row) {
         this.current = row;
         this.showEdit = true;
         this.$refs.userEdit.$refs.form &&
           this.$refs.userEdit.$refs.form.clearValidate();
       },
       /* 打开导入弹窗 */
-      openImport() {
+      openImport () {
         this.showImport = true;
       },
       /* 删除 */
-      remove(row) {
+      remove (row) {
         // const loading = this.$loading({ lock: true });
         this.loading = true;
 
@@ -247,7 +248,7 @@
           });
       },
       /* 批量删除 */
-      removeBatch() {
+      removeBatch () {
         if (!this.selection.length) {
           this.$message.error('请至少选择一条数据');
           return;

+ 1 - 1
vue.config.js

@@ -37,7 +37,7 @@ module.exports = {
         // target: 'http://192.168.3.41:8080', // 何江鹏
         target: 'http://192.168.3.33:8080', // 谢一平
         // target: 'http://192.168.3.64:8080', // 粟勋
-        // target: 'http://192.168.3.34:8080', // 刘毅
+        // target: 'http://192.168.3.34:8080', // 刘毅
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''