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

+ 9 - 0
src/api/productionPlan/order.js

@@ -21,3 +21,12 @@ export async function getDeviceList ({ productionId }) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// 生产计划添加工单列表
+export async function getPlanDeviceList ({ productionId }) {
+  const res = await request.get(`/aps/workorder/getDeviceList/${productionId}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 7 - 5
src/components/CreatePlan/equipment-dailog.vue

@@ -42,7 +42,7 @@
 </template>
 
 <script>
-  import { getDeviceList } from '@/api/productionPlan/order';
+  import { getDeviceList , getPlanDeviceList } from '@/api/productionPlan/order';
   export default {
     props: ['produceVersionId'],
     data () {
@@ -115,11 +115,12 @@
       }
     },
     methods: {
-      open (list = []) {
+      open (val,list = []) {
+		console.log('val',val)
         this.memoList = list;
         this.isSingle = false;
         this.visible = true;
-        this._getList();
+        this._getList(val);
       },
       openSingle (list = [], callback) {
         this.memoList = list;
@@ -144,8 +145,9 @@
           });
         }
       },
-      async _getList () {
-        const data = await getDeviceList({
+      async _getList (val) {
+		const fn = val?getPlanDeviceList:getDeviceList
+        const data = await fn({
           name: this.name,
           productionId: this.produceVersionId
         });

+ 1 - 1
src/views/productionPlan/components/plan-view.vue

@@ -343,7 +343,7 @@
       },
       addOrder () {
 				if(this.tableData.length>0) return  this.$message.warning('工单只能添加一条!');
-        this.$refs.equipmentDailogRef.open();
+        this.$refs.equipmentDailogRef.open(1);
       },
       editOrder (row) {
         this.$refs.equipmentDailogRef.openSingle([row], (current) => {