ysy 2 lat temu
rodzic
commit
d93f147f78

+ 92 - 9
src/views/materialPlan/components/plan-edit-dialog.vue

@@ -16,9 +16,9 @@
       </el-row>
     </el-form>
 
-    <el-form :model="formData" ref="tableForm" >
+    <el-form :model="formData" ref="tableForm">
 
-      <ele-pro-table ref="table" :needPage="false" :columns="columns"  row-key="id">
+      <ele-pro-table ref="table" :needPage="false" :columns="columns" row-key="id">
 
 
         <template v-slot:toolbar>
@@ -30,10 +30,37 @@
 
 
 
-          <template v-slot:code="{ row }">
-              <el-input placeholder="请输入" readonly v-model="row.code"></el-input>
-          </template>
+        <template v-slot:code="{ row }">
+          <el-input placeholder="请输入" readonly v-model="row.code"></el-input>
+        </template>
 
+        <template v-slot:remark="{ row }">
+          <el-input placeholder="备注"  v-model="row.remark"></el-input>
+        </template>
+
+        <template v-slot:action="{ row, $index }">
+          <template v-if="row.orderSource != 1">
+            <el-link
+              type="primary"
+              :underline="false"
+           
+            
+            >
+              设置物料
+            </el-link>
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此销售订单吗?"
+              @confirm="remove(row, $index)"
+            >
+              <template v-slot:reference>
+                <el-link type="danger" :underline="false" icon="el-icon-delete">
+                  删除
+                </el-link>
+              </template>
+            </el-popconfirm>
+          </template>
+        </template>
 
 
       </ele-pro-table>
@@ -46,7 +73,7 @@
     </div>
 
 
-    <saleOrderPop ref="saleOrderRef"></saleOrderPop>
+    <saleOrderPop ref="saleOrderRef" @chooseOrder="chooseOrder"></saleOrderPop>
 
     <!-- 选择物料 -->
     <ChooseMaterial ref="chooseRef" @success="handleChooseMaterial"></ChooseMaterial>
@@ -90,9 +117,55 @@ export default {
           align: 'center',
           minWidth: 110
         },
+        {
+          prop: 'customerName',
+          label: '客户名称',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'deliveryNum',
+          label: '客户代号',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+
+        {
+          prop: 'productName',
+          label: '产品名称',
+          align: 'center',
+          minWidth: 120
+        },
+
+        {
+          prop: 'model',
+          label: '型号',
+          align: 'center',
+          minWidth: 120
+        },
 
+        {
+          prop: 'brandNo',
+          label: '牌号',
+          align: 'center'
+        },
 
+        {
+          prop: 'deliveryTime',
+          label: '交付日期',
+          align: 'center',
+          showOverflowTooltip: true
+        },
 
+        {
+          prop: 'remark',
+          label: '备注',
+          slot: 'remark',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+        
 
         {
           columnKey: 'action',
@@ -117,10 +190,10 @@ export default {
       },
       formData: {
         materialName: '',
-        positionList: []
+        salesOrderPOList: []
       },
 
- 
+
     };
   },
   methods: {
@@ -150,7 +223,7 @@ export default {
       this.$refs.formRef.resetFields();
     },
 
-    datasource({  }) {
+    datasource({ }) {
       return []
     },
 
@@ -163,6 +236,16 @@ export default {
       this.$refs.saleOrderRef.open(this.tableData)
     },
 
+    chooseOrder(list) {
+      this.$refs.table.setData([...list]);
+    },
+
+    remove (row, index) {
+       let _arr = this.$refs.table.getData() || [];
+       _arr.splice(index, 1);
+       this.$refs.table.setData([..._arr]);
+      },
+
     handleChooseMaterial() { },
 
 

+ 45 - 55
src/views/materialPlan/components/saleOrder-search.vue

@@ -1,78 +1,68 @@
 <!-- 搜索表单 -->
 <template>
-    <el-form
-      label-width="120px"
-      class="ele-form-search"
-      @keyup.enter.native="search"
-      @submit.native.prevent
-    >
-      <el-row :gutter="24">
+    <el-form label-width="120px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
+        <el-row :gutter="24">
 
-        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="销售订单号:">
-          <el-input v-model="where.code" placeholder="请输入"></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="where.productCode" placeholder="请输入"></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="where.code" placeholder="请输入"></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="where.productCode" placeholder="请输入"></el-input>
+                </el-form-item>
+            </el-col>
 
-  
-        <el-col v-bind="styleResponsive ? { sm: 4 } : { 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-col v-bind="styleResponsive ? { sm: 4 } : { 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>
+</template>
   
-  <script>
-    export default {
-      data() {
+<script>
+export default {
+    data() {
         // 默认表单数据
         const defaultWhere = {
             code: '',
-          productCode: '',
-          status: [1]
-    
+            productCode: '',
+           
+
         };
         return {
-          // 表单数据
-          where: { ...defaultWhere }
+            // 表单数据
+            where: { ...defaultWhere }
         };
-      },
-      props: {
+    },
+    props: {
 
-      },
-      computed: {
+    },
+    computed: {
         // 是否开启响应式布局
         styleResponsive() {
-          return this.$store.state.theme.styleResponsive;
+            return this.$store.state.theme.styleResponsive;
         }
-      },
-      methods: {
+    },
+    methods: {
         /* 搜索 */
         search() {
-          this.$emit('search', this.where);
+            this.$emit('search', this.where);
         },
         /*  重置 */
         reset() {
-          this.where = { ...this.defaultWhere };
-          this.search();
+            this.where = { ...this.defaultWhere };
+            this.search();
         }
-      }
-    };
-  </script>
+    }
+};
+</script>
   

+ 9 - 5
src/views/materialPlan/components/saleOrderPop.vue

@@ -1,6 +1,6 @@
 <template>
-    <el-dialog :title="title" v-if="visible" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
-        :close-on-press-escape="false" append-to-body width="70%">
+    <el-dialog :title="title" v-if="visible" :visible.sync="visible" :before-close="handleClose"
+        :close-on-click-modal="false" :close-on-press-escape="false" append-to-body width="70%">
 
         <el-card shadow="never">
             <saleOrderSearch @search="reload" />
@@ -8,7 +8,6 @@
             <!-- 数据表格 -->
             <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :selection.sync="selection" row-key="id">
 
-
             </ele-pro-table>
 
 
@@ -131,20 +130,24 @@ export default {
                 this.tableData = item
             }
 
-
             this.visible = true
 
+
+
         },
 
 
         /* 表格数据源 */
         async datasource({ page, limit, where }) {
+            where.status = [1]
             const data = await getPageList({
                 ...where,
                 pageNum: page,
                 size: limit
             });
 
+
+
             return data;
         },
 
@@ -165,11 +168,12 @@ export default {
 
         },
         selected() {
+
             if (!this.selection.length) {
                 this.$message.error('请至少选择一条数据');
                 return;
             }
-            this.$emit('chooseModal', this.selection, this.current)
+            this.$emit('chooseOrder', this.selection)
             this.handleClose()
         },
     }