shish 2 лет назад
Родитель
Сommit
1646096dfd
3 измененных файлов с 45 добавлено и 7 удалено
  1. 14 0
      ghs/src/service/purchase-order/index.js
  2. 3 1
      ghs/src/views/in/change.vue
  3. 28 6
      ghs/src/views/in/list.vue

+ 14 - 0
ghs/src/service/purchase-order/index.js

@@ -24,5 +24,19 @@ export class PurchaseOrderService extends BaseService {
 		});
 	}
 
+	cancelOrder(data) {
+		return this.request({
+			url: '/cancel',
+			params: data
+		});
+	}
+
+	printBill(data) {
+		return this.request({
+			url: '/print-bill',
+			params: data
+		});
+	}
+
 }
 export default new PurchaseOrderService();

+ 3 - 1
ghs/src/views/in/change.vue

@@ -51,7 +51,9 @@
                 </el-table-column>
             </el-table>
             <div style="text-align:left;margin-top:18px;">
-                <el-button @click="goBackFn" plain>稍后入库</el-button>
+                <el-button @click="goBackFn" plain v-if="info.status != 3">返回</el-button>
+				<el-button @click="goBackFn" plain v-else>稍后入库</el-button>
+
                 <el-button v-if="info.status == 3" type="success" @click="savePrice">保存价格,稍后入库</el-button>
                 <el-button v-if="info.status == 3" type="danger" @click="confirmIn">仅入库不改价</el-button>
                 <el-button v-if="info.status != 3" type="primary" @click="commitChange(2)">确认改价</el-button>

+ 28 - 6
ghs/src/views/in/list.vue

@@ -3,7 +3,7 @@
     <x-crud class="liu-crud-wrap order-list-wrap" @load="onLoad">
 
       <template #slot-tabs>
-        <el-tabs class="liu-tabs" type="border-card" v-model="tabIndex" @tab-click="handleClick">
+        <el-tabs class="liu-tabs" type="border-card" v-model="tabIndex" @tab-click="changeTab">
           <el-tab-pane
               v-for="(item, index) in tabsData"
               :key="index"
@@ -55,9 +55,18 @@
       </template>
 
       <template #slot-column-option="{scope}">
-        <el-button @click.stop="changePrice(scope.row)" size="small" type="primary">改价入库</el-button>
+
+        <el-button size="small" v-if="scope.row.status == 5">改价入库</el-button>
+        <el-button @click.stop="changePrice(scope.row)" size="small" type="success" v-else-if="scope.row.status == 4">修改价格</el-button>
+        <el-button @click.stop="changePrice(scope.row)" size="small" type="primary" v-else>改价入库</el-button>
+
         <el-button @click.stop="detailShowFn(scope.row)" size="small" type="success">详情</el-button>
-        <el-button @click.stop="detailShowFn(scope.row)" size="small" type="primary">取消</el-button>
+        
+        <el-button size="small" v-if="scope.row.status == 5 || scope.row.status == 1">打小票</el-button>
+        <el-button @click.stop="printOrder(scope.row)" size="small" type="primary" v-else>打小票</el-button>
+
+        <el-button @click.stop="cancelOrder(scope.row)" size="small" type="primary" v-if="scope.row.status == 3 || scope.row.status == 2 || scope.row.status == 1">取消</el-button>
+        <el-button size="small" v-else>取消</el-button>
       </template>
 
       <template #slot-new-cg>
@@ -143,13 +152,26 @@ export default {
       query.backType = 'list'
       this.$router.push({path:'/in/change',query})
     },
+    printOrder(item){
+      this.$service.purchaseOrder.printBill({id:item.id}).then(data => {
+          this.$notify({ title: '已打小票', message: '操作成功', type: 'success'})
+        })
+    },
+    cancelOrder(item){
+			this.$confirm('确认取消?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
+        this.$service.purchaseOrder.cancelOrder({id:item.id}).then(data => {
+          this.$notify({ title: '已取消', message: '操作成功', type: 'success'})
+          this.app.refresh({ status: this.tabIndex})
+        })
+			})
+    },
     detailShowFn(item) {
       this.optionData = item;
       setTimeout(() => {
         this.$refs.orderDetail.init();
       });
     },
-    handleClick(tab, e) {
+    changeTab(tab, e) {
       this.app.refresh({ status: this.tabIndex});
     },
     onLoad({ ctx, app }) {
@@ -164,7 +186,7 @@ export default {
                 prop: 'orderSn',
                 label: '单号',
                 align: 'center',
-                width: '160'
+                width: '130'
               },
               {
                 prop: 'supplierName',
@@ -244,7 +266,7 @@ export default {
             op: {
               visible: true,
               props: {
-                width: 300,
+                width: 320,
                 align: 'center',
                 fixed: 'right',
                 label: '操作'