Forráskód Böngészése

Merge branch 'shizhongqi-expend'

shish 1 éve
szülő
commit
5ccf5f8632

+ 97 - 27
ghsApp/src/admin/expend/addExpend.vue

@@ -4,12 +4,10 @@
       <form @submit="formSubmit">
         <view class="module-com input-line-wrap">
 
-          <tui-list-cell class="line-cell" :hover="false" :arrow="true">
-            <view class="tui-title">类型</view>
-            <view class="tui-input" @click="changeType">
-              <text v-if="form.type == -1" style="color:#CCCCCC;">请选择</text>
-              <text v-else>{{ form.typeName }}</text>
-            </view>
+          <tui-list-cell class="line-cell" :arrow="true">
+            <div class="tui-title">类型</div>
+            <view class="uni-input" v-if="form.type==-1" style="color:#CCCCCC;width:400upx;" @click="changeType()">请选择</view>
+            <view class="uni-input" v-else @click="changeType()" style="width:400upx;">{{ form.typeName ? form.typeName : '请选择' }}</view>
           </tui-list-cell>
 
           <tui-list-cell class="line-cell" :hover="false">
@@ -41,17 +39,25 @@
           </tui-list-cell>
 
           <tui-list-cell class="line-cell" :hover="false">
-          <div class="tui-title">报销</div>
-          <radio-group class="tui-input" @change="bxChange">
-            <label class="list" for="fixedLink">
-              <radio id="fixedLink" value="0" :checked="form.bx == 0" style="transform: scale(0.7,0.7);" />
-              <span class="checkbox-text" style="font-size:30upx;">未报销</span>
-            </label>
-            <label class="list" for="dimLink">
-              <radio id="dimLink" value="1" :checked="form.bx == 1" style="transform: scale(0.7,0.7);" />
-              <span class="checkbox-text" style="font-size:30upx;">已报销</span>
-            </label>
-          </radio-group>
+            <div class="tui-title">报销状态</div>
+            <view class="tui-input">
+              <view class="bx-btn-group">
+                <button 
+                  class="bx-btn" 
+                  :class="{'selected': form.bx == 0}"
+                  @click="selectBx(0)"
+                >
+                  未报销
+                </button>
+                <button 
+                  class="bx-btn" 
+                  :class="{'selected': form.bx == 1}"
+                  @click="selectBx(1)"
+                >
+                  已报销
+                </button>
+              </view>
+            </view>
           </tui-list-cell>
 
 					<tui-list-cell class="line-cell" :hover="false" :arrow="true">
@@ -68,14 +74,23 @@
       </form>
     </view>
 
-    <uni-popup ref="typeShowMore" background-color="#fff" type="center" :animation="true" class="class-popup-style">
-		<view style="display:flex;width:100vw;padding:20upx 20upx 40upx 20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
-			<view v-for="(item, index) in typeList" :key="index" style="width:100vw;margin-top:8upx;">
-				<button @click="getType(item)">{{ item.name }}</button>
-			</view>
-			<view style="width:100vw;margin-top:30upx;margin-bottom:70upx;"><button @click="closeTypeShow()">取消</button></view>
-		</view>
-	</uni-popup>
+    <uni-popup ref="typeShowMore" background-color="#fff" type="center" :animation="false" class="class-popup-style">
+      <view style="max-height:80vh;overflow: scroll;">
+        <view style="margin-left:30upx;margin-top:19upx;font-size:27upx;font-weight:bold;">请选择:</view>
+        <view style="display:flex;padding:20upx;height:auto;justify-content: flex-start;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
+          <view v-for="(item, index) in typeList" :key="index" style="margin-bottom:20upx;margin-left:3upx;">
+            <button
+              class="admin-button-com staff-btn"
+              @click.stop="getType(item)"
+              :class="{'selected': form.type === item.id}"
+            >
+              {{ item.name }}
+            </button>
+          </view>
+        </view>
+        <view style="text-align:center;padding:10upx 0 10upx 0;"><button class="admin-button-com big blue" @click="closeTypeShow()">取消选择</button></view>
+      </view>
+    </uni-popup>
 
   <mx-date-picker :show="showPicker" format="yyyy-mm-dd" type="date" :value="defaultPickerDate" :show-tips="true" @confirm="confirmPicker" @cancel="showPicker = false" />
 
@@ -148,8 +163,8 @@ export default {
 		changeType(){
 			this.$refs.typeShowMore.open('top')
 		},
-    bxChange(e) {
-      this.form.bx = e.detail.value;
+    selectBx(value) {
+      this.form.bx = value;
     },
     init(){
       let that = this
@@ -238,4 +253,59 @@ export default {
     width: 100%;
   }
 }
+
+.staff-btn {
+  min-width: 160upx;
+  padding: 0 27upx;
+  height: 80upx;
+  font-size: 40upx;
+  font-weight: bold;
+  margin: 8upx 8upx 0 0;
+  border-radius: 16upx;
+  background: #f0f2f6;
+  color: #333;
+  border: 2upx solid #e0e0e0;
+  transition: none;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  
+  &.selected {
+    background-color: #007aff !important;
+    color: #fff !important;
+    border-color: #007aff !important;
+  }
+}
+
+.bx-btn-group {
+  display: flex;
+  gap: 8upx;
+  justify-content: flex-start;
+}
+
+.bx-btn {
+  width: 200upx;
+  height: 90upx;
+  font-size: 28upx;
+  border-radius: 12upx;
+  background: #f0f2f6;
+  color: #333;
+  border: 2upx solid #e0e0e0;
+  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  padding: 0 20upx;
+  white-space: nowrap;
+  
+  &.selected {
+    background-color: #007aff !important;
+    color: #fff !important;
+    border-color: #007aff !important;
+  }
+  
+  &:active {
+    opacity: 0.8;
+  }
+}
 </style>

+ 42 - 3
ghsApp/src/admin/expend/list.vue

@@ -12,7 +12,7 @@
     </view>
 	<block v-if="!$util.isEmpty(list.data)">
 		<view v-for="(item, index) in list.data" :key="index">
-			<view style="background-color: white;margin-bottom:15upx;padding:18upx 0 18upx 30upx;font-size:28upx;">
+			<view style="background-color: white;margin-bottom:15upx;padding:18upx 0 18upx 30upx;font-size:28upx;position:relative;">
 				<view style="font-weight:bold;font-size:32upx;">
 					<text>{{item.typeName}}</text>
 					<text style="margin-left:20upx;">¥{{item.amount?parseFloat(item.amount):0}}</text>
@@ -29,6 +29,12 @@
 				<view style="margin-top:8upx;">支付:{{item.payWay==0?'线下微信':item.payWay == 4 ? '现金':item.payWay == 1?'线下支付宝':item.payWay == 5 ? '银行卡':''}}</view>
 				<view v-if="item.bx == 0" style="margin-top:8upx;">报销:待报销</view>
 				<view v-else style="margin-top:8upx;">报销:已报销</view>
+				<button
+					@click="deleteExpend(item, index)"
+					class="expend-delete-btn"
+				>
+					删除
+				</button>
 			</view>
 		</view>
 	</block>
@@ -68,7 +74,7 @@
 
 <script>
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
-import { getExpendList,getTypeList,changePayTime } from '@/api/expend'
+import { getExpendList,getTypeList,changePayTime,deleteExpend } from '@/api/expend'
 import list from '@/mixins/list'
 import { getAllStaff } from "@/api/shop-admin"
 import DateSelect from "@/components/module/dateSelect"
@@ -218,7 +224,26 @@ export default {
 				return
 			}
 			this.completes(res)
-		}
+		},
+		async deleteExpend(item, index) {
+			const that = this;
+			uni.showModal({
+				title: '提示',
+				content: '确认要删除?系统将会记录由谁删除',
+				success: async function (res) {
+					if (res.confirm) {
+						const result = await deleteExpend({ id: item.id, staffId: item.staffId });
+						if (result.code === 1) {
+							that.$msg('删除成功');
+							that.resetList();
+							that.init();
+						} else {
+							that.$msg(result.msg || '删除失败');
+						}
+					}
+				}
+			});
+		},
 	},
 	async onPullDownRefresh() {
 		this.resetList();
@@ -243,4 +268,18 @@ export default {
 .class-popup-style{
 	z-index:99999;
 }
+.expend-delete-btn {
+	position: absolute;
+	right: 30upx;
+	top: 80%;
+	transform: translateY(-50%);
+	width: 120upx;
+	height: 60upx;
+	background: #fff;
+	border: 2upx solid #ccc;
+	border-radius: 16upx;
+	color: #ac2929;
+	font-size: 30upx;
+	line-height: 56rpx;
+}
 </style>

+ 9 - 9
ghsApp/src/admin/shop/add.vue

@@ -94,12 +94,12 @@
 					</view>
 				</tui-list-cell>
 
-				<tui-list-cell class="line-cell" :hover="false">
+				<!-- <tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title">显示库存</view>
 					<view>
 						<switch style="transform:scale(0.7,0.7)" :checked="form.showStock == 0 ? false : true" @change="showStockChange" /> {{form.showStock==1 ? '是' : '否'}}
 					</view>
-				</tui-list-cell>
+				</tui-list-cell> 
 
 				<tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title">默认享受价格</view>
@@ -113,7 +113,7 @@
 					<view>
 						<switch style="transform:scale(0.7,0.7)" :checked="form.allowDebt == 0 ? false : true" @change="allowDebtChange" /> {{form.allowDebt==0 ? '不能' : '允许'}}
 					</view>
-				</tui-list-cell>
+				</tui-list-cell> -->
 
 
 				<tui-list-cell class="line-cell" :hover="false" v-if="form.allowDebt == 1">
@@ -121,12 +121,12 @@
 					<input type="number" v-model="form.allowDebtAmount" @focus="form.allowDebtAmount=''" placeholder-class="phcolor" class="tui-input" name="allowDebtAmount" placeholder="请填写金额" />
 				</tui-list-cell>
 
-				<tui-list-cell class="line-cell" :hover="false">
+				<!-- <tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title">默认新客要审</view>
 					<view>
 						<switch style="transform:scale(0.7,0.7)" :checked="form.needCheck == 0 ? false : true" @change="needCheckChange" /> {{form.needCheck==0 ? '不要' : '需要'}}
 					</view>
-				</tui-list-cell>
+				</tui-list-cell> -->
 
 				<tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title">车销身份</view>
@@ -149,12 +149,12 @@
 					</view>
 				</tui-list-cell>
 
-				<tui-list-cell class="line-cell" :hover="false">
+				<!-- <tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title">显示销量</view>
 					<view>
 						<switch style="transform:scale(0.7,0.7)" :checked="form.showSold == 0 ? false : true" @change="showSoldChange" /> {{form.showSold==1 ? '是' : '否'}}
 					</view>
-				</tui-list-cell>
+				</tui-list-cell> -->
 
 				<tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title">自主售后申请</view>
@@ -182,12 +182,12 @@
 					</view>
 				</tui-list-cell>
 
-				<tui-list-cell class="line-cell" :hover="false">
+				<!-- <tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title">线下开单超欠</view>
 					<view>
 						<switch style="transform:scale(0.7,0.7)" :checked="form.overAllowDebt == 0 ? false : true" @change="overAllowDebtChange" /> {{form.overAllowDebt==1 ? '允许' : '禁止'}}
 					</view>
-				</tui-list-cell>
+				</tui-list-cell> -->
 
 				<tui-list-cell class="line-cell" :hover="false">
 					<view class="tui-title " style="color:#3385FF;">整单满扎数</view>

+ 4 - 0
ghsApp/src/api/expend/index.js

@@ -32,6 +32,10 @@ export const getExpendList = data => {
 	return https.get('/expend/list', data)
 }
 
+export const deleteExpend = data => {
+	return https.post('/expend/del-expend', data)
+}
+
 export const changePayTime = data => {
 	return https.get('/expend/change-pay-time', data)
 }