Browse Source

代码上传

zhangqiOMG 3 years ago
parent
commit
3035e6bb70

+ 14 - 0
src/HDrpManagement/orderManage/modules/addproduct.vue

@@ -0,0 +1,14 @@
+<template>
+  <div>
+    <el-button>添加更多</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+
+}
+
+</script>
+<style>
+</style>

+ 4 - 76
src/HDrpManagement/orderManage/modules/edit.vue

@@ -157,80 +157,7 @@
       </div>
       <div class="mt-10">
         <p class="normal-title">订单产品</p>
-      </div>
-      <div style="border:1px solid #f1f2f3">
-        <el-table
-          ref="multipleTable"
-          :data="data"
-          style="width: 100%;"
-          :header-cell-style="{height:'50px',color:'#768093',fontWeight:'400'}"
-          :cell-style="{height:'50px',color:'#768093',fontWeight:'400'}">
-          <!-- <el-table-column
-            type="selection"
-            width="55"
-            align="center">
-          </el-table-column> -->
-          <el-table-column
-            align="center"
-            label="产品图"
-            width="80">
-            <template slot-scope="scope">
-              <previewImage class="image" :image="scope.row.attinfos[0]" :list="scope.row.attinfos" :deletebtn="false"></previewImage>
-            </template>
-          </el-table-column>
-          <el-table-column
-            prop="itemname"
-            label="产品名称"
-            width="180">
-          </el-table-column>
-          <el-table-column
-            prop="itemno"
-            label="产品编号"
-            width="180">
-          </el-table-column>
-          <el-table-column
-            label="型号/规格"
-            width="180">
-            <template slot-scope="scope">
-              <p><span>{{scope.row.model}}</span>&nbsp;/&nbsp;<span>{{scope.row.spec}}</span></p>
-            </template>
-          </el-table-column>
-          <el-table-column
-            label="数量"
-            width="150">
-            <template slot-scope="scope">
-            <el-input-number size="mini" v-model="scope.row.qty" :min="scope.row.orderminqty" :step="scope.row.orderaddqty" label="输入数量" @change="qtyChange"></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column
-            prop="unit"
-            label="计量单位"
-            width="90">
-            <template slot-scope="scope">
-              <el-tag size="mini" type="info" effect="plain">{{scope.row.unitname}}</el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column
-            prop="gradeprice"
-            label="价格"
-            width="90">
-            <template slot-scope="scope">
-              <p style="color:red;font-weight:500">¥&nbsp;{{tool.formatAmount(scope.row.gradeprice,2)}}</p>
-            </template>
-          </el-table-column>
-          <el-table-column
-            label="小计"
-            width="150">
-            <template slot-scope="scope">
-              <p style="color:red;font-weight:500">¥&nbsp;{{tool.formatAmount(scope.row.gradeprice * scope.row.qty,2)}}</p>
-            </template>
-          </el-table-column>
-          <el-table-column width="90">
-            <template slot-scope="scope">
-              <slot name="del" :data="scope.row"></slot>
-            </template>
-          </el-table-column>
-        </el-table>
+        <product-list :type="'edit'"></product-list>
       </div>
     </div>
     <div class="fixed__btn__panel">
@@ -243,11 +170,12 @@
 
 <script>
 import previewImage from '@/components/previewImage/index.vue'
-
+import productList from './productlist.vue'
 export default {
   props:['data'],
   components:{
-    previewImage
+    previewImage,
+    productList
   },
   data () {
     return {

+ 10 - 1
src/HDrpManagement/orderManage/modules/productlist.vue

@@ -33,7 +33,8 @@
         label="数量"
         width="150">
         <template slot-scope="scope">
-          {{scope.row.qty}}
+          <el-input-number v-if="type === 'edit'" size="mini" v-model="scope.row.qty" :min="scope.row.orderminqty" :step="scope.row.orderaddqty" label="输入数量" @change="qtyChange"></el-input-number>
+          <span v-else>{{scope.row.qty}}</span>
         </template>
       </el-table-column>
       <el-table-column
@@ -42,6 +43,7 @@
         width="90">
         <template slot-scope="scope">
           <el-tag size="mini" type="info" effect="plain">{{scope.row.unit}}</el-tag>
+          
         </template>
       </el-table-column>
       <el-table-column
@@ -64,6 +66,11 @@
           <slot name="del" :data="scope.row"></slot>
         </template>
       </el-table-column>
+      <el-table-column v-if="type === 'edit'" width="90" fixed="right">
+        <template slot-scope="scope">
+          <el-button type="text" size="mini" @click="deleteOrderProduct(scope.row)">删 除</el-button>
+        </template>
+      </el-table-column>
     </el-table>
     <div style="margin-top:16px;text-align:right">
       <el-pagination
@@ -82,6 +89,7 @@
 
 <script>
 export default {
+  props:['type'],
   data () {
     return {
       tableData:[],
@@ -118,6 +126,7 @@ export default {
       this.params.content.pageNumber = val
       this.listData()
     },
+    deleteOrderProduct () {},
   },
   mounted () {
     this.listData()

+ 8 - 1
src/components/normal-basic-layout/index.vue

@@ -13,7 +13,9 @@
             </div>
             <div style="margin:0 8px"></div>
             <div class="flex-align-center">
-              <cpAdd v-if="tool.checkAuth($route.name,'insert') && oldFormPath" :formPath="formPath" :oldFormPath="oldFormPath" @onAddSuccess="listData(param.content.pageNumber = 1)"></cpAdd>
+              <div v-if="oldFormPath || formPath">
+                <cpAdd v-if="tool.checkAuth($route.name,'insert')" :formPath="formPath" :oldFormPath="oldFormPath" @onAddSuccess="listData(param.content.pageNumber = 1)"></cpAdd>
+              </div>
               <el-button-group v-if="tool.checkAuth($route.name,'delete')" class="inline-16">
                 <el-button type="default" :disabled="selection.length === 0" size="small" @click="deleteData">删 除</el-button>
               </el-button-group>
@@ -230,6 +232,11 @@ export default {
       this.listData()
     }
   },
+  watch:{
+    $route () {
+      
+    }
+  },
   mounted () {
     this.autoQuery === false?'':this.listData()
   },

+ 4 - 3
src/components/normal-basic-layout/modules/cpAdd.vue

@@ -12,10 +12,12 @@ export default {
     }
   },
   computed:{
-		formComponent(){
-      console.log(this.oldFormPath)
+		formComponent () {
+      console.log(this.formPath,'formpath')
+      console.log(this.oldFormPath,'formpath')
       if (this.oldFormPath) {
         return ()=>import(`@/${this.oldFormPath.add}/add.vue`)
+        
       } else {
         return ()=>import(`@/Form/${this.formPath}/add.vue`)
       }
@@ -27,7 +29,6 @@ export default {
     }
   },
   mounted () {
-    
   }
 }