Răsfoiți Sursa

生产计划详情

quwangxin 2 ani în urmă
părinte
comite
d3eb020258

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

@@ -30,6 +30,16 @@ export async function getById (id) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+/**
+ * 发布信息返显
+ */
+export async function getReleaseInfoById (id) {
+  const res = await request.get(`/aps/productionplan/getReleaseInfoById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 /**
  * 详情
  */

+ 14 - 0
src/views/productionPlan/components/plan-view.vue

@@ -167,6 +167,10 @@
       infoData: {
         type: Object,
         default: () => ({})
+      },
+      orderData: {
+        type: Object,
+        default: () => ({})
       }
     },
     data () {
@@ -234,6 +238,16 @@
         return { formingNum, formingWeight };
       }
     },
+    watch: {
+      orderData: {
+        immediate: true,
+        handler () {
+          if (this.orderData?.salesOrders?.length) {
+            this.tableData = this.orderData.salesOrders;
+          }
+        }
+      }
+    },
     methods: {
       // 发布
       handleRelease () {

+ 11 - 2
src/views/productionPlan/index.vue

@@ -49,10 +49,9 @@
           </el-link>
           <el-link
             type="primary"
-            v-if="row.status == 4"
             :underline="false"
             icon="el-icon-edit"
-            @click="handleOrderPublish(3, row)"
+            @click="planEdit(row)"
           >
             修改计划
           </el-link>
@@ -306,6 +305,16 @@
           }
         });
       },
+      // 修改计划
+      planEdit ({ id }) {
+        this.$router.push({
+          path: '/saleOrder/salesToProduction',
+          query: {
+            type: 'edit',
+            id
+          }
+        });
+      },
       handleTabChange () {
         this.$refs.searchRef.reset();
       },

+ 9 - 2
src/views/productionPlan/workOrderPublish.vue

@@ -86,7 +86,7 @@
           </div>
         </div>
       </div> -->
-      <planView key="first" :infoData="infoData" />
+      <planView key="first" :infoData="infoData" :orderData="orderData" />
       <!-- <el-tabs v-model="activeName" type="card">
         <el-tab-pane label="默认" name="first"
           ><planView key="first" :infoData="infoData"
@@ -104,7 +104,7 @@
 
 <script>
   import planView from './components/plan-view';
-  import { getById } from '@/api/productionPlan/index';
+  import { getById, getReleaseInfoById } from '@/api/productionPlan/index';
   export default {
     components: { planView },
     data () {
@@ -146,6 +146,7 @@
           }
         ],
         infoData: {},
+        orderData: {},
         planType: ['内销计划', '外销计划'],
         id: null
       };
@@ -160,6 +161,11 @@
         const data = await getById(this.id);
 
         this.infoData = data;
+      },
+      async getReleaseInfoById () {
+        const data = await getReleaseInfoById(this.id);
+
+        this.orderData = data;
       }
     },
     created () {
@@ -169,6 +175,7 @@
       this.id = query.id;
 
       this.getInfo();
+      this.getReleaseInfoById();
     }
   };
 </script>

+ 167 - 169
src/views/saleOrder/components/EquipmentDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    title="选择品"
+    title="选择品"
     :visible.sync="equipmentdialog"
     :before-close="handleClose"
     :close-on-click-modal="false"
@@ -10,42 +10,44 @@
   >
     <div>
       <el-row>
-		<el-col :span="24" class="topsearch">
-			<el-form >
-			  <el-row>
-          <el-col :span="6">
-            <el-input
-              v-model="code"
-              placeholder="请输入产品编码"
-              size="small"
-            ></el-input>
-          </el-col>
-          <el-col :span="6" style="margin-left:10px">
-             <el-button type="primary" size="small" @click="reload">搜索</el-button>
-             <el-button size="small" @click="reset">重置</el-button>
-          </el-col>
-			  </el-row>
-			</el-form>
-		</el-col>
+        <el-col :span="24" class="topsearch">
+          <el-form>
+            <el-row>
+              <el-col :span="6">
+                <el-input
+                  v-model="code"
+                  placeholder="请输入产品编码"
+                  size="small"
+                ></el-input>
+              </el-col>
+              <el-col :span="6" style="margin-left: 10px">
+                <el-button type="primary" size="small" @click="reload"
+                  >搜索</el-button
+                >
+                <el-button size="small" @click="reset">重置</el-button>
+              </el-col>
+            </el-row>
+          </el-form>
+        </el-col>
         <el-col :span="6" class="tree_col">
           <AssetTree
             @handleNodeClick="handleNodeClick"
-            id="9"
+            id="3"
             :paramsType="'type'"
             ref="treeList"
           />
         </el-col>
-        <el-col :span="18" class="table_col">		
-			<ele-pro-table
-				ref="equiTable"
-				:columns="columns"
-				:datasource="datasource"
-				:selection.sync="selection"
-				cache-key="systemRoleTable"
-				row-key="id"
-				@done="setSelect"
-			>
-			</ele-pro-table>
+        <el-col :span="18" class="table_col">
+          <ele-pro-table
+            ref="equiTable"
+            :columns="columns"
+            :datasource="datasource"
+            :selection.sync="selection"
+            cache-key="systemRoleTable"
+            row-key="id"
+            @done="setSelect"
+          >
+          </ele-pro-table>
         </el-col>
       </el-row>
     </div>
@@ -59,149 +61,145 @@
 <script>
   import AssetTree from '@/components/AssetTree';
   import { getList } from '@/api/classifyManage/itemInformation';
-export default {
-  components: {
-    AssetTree
-  },
-  props: {
-  	selectList:Array,
-  },
-  data () {
-    return {
-      equipmentdialog: false,   
-	  columns: [
-	    {
-	      width: 45,
-	      type: 'selection',
-	      columnKey: 'selection',
-	      align: 'center',
-	  	  reserveSelection: true
-	    },
-	    {
-	      columnKey: 'index',
-	      label: '序号',
-	      type: 'index',
-	      width: 55,
-	      align: 'center',
-	      showOverflowTooltip: true
-	    },
-	    {
-	      prop: 'code',
-	      label: '物品编码',
-	      align: 'center',
-	      showOverflowTooltip: true,
-	      minWidth: 110,
-	      slot: 'code'
-	    },
-	    {
-	      prop: 'name',
-	      label: '物品名称',
-	      align: 'center',
-	      showOverflowTooltip: true,
-	      minWidth: 110
-	    },
-	    {
-	      prop: 'brandNum',
-	      label: '牌号',
-	      align: 'center',
-	      showOverflowTooltip: true,
-	      minWidth: 110
-	    },
-	    {
-	      prop: 'modelType',
-	      label: '型号',
-	      align: 'center',
-	      showOverflowTooltip: true,
-	      minWidth: 110
-	    }
-	  ],
-	  tableList:[],
-	  categoryLevelId:null,	  
-	  code:null,
-	  selection:[]
-    }
-  },
-
-  watch: {
-
-  },
-  methods: {
-	async datasource ({ page, limit }) {
-		 const params = {
-			code:this.code,
-			pageNum: page,
-			size: limit,
-			categoryLevelId: this.categoryLevelId
-		 }
-		const data = await getList(params)
-		this.tableList = data.list
-		return data
-	 },
-	open(){
-		this.equipmentdialog = true
-		this.setSelect()
-	},
-	handleNodeClick (data) {
-		this.categoryLevelId = data.id;
-		this.reload();
-	},
-	reload () {
-	  this.$refs.equiTable.reload();
-	},
-    handleClose () {
-      this.equipmentdialog = false
-	  this.$refs.equiTable.clearSelection()
+  export default {
+    components: {
+      AssetTree
+    },
+    props: {
+      selectList: Array
+    },
+    data () {
+      return {
+        equipmentdialog: false,
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            reserveSelection: true
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'code',
+            label: '物品编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot: 'code'
+          },
+          {
+            prop: 'name',
+            label: '物品名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'brandNum',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          }
+        ],
+        tableList: [],
+        categoryLevelId: null,
+        code: null,
+        selection: []
+      };
     },
-	reset(){
-		this.code = null
-		this.reload()
-	},
-	// 设置选中
-	setSelect(){
-	   this.$nextTick(() => {
-		   this.tableList.forEach(row => {
-			   this.selectList.forEach(selected => {
-				   if (selected.productCode === row.code) {
-					   this.$refs.equiTable.toggleRowSelection(row, true)
-				   }
-			   })
-		   })
-	   })
-	},
-	// 选择
-	selected(){
-		this.$emit('choose',this.selection)
-		this.handleClose()
-	}
-
 
-  }
-}
+    watch: {},
+    methods: {
+      async datasource ({ page, limit }) {
+        const params = {
+          code: this.code,
+          pageNum: page,
+          size: limit,
+          categoryLevelId: this.categoryLevelId
+        };
+        const data = await getList(params);
+        this.tableList = data.list;
+        return data;
+      },
+      open () {
+        this.equipmentdialog = true;
+        this.setSelect();
+      },
+      handleNodeClick (data) {
+        this.categoryLevelId = data.id;
+        this.reload();
+      },
+      reload () {
+        this.$refs.equiTable.reload();
+      },
+      handleClose () {
+        this.equipmentdialog = false;
+        this.$refs.equiTable.clearSelection();
+      },
+      reset () {
+        this.code = null;
+        this.reload();
+      },
+      // 设置选中
+      setSelect () {
+        this.$nextTick(() => {
+          this.tableList.forEach((row) => {
+            this.selectList.forEach((selected) => {
+              if (selected.productCode === row.code) {
+                this.$refs.equiTable.toggleRowSelection(row, true);
+              }
+            });
+          });
+        });
+      },
+      // 选择
+      selected () {
+        this.$emit('choose', this.selection);
+        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;
+  .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;
   }
-}
-.pagination {
-  text-align: right;
-  padding: 10px 0;
-}
-.btns {
-  text-align: center;
-  padding: 10px 0;
-}
-.topsearch{
-	margin-bottom:15px;
-}
 </style>

+ 13 - 10
src/views/saleOrder/salesToProduction.vue

@@ -29,12 +29,12 @@
             </el-form-item>
           </el-col>
           <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-            <el-form-item label="生产版本:" prop="productVersionName">
+            <el-form-item label="生产版本:" prop="produceVersionName">
               <el-input
                 @click.native="openVersion"
                 placeholder="请选择生产版本"
                 readonly
-                v-model="form.productVersionName"
+                v-model="form.produceVersionName"
               ></el-input>
             </el-form-item>
           </el-col>
@@ -314,7 +314,7 @@
         },
         // 表单验证规则
         rules: {
-          productVersionName: [
+          produceVersionName: [
             { required: true, message: '请选择生产版本', trigger: 'change' }
           ]
         },
@@ -332,12 +332,15 @@
       this.requestDict('按单按库');
       this.requestDict('订单类型');
       this.requestDict('交付要求');
-      this.selection = JSON.parse(this.$route.query.selection);
-      const list = [];
-      this.selection.map((item) => {
-        list.push(item.id);
-      });
-      this.getSaleInfo(list);
+      if (this.$route.query.type == 'edit') {
+      } else {
+        this.selection = JSON.parse(this.$route.query.selection);
+        const list = [];
+        this.selection.map((item) => {
+          list.push(item.id);
+        });
+        this.getSaleInfo(list);
+      }
     },
     methods: {
       getSaleInfo (params) {
@@ -430,7 +433,7 @@
         this.$refs.versionRefs.open();
       },
       confirmVersion (data) {
-        this.$set(this.form, 'producteVersionName', data.produceVersionName);
+        this.$set(this.form, 'produceVersionName', data.produceVersionName);
         this.$set(this.form, 'produceVersionId', data.produceVersionId);
         this.form.productline = data.lineNames.length ? data.lineNames[0] : '';
       },