ソースを参照

Merge remote-tracking branch 'origin/mergeBranch' into mergeBranch

qymljy 2 年 前
コミット
3b20ee1213

+ 30 - 4
src/HDrpManagement/orderManage/details/index.vue

@@ -17,7 +17,7 @@
         @onEditSuccess="queryMainData($route.query.id)">
       <div slot="customOperation" class="inline-16">
         <el-button v-if="tool.checkAuth($route.name,'examine')" :disabled="mainData.status !== '提交'" type="primary" size="mini" @click="onSubmit('审核')">审 核</el-button>
-        <el-button v-if="tool.checkAuth($route.name,'reback')" :disabled="mainData.status !== '审核'" type="primary" size="mini">退 回</el-button>
+        <el-button v-if="tool.checkAuth($route.name,'reback')" :disabled="mainData.status !== '提交'" type="primary" size="mini" @click="dialogVisible = true">退 回</el-button>
         <el-button v-if="tool.checkAuth($route.name,'submit')" :disabled="mainData.status !== '新建'"  type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
         <el-button v-if="tool.checkAuth($route.name,'close')" type="primary" size="mini">关 闭</el-button>
       </div>
@@ -28,6 +28,13 @@
         <product-list></product-list>
       </div>
     </basicDetails>
+    <el-dialog append-to-body title="退回原因" :visible.sync="dialogVisible" width="400px">
+      <el-input v-model="backreason" type="textarea" placeholder="请输入退回原因"></el-input>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false" size="small">取 消</el-button>
+        <el-button type="primary" @click="onRebanck" size="small">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -40,7 +47,9 @@ export default {
   data() {
     return {
       mainData:{},
-      mainAreaData:{}
+      mainAreaData:{},
+      backreason:'',
+      dialogVisible:false
     }
   },
   components:{
@@ -99,8 +108,8 @@ export default {
       this.$router.replace({path:'/orderdetail',query:{id:id,rowindex:rowindex}})
       this.queryMainData(id)
     },
+    // 提交审核订单
     onSubmit (type) {
-      
       this.$confirm(`是否${type}该订单`, '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -123,7 +132,24 @@ export default {
           message: err
         });          
       });
-    }
+    },
+    async onRebanck () {
+      const res = await this.$api.requested({
+        "id": 20221108161902,
+        "content": {
+          "sys_enterpriseid":this.mainData.sys_enterpriseid,
+          "sa_accountclassid":this.mainData.accountclass.sa_accountclassid,
+          "sa_orderid": this.mainData.sa_orderid,
+          "backreason": this.backreason //退回原因,可选
+        },
+      })
+      this.tool.showMessage(res,()=>{
+        this.queryMainData()
+        this.dialogVisible = false
+      })
+    },
+    
+
   },
   mounted () {
     this.queryMainData(this.$route.query.id)

+ 7 - 7
src/HDrpManagement/orderManage/modules/edit.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-button type="primary" size="mini" @click="onShow(drawer = true)">编辑</el-button>
+    <el-button :disabled="data.status !=='新建'" type="primary" size="mini" @click="onShow(drawer = true)">编辑</el-button>
     <el-drawer
     :visible.sync="drawer"
     direction="rtl"
@@ -162,10 +162,10 @@
         </div>
         <el-row :gutter="10">
           <el-col :span="setcol">
-            <product-list ref="prolist" :type="'edit'" @onSuccess="onSuccess"></product-list>
+            <product-list ref="prolist" :type="'edit'" @onSuccess="onDelSuccess"></product-list>
           </el-col>
           <el-col :span="24 - setcol">
-            <add-product @onConfirm="onConfirm"></add-product>
+            <add-product ref="addpro" @onConfirm="onConfirm"></add-product>
           </el-col>
         </el-row>
       </div>
@@ -310,12 +310,13 @@ export default {
         this.drawer = false
       })
     },
-    onSuccess () {
-      this.$emit('onSuccess')
+    onDelSuccess () {
+      this.$refs.addpro.listData()
     },
     addMoreProduct () {
       this.setcol = 12
     },
+    // 订单添加商品
     async onConfirm (data) {
       const res = await this.$api.requested({
         "id": 20221109093602,
@@ -327,7 +328,7 @@ export default {
             return {
               sa_orderitemsid:0,
               itemid:e.itemid,
-              qty:0
+              qty:e.orderminqty
             }
           })
         },
@@ -335,7 +336,6 @@ export default {
       this.tool.showMessage(res,()=>{
         this.setcol = 24
         this.$refs['prolist'].listData()
-        this.$emit('onSuccess')
       })
     }
   },

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

@@ -23,8 +23,7 @@
         width="180">
       </el-table-column>
       <el-table-column
-        label="型号/规格"
-        width="180">
+        label="型号/规格">
         <template slot-scope="scope">
           <p><span>{{scope.row.model}}</span>&nbsp;/&nbsp;<span>{{scope.row.spec}}</span></p>
         </template>
@@ -61,11 +60,6 @@
           <p style="color:red;font-weight:500">¥&nbsp;{{tool.formatAmount(scope.row.price * 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-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>