Jelajahi Sumber

解决问题 533 530

wangning 5 tahun lalu
induk
melakukan
255250c05e

+ 8 - 1
ghsApp/src/api/ghs/index.js

@@ -1,8 +1,15 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
 /** *
- * 供货商列表 姜枫 2021.04.01
+ * 供货商列表 姜枫 2021.04.01  ghs/add
  */
 export const getList = data => {
 	return https.get('/ghs/list', data)
 }
+
+/** *
+ * 添加供货商 汪宁 2021.06.11  
+ */
+ export const ghsAdd = data => {
+	return https.post('/ghs/add', data)
+}

+ 8 - 1
ghsApp/src/pages.json

@@ -635,12 +635,19 @@
 					}
 				},
         {
-					"path": "supplier",  
+					"path": "supplier",
 					"style": {
 						"navigationBarTitleText": "供货商",
 						"enablePullDownRefresh": true
 					}
 				},
+        {
+					"path": "suppAdd",  
+					"style": {
+						"navigationBarTitleText": "添加供货商",
+						"enablePullDownRefresh": true
+					}
+				},
 				{
 					"path": "info",
 					"style": {

+ 4 - 0
ghsApp/src/pagesClient/official/apply.vue

@@ -260,6 +260,9 @@ export default {
       });
     },
     confirmFn () {
+      uni.showLoading({
+        title:"加载中..."
+      })
       applyRegister({
         hdShopAdminId: this.option.hdShopAdminId,
         ghsShopAdminId: this.option.ghsShopAdminId,
@@ -267,6 +270,7 @@ export default {
         style: this.option.style || 0,
         from: this.option.from || 0
       }).then(res => {
+        uni.hideLoading()
         this.$util.pageTo({
           url: "/pagesClient/official/result",
           type: 2,

+ 32 - 57
ghsApp/src/pagesPurchase/supplier.vue

@@ -5,13 +5,14 @@
       class="order_list"
       scroll-view
     >
+    <block>
         <!-- 供货商列表 -->
-        <!-- <block v-if="!$util.isEmpty(supplierList)"> -->
-          <!-- <view
+        <block v-if="!$util.isEmpty(supplierList)">
+          <view
             class="list_item"
             v-for="(item, index) in supplierList"
             :key="index"
-            @click="enter(item)"
+            @click="gotoDetails"
           >
             <image :src="item.avatar"></image>
             <view class="store_name">
@@ -19,70 +20,42 @@
               <view class="accumulative">欠款: {{item.debtAmount}}</view>
             </view>
             <view class="store_btn">
-              <view class="btn_entrance" v-if="Number(item.debtAmount) > 0" @click.stop="settleAccounts(item)" >
+              <view class="btn_entrance" v-if="Number(item.debtAmount) > 0" @click.stop="gotoDetailsEvent(item)" >
                 结账
               </view>
               <view class="btn_entrance btn_forbid" v-else @click.stop="" >
                 结账
               </view>
-              <view class="btn_entrance" @click.stop="enter(item)" >
-                采购
-              </view>
-            </view>
-          </view> -->
-          <view class="list_item" v-for="(item, index) in 8" :key="index">
-            <image src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3015225555,4165558783&fm=26&gp=0.jpg"></image>
-            <view class="store_name">
-              <view class="store_title">明星花卉</view>
-              <view class="accumulative">欠款: 5800</view>
-            </view>
-            <view class="store_btn">
-              <view class="btn_entrance">
-                结账
-              </view>
-              <view class="btn_entrance">
+              <view class="btn_entrance" @click.stop="gotoDetails" >
                 采购
               </view>
             </view>
           </view>
-        <!-- </block> -->
-        <!-- <block v-else> -->
-          <!-- <AppWrapperEmpty
+        </block>
+        <block v-else>
+          <AppWrapperEmpty
             title="暂无数据"
             :is-empty="$util.isEmpty(supplierList)"
-          /> -->
-        <!-- </block> -->
+          />
+        </block>
+      </block>
     </scroll-view>
     <!-- 按钮 -->
 			<div class="app-footer">
-				<div class="admin-button-com middle blue">添加供货商</div>
+				<div class="admin-button-com middle blue" @click="add">添加</div>
 			</div>
   </view>
 </template>
 
 <script>
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
-import { ghsList, purchaseList } from "@/api/purchase/index";
+import { getList } from "@/api/ghs";
 export default {
   components: {
     AppWrapperEmpty,
   },
   data () {
     return {
-      tabs: [
-        {
-          name: "供货商",
-          key: "",
-        },
-        {
-          name: "采购记录",
-          key: "1",
-        },
-        {
-          name: "111",
-          key: "1",
-        },
-      ],
       list: {
         data: []
       },
@@ -96,32 +69,34 @@ export default {
     })
   },
   methods: {
-    enter (item) {
-      const { id } = item
-					uni.navigateTo({url:`/pagesPurchase/ghsProduct?id=${id}`, type: 2 })
-      // this.pageTo({ url: `/pagesPurchase/ghsProduct?id=${id}`, type: 2 })
+    init() {
+      this.getGHSList()
     },
-    // init() {
-    //   this.getGHSList()
-    // },
     getGHSList () {
-      return ghsList().then(res => {
+      return getList().then(res => {
         this.supplierList = res.data.list
         console.log(this.supplierList, 111)
       }).catch(err => { console.log(err) })
     },
-    // 结账
-    settleAccounts (item) {
+    gotoDetailsEvent(item) {
+			uni.navigateTo({
+				url: `/pagesArrears/details?id=${item.id}`,
+				success: result => {},
+				fail: () => {},
+				complete: () => {}
+			});
+		},
+    // 采购记录详情
+    gotoDetails () {
       this.pageTo({
-        url: '/pagesPurchase/gathering?id='+item.id,
+        url: '/pagesPurchase/add',
+        type:2
       })
     },
-    // 采购记录详情
-    gotoDetails (val) {
-      console.log(val)
+    // 添加供货商
+    add() {
       this.pageTo({
-        url: '/pagesPurchase/purDetails?status=' + val.status + '&id=' + val.id,
-        type:2
+        url: '/pagesPurchase/suppAdd'
       })
     }
   }

+ 1 - 1
ghsApp/src/pagesStorehouse/inventory/update.vue

@@ -269,7 +269,7 @@ export default {
 			// price = Math.round(sum * 100) / 100;
 			// let stockSum = Number(bigNum) * Number(bigPrice) + Number(smallNum) * Number(smallPrice);
 			// let stockPrice = Math.round(stockSum * 100) / 100;
-			let diff = `${bigNumProfitLoss.toFixed(2)}/${smallNumProfitLoss.toFixed(2)}`;
+			let diff = `${bigNumProfitLoss}/${smallNumProfitLoss}`;
 			// let diff = `${bigNumProfitLoss}/${smallNumProfitLoss}`;
 			return diff;
 		},

+ 4 - 0
hdApp/src/pagesClient/official/apply.vue

@@ -224,6 +224,9 @@ export default {
       })
     },
     confirmFn() {
+      uni.showLoading({
+        title:"加载中..."
+      })
       applyRegister({
         hdShopAdminId: this.option.hdShopAdminId,
         ghsShopAdminId: this.option.ghsShopAdminId,
@@ -231,6 +234,7 @@ export default {
         style: this.option.style || 0,
         from: this.option.from || 0,
       }).then((res) => {
+        uni.hideLoading()
         this.$util.pageTo({
           url: "/pagesClient/official/result",
           type: 2,

+ 1 - 1
hdApp/src/pagesStorehouse/inventory/update.vue

@@ -274,7 +274,7 @@ export default {
 			// price = Math.round(sum * 100) / 100;
 			// let stockSum = Number(bigNum) * Number(bigPrice) + Number(smallNum) * Number(smallPrice);
 			// let stockPrice = Math.round(stockSum * 100) / 100;
-			let diff = `${bigNumProfitLoss.toFixed(2)}/${smallNumProfitLoss.toFixed(2)}`;
+			let diff = `${bigNumProfitLoss}/${smallNumProfitLoss}`;
 			// let diff = `${bigNumProfitLoss}/${smallNumProfitLoss}`;
 			return diff;
 			// return Math.round(diff * 100) / 100;