ysy преди 2 години
родител
ревизия
99739ee666

+ 10 - 0
src/api/saleOrder/index.js

@@ -140,6 +140,16 @@ export async function getPlanProductVersion(code) {
   return Promise.reject(new Error(res.data.message));
 }
 
+
+// 选择工艺路线
+export async function routeList (params)  {
+  const res = await request.get('/main/producerouting/page', { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}
+
+
 // 获取订单详情
 export async function getOrderDetail(code) {
   const res = await request.get(`/aps/salesorder/getByCode/${code}`);

+ 1 - 1
src/components/CreatePlan/CreateBatch.vue

@@ -81,7 +81,7 @@
 
 <script>
 	import ChooseMaterial from '@/components/CreatePlan/ChooseMaterial.vue'
-	import ProductionVersion from '@/components/CreatePlan/ProductionVersion.vue'
+	import ProductionVersion from '@/components/CreatePlan/ProductionVersion2.vue'
 	export default {
 		components: {
 			ChooseMaterial,

+ 2 - 7
src/components/CreatePlan/ProductionVersion.vue

@@ -1,7 +1,7 @@
 <template>
   <ele-modal
     :visible.sync="visible"
-    title="选择生产版本"
+    title="选择工艺路线"
     width="75vw"
     append-to-body
   >
@@ -30,12 +30,7 @@
         prop="incompleteFormingNum"
       >
       </el-table-column>
-      <!-- <el-table-column
-        label="预计完成时间"
-        align="center"
-        prop="planCompleteDate"
-      >
-      </el-table-column> -->
+
       <el-table-column label="标准产能" align="center" prop="model">
         <template slot-scope="{ row }">
           {{ row.capacityNum }}{{ row.capacityUnit }}/{{ row.capacityTime }}

+ 165 - 0
src/components/CreatePlan/ProductionVersion2.vue

@@ -0,0 +1,165 @@
+<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">
+      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" height="calc(100vh - 350px)"
+        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>
+
+    </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 { routeList } from '@/api/saleOrder';
+export default {
+  components: {   },
+  data() {
+    return {
+      visible: false,
+      // 表格列配置
+      columns: [
+        {
+          prop: 'code',
+          label: '工艺路线组编码',
+          // sortable: 'custom',
+          showOverflowTooltip: true,
+          align: 'center',
+
+          minWidth: 110
+        },
+        {
+          prop: 'name',
+          label: '工艺路线名称',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+
+
+        {
+          prop: 'version',
+          label: '工艺路线版本',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+
+        {
+          prop: 'produceVersionName',
+          label: '生产版本',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+
+        {
+          prop: 'status',
+          label: '状态',
+          align: 'center',
+          slot: 'status',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+
+        {
+          action: 'action',
+          slot: 'action',
+          align: 'center',
+          label: '选择'
+        }
+      ],
+      categoryLevelId: '9',
+      radio: null
+    }
+  },
+
+  watch: {
+
+  },
+  methods: {
+    /* 表格数据源 */
+    datasource({ page, where, limit }) {
+      return routeList({
+        ...where,
+        pageNum: page,
+        size: limit,
+  
+      });
+    },
+
+    /* 刷新表格 */
+    reload() {
+      this.$refs.table.reload({ page: 1, where: where });
+    },
+    open(item) {
+      if (item) {
+        this.current = {
+          id: item.id,
+          name: item.name,
+        }
+        this.radio = item.id
+      }
+      this.visible = true
+    },
+    // 单击获取id
+    cellClick (row) {
+        this.current = row
+        this.radio = row.id
+    },
+
+    handleClose() {
+      this.visible = false
+ 
+    },
+    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>

+ 0 - 1
src/views/materialPlan/components/plan-edit-dialog.vue

@@ -217,7 +217,6 @@
         this.$refs.formRef.resetFields();
       },
       versionConfirm (cur) {
-        console.log(cur, '2222W33000000920');
         this.formData.produceVersionId = cur.produceVersionId;
         this.formData.produceVersionName = cur.produceVersionName;
       },

+ 18 - 54
src/views/saleOrder/salesToProduction.vue

@@ -30,35 +30,16 @@
             </el-form-item>
           </el-col>
           <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-            <el-form-item label="生产版本:" prop="produceVersionName">
+            <el-form-item label="工艺路线:" prop="produceRoutingName">
               <el-input
                 @click.native="openVersion"
-                placeholder="请选择生产版本"
+                placeholder="请选择工艺路线"
                 readonly
-                v-model="form.produceVersionName"
+                v-model="form.produceRoutingName"
               ></el-input>
             </el-form-item>
           </el-col>
-          <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-            <el-form-item label="产线:">
-              <!-- <el-input
-                v-model="form.productLine"
-                placeholder="选择生产版本带入"
-                readonly
-              ></el-input> -->
-              <el-select
-                placeholder="选择生产版本带入"
-                v-model="form.productLine"
-              >
-                <el-option
-                  v-for="(item, index) in lineNamesList"
-                  :key="index"
-                  :label="item"
-                  :value="item"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
+
           <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
             <el-form-item label="使用改型:" prop="modification">
               <el-checkbox
@@ -298,9 +279,7 @@
       ></AdditionalOrder>
       <ProductionVersion
         ref="versionRefs"
-        @confirm="confirmVersion"
-        :productCode="form.productCode"
-        :produceVersionId="form.produceVersionId"
+        @changeProduct="changeProduct"
       ></ProductionVersion>
       <PlanSubmit
         ref="submitRefs"
@@ -314,7 +293,7 @@
 <script>
   import AdditionalOrder from './components/AdditionalOrder.vue';
   import PlanSubmit from './components/plan-submit.vue';
-  import ProductionVersion from '@/components/CreatePlan/ProductionVersion.vue';
+  import ProductionVersion from '@/components/CreatePlan/ProductionVersion2.vue';
   import {
     productionToPlan,
     saveSaleToPlan,
@@ -341,16 +320,16 @@
         type: this.$route.query.type,
         form: {
           planType: 1,
-          produceVersionId: '',
-          productLine: '',
+          produceRoutingId: '',
+
           stockCountBase: '',
           salesOrders: [],
-          produceVersionName: ''
+          produceRoutingName: ''
         },
-        lineNamesList: [],
+   
         // 表单验证规则
         rules: {
-          produceVersionName: [
+          produceRoutingName: [
             { required: true, message: '请选择生产版本', trigger: 'change' }
           ]
         },
@@ -379,9 +358,7 @@
       async getPlanInfo(id) {
         const data = await getUpdateInfoById(id);
         this.form = data;
-        if (data.productCode) {
-          this.getVersionData();
-        }
+
       },
       async _getInventory() {
         const res = await getInventory(
@@ -413,15 +390,7 @@
         });
       },
 
-      getVersionData() {
-        getProductVersion(this.form.productCode).then((res) => {
-          res.map((item) => {
-            if (item.produceVersionId == this.form.produceVersionId) {
-              this.lineNamesList = Array.from(new Set(item.lineNames || []));
-            }
-          });
-        });
-      },
+
       cancel() {
         const key = getRouteTabKey();
         this.$router.go(-1);
@@ -511,15 +480,10 @@
       openVersion() {
         this.$refs.versionRefs.open();
       },
-      confirmVersion(data) {
-        this.$set(this.form, 'produceVersionName', data.produceVersionName);
-        this.$set(this.form, 'produceVersionId', data.produceVersionId);
-        this.$set(
-          this.form,
-          'productLine',
-          data.lineNames.length ? data.lineNames[0] : ''
-        );
-        this.lineNamesList = Array.from(new Set(data.lineNames || []));
+      changeProduct(data) {
+        this.$set(this.form, 'produceRoutingName', data.name);
+        this.$set(this.form, 'produceRoutingId', data.id);
+
       },
 
       confirmChoose(list) {
@@ -592,7 +556,7 @@
                     code: code,
                     formingNum: params.contractNum,
                     formingWeight: params.sumOrderWeight,
-                    produceVersionId: params.produceVersionId,
+                    produceRoutingId: params.produceRoutingId,
                     status: 4,
                     model: params.model,
                     brandNo: params.brandNo,

+ 12 - 16
src/views/workOrder/index.vue

@@ -78,7 +78,11 @@
           { label: '待生产', value: 4 },
           { label: '生产中', value: 5 },
           { label: '待下达', value: 8 }
-        ]
+        ],
+
+        current: null,
+
+        
       };
     },
     computed: {
@@ -107,7 +111,7 @@
           },
           {
             prop: 'produceVersionName',
-            label: '生产版本',
+            label: '工艺路线',
             align: 'center'
           },
           {
@@ -207,28 +211,20 @@
       },
       // 下达
       toRelease (row) {
-        this.loading = true;
-        releaseWorkOrder(row.id)
-          .then((res) => {
-            if (res) {
-              this.$message.success('成功');
-              this.reload();
-            }
-            this.loading = false;
-          })
-          .catch(() => {
-            this.loading = false;
-          });
-        this.releasParams.id = row.id;
+        this.current = row
         this.visible = true;
+      
       },
       // 下达
       confirm () {
         if (!this.releasParams.teamId) {
           return this.$message.error('请选择班组');
         }
+        console.log(this.current)
+        console.log(this.releasParams)
+
         const loading = this.$loading({ text: '加载中...' });
-        releaseWorkOrder(this.releasParams)
+        releaseWorkOrder({id: this.current.id, teamId: this.releasParams.teamId})
           .then((res) => {
             if (res) {
               this.$message.success('成功');

+ 2 - 7
vue.config.js

@@ -31,13 +31,8 @@ module.exports = {
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
-        target: 'http://192.168.3.35:8080', // kang杨威
-        // target: 'http://192.168.3.38:8080', // 陈潇
-        // target: 'http://192.168.3.25:8080', // 黄峥嵘
-        // target: 'http://192.168.3.41:8080', // 何江鹏
-        // target: 'http://192.168.3.33:8080', // 谢一平
-        // target: 'http://192.168.3.51:18086', // 测试环境
-
+        // target: 'http://124.71.68.31:50001',
+        target: 'http://192.168.1.139:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''