shish 2 лет назад
Родитель
Сommit
0f28b0feda
2 измененных файлов с 80 добавлено и 18 удалено
  1. 15 0
      ghs/src/service/order/index.js
  2. 65 18
      ghs/src/views/order/list.vue

+ 15 - 0
ghs/src/service/order/index.js

@@ -5,6 +5,21 @@ import { baseUrl } from '@/config/env';
 @Service('order')
 export class OrderService extends BaseService {
 
+	fh(data) {
+		return this.request({
+			url: '/fh',
+			method: 'POST',
+			data: data
+		});
+	}
+
+	modifyClearSign(data) {
+		return this.request({
+			url: '/modify-clear-sign',
+			params: data
+		});
+	}
+
 	modifyRemark(data) {
 		return this.request({
 			url: '/modify-remark',

+ 65 - 18
ghs/src/views/order/list.vue

@@ -26,6 +26,18 @@
         </div>
       </template>
 
+      <template #table-column-clearSign="{scope}">
+        <div v-if="scope.row.clearSign == 0">
+          <el-popconfirm title="确认已结算?" @confirm="updateClearSign(scope.row)">
+            <i class="el-icon-edit" style="color:#409eff;font-size:17px;cursor:pointer;" slot="reference"></i>
+          </el-popconfirm>
+        </div>
+        <div v-else>
+        <i class="el-icon-success" style="color:green;font-size:17px;"></i>
+        </div>
+      </template>
+      
+
       <template #table-column-debt="{scope}">
         <span style="color:red;font-weight:bold;font-size:13px;" v-if="scope.row.debt == 1">赊</span>
         <span v-else>-</span>
@@ -89,20 +101,32 @@
         <el-button size="small" v-else>下载</el-button>
 
         <el-button @click.stop="allDown(scope.row)" size="small" type="primary" v-if="scope.row.status!=5 && scope.row.status!=1 && scope.row.sameTimeIdsNum>1">全下载</el-button>
-        <el-button size="small" v-else>全部下载</el-button>
+        <el-button size="small" v-else>全下载</el-button>
+
+        <el-popconfirm title="确认已发货?" @confirm="confirmSend(scope.row)" v-if="scope.row.status!=5 && scope.row.status==2" style="margin-left:10px;">
+          <el-button size="small" type="primary" slot="reference">发货</el-button>
+        </el-popconfirm>
+
+        <el-button size="small" v-else>发货</el-button>
+
       </template>
 
-      <template #slot-order-book="{scope}">
+      <template #slot-search-option="{scope}">
         <el-radio-group v-model="book" @change="changeBook" style="margin-right:20px;padding-top:6px;margin-left:20px;">
-          <el-radio label="-1">全部订单</el-radio>
+          <el-radio label="-1">全部</el-radio>
           <el-radio label="0">普通订单</el-radio>
           <el-radio label="1">预订单</el-radio>
         </el-radio-group>
+        <el-radio-group v-model="clearSign" @change="changeClearSign" style="margin-right:20px;padding-top:6px;margin-left:20px;">
+        <el-radio label="-1">全部</el-radio>
+          <el-radio label="0">待结</el-radio>
+          <el-radio label="1">已结</el-radio>
+        </el-radio-group>
       </template>
 
       <template #slot-billing>
-				<el-button type="primary" size="mini" style="margin-left:50px;" @click="billing()">开单</el-button>
-        <el-button type="primary" size="mini" style="margin-left:50px;" @click="newCg()">新增采购</el-button>
+				<el-button type="primary" size="mini" style="margin-left:20px;" @click="billing()">开单</el-button>
+        <el-button type="primary" size="mini" style="margin-left:20px;" @click="newCg()">新增采购</el-button>
 			</template>
 
     </x-crud>
@@ -208,7 +232,8 @@ export default {
       ],
       optionData: {},
       orderData:'',
-      book:"-1"
+      book:"-1",
+      clearSign:"-1"
     };
   },
   created() {
@@ -228,6 +253,18 @@ export default {
 		}
 	},
   methods: {
+    confirmSend(info){
+      this.$service.order.fh({id:info.id,fhType:0}).then(data => {
+        this.$notify({ title: '操作成功', message: '', type: 'success'})
+        this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign })
+      })
+    },
+    updateClearSign(info){
+      this.$service.order.modifyClearSign({id:info.id}).then(data => {
+        this.$notify({ title: '操作成功', message: '', type: 'success'})
+        this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign })
+      })
+    },
 		newCg(){
 			let query = {}
 			this.$router.push({path:'/in/add',query})
@@ -236,9 +273,13 @@ export default {
 			let query = {}
 			this.$router.push({path:'/order/add',query})
     },
+    changeClearSign(e){
+      this.clearSign = e
+      this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign });
+    },
     changeBook(e){
       this.book = e
-      this.app.refresh({ status: this.tabIndex,book:this.book });
+      this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign });
     },
     todays(type) {
       var myDate = new Date();
@@ -289,7 +330,7 @@ export default {
         hiprintTemplate.print(printData)
 
         this.$service.order.addPrintNum({id:info.id}).then(data => {
-          this.app.refresh({ status: this.tabIndex,book:this.book })
+          this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign })
         })
 
 			});
@@ -332,7 +373,7 @@ export default {
       });
     },
     handleClick(tab, e) {
-      this.app.refresh({ status: this.tabIndex,book:this.book });
+      this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign });
     },
     onLoad({ ctx, app }) {
       this.app = app;
@@ -390,6 +431,18 @@ export default {
                 align: 'center',
                 width: '80'
               },
+              {
+                prop: 'status',
+                label: '状态',
+                align: 'center',
+                width: 70
+              },
+              {
+                prop: 'clearSign',
+                label: '结算',
+                align: 'center',
+                width: 50
+              },
               {
                 prop: 'book',
                 label: '预订',
@@ -432,12 +485,6 @@ export default {
                 label: '开单时间',
                 align: 'center',
                 width: 90
-              },
-              {
-                prop: 'status',
-                label: '状态',
-                align: 'center',
-                width: 70
               }
             ],
             on: {
@@ -456,7 +503,7 @@ export default {
             op: {
               visible: true,
               props: {
-                width: 430,
+                width: 455,
                 align: 'center',
                 fixed: 'right',
                 label: '操作'
@@ -474,7 +521,7 @@ export default {
           })
           .set('layout', [
             ['slot-tabs'],
-            ['slot-order-book','search-key','slot-billing'],
+            ['slot-search-option','search-key','slot-billing'],
             ['data-table'],
             ['flex1', 'pagination']
           ])
@@ -487,7 +534,7 @@ export default {
             this.tabsData[4].val = asset.shop.finishOrder||0;
           })
           .done();
-          app.refresh({ status: this.tabIndex,book:this.book })
+          app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign })
     },
     onSongSuccess() {