shish 4 лет назад
Родитель
Сommit
3cd6afc4b1

+ 31 - 198
ghsApp/src/admin/expend/addExpend.vue

@@ -1,225 +1,58 @@
 <template>
-  <div class="app-content">
-    <div v-show="showStaffArea">
+  <view class="app-content">
+    <view>
       <form @submit="formSubmit">
-        <div class="module-com input-line-wrap">
+        <view class="module-com input-line-wrap">
 
-          <tui-list-cell class="line-cell" :hover="false">
-              <div class="tui-title required">昵称</div>
-              <input v-model="form.name" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="name" placeholder="员工昵称" />
-          </tui-list-cell>
-
-          <tui-list-cell class="line-cell" :arrow="true">
-            <div class="tui-title required">角色</div>
-            <picker mode="selector" :value="form.roleId" :range="roleList" range-key="roleName" @change="changeRoleFn" class="tui-input" >
-              <input v-model="form.roleId" name="roleId" type="text" hidden />
-              <div v-if="form.roleId">{{ roleSelData.roleName }}</div>
-              <div class="tui-placeholder" v-else>请选择</div>
-            </picker>
-          </tui-list-cell>
-
-          <tui-list-cell class="line-cell" :hover="false">
-            <div class="tui-title">超管权限</div>
-            <view><switch style="transform:scale(0.7,0.7)" :checked="form.super == 0 ? false : true" @change="superChangeFn" /></view>
-          </tui-list-cell>
-
-          <tui-list-cell class="line-cell" :hover="false">
-            <div class="tui-title">动态通知</div>
-            <view><switch style="transform:scale(0.7,0.7)" :checked="form.remind == 0 ? false : true" @change="remindChangeFn" /></view>
-          </tui-list-cell>
-
-          <tui-list-cell class="line-cell" :hover="false">
-              <div class="tui-title required">手机号</div>
-              <input v-model="form.mobile" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="mobile" placeholder="员工手机号" />
+          <tui-list-cell class="line-cell" :hover="false" :arrow="false">
+            <view class="tui-title">类型</view>
+            <button class="admin-button-com middle" :class="form.type == 3? 'blue' : 'default'">伙食</button>
+            <button class="admin-button-com middle" :class="form.type == 0 ? 'blue' : 'default'">店租</button>
+            <button class="admin-button-com middle" :class="form.type == 1? 'blue' : 'default'">水电</button>
+            <button class="admin-button-com middle" :class="form.type == 2? 'blue' : 'default'">物业</button>
+            <button class="admin-button-com middle" :class="form.type == 4? 'blue' : 'default'">房租</button>
+            <button class="admin-button-com middle" :class="form.type == 5? 'blue' : 'default'">其它</button>
           </tui-list-cell>
 
           <tui-list-cell class="line-cell" :hover="false">
-              <div class="tui-title required">验证码</div>
-              <input v-model="form.authCode" type="number" style="width:330upx;" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="authCode" placeholder="员工收到的验证码" />
-              <button v-if="hasGet == false" class="admin-button-com blue middle" @click="requestAuthCode()">获取</button>
-              <button v-else class="admin-button-com default middle" >{{count}}</button>
+              <view class="tui-title">金额</view>
+              <input v-model="form.amount" type="digit" @focus="form.amount=''" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="amount" placeholder="请填写" />
           </tui-list-cell>
 
           <tui-list-cell class="line-cell remark-wrap" :hover="false">
-            <div class="tui-title">备注信息</div>
-            <div class="tui-input">
-              <textarea v-model="form.remark" style="height:80upx;" class="tui-textarea remark" placeholder-class="phcolor" placeholder="选填" />
-            </div>
+            <view class="tui-title">备注</view>
+            <view class="tui-input">
+              <textarea v-model="form.remark" @focus="form.remark=''" style="height:80upx;" class="tui-textarea remark" name="remark" placeholder-class="phcolor" placeholder="选填" />
+            </view>
           </tui-list-cell>
 
-        </div>
-        <div class="confirm-btn">
+        </view>
+        <view class="confirm-btn">
           <button class="admin-button-com big blue" formType="submit">添加</button>
-        </div>
+        </view>
       </form>
-    </div>
-    <div v-show="showMiniCodeArea">
-      <view style="text-align:center;">
-          <image style="width:400upx;height:400upx;margin:0 auto;" :src="miniCodeSrc"></image>
-          <view style="text-align:center;margin-top:20upx;margin-bottom:20upx;font-size:30upx;">请让员工扫描上方太阳码完成添加</view>
-          <button class="admin-button-com big blue" @click="complete" style="padding-left:40upx;padding-right:40upx;">完成</button>
-      </view>
-    </div>
-  </div>
+    </view>
+  </view>
 </template>
 <script>
 import TuiListCell from "@/components/plugin/list-cell";
-import AppAvatarModule from "@/components/module/app-avatar";
-const form = require("@/utils/formValidation.js");
-import { getRoleList, getStaffDet as getDet } from "@/api/staff";
-import { getDet as getMemberDet } from "@/api/member";
-import { getStaffAuthCode,createStaff } from "@/api/staff";
 export default {
-  name: "staff-add",
+  name: "addExpend",
   components: {
-    TuiListCell,
-    AppAvatarModule
+    TuiListCell
   },
   data() {
     return {
-      form: {
-        roleId: "",
-        remind: 1,
-        password: "",
-        status: 1,
-        remark: "",
-        name:'',
-        mobile:'',
-        super:0
-      },
-      roleList: [],
-      roleSelData: {},
-      showStaffArea: true,
-      showMiniCodeArea: false,
-      miniCodeSrc:'',
-      memberData: {},
-      hasGet:false,
-      INT:null,
-      count:0
+      form:{
+        //0店租 1水电 2物业 3伙食 4房租 5其它
+        type:3,
+        amount:'',
+        remark:''
+      }
     };
   },
-  onLoad() {},
-  onShow() {
-  },
   methods: {
-    superChangeFn(e){
-      this.form.super = e.detail.value ? 1 : 0;
-    },
-    requestAuthCode(){
-      let that = this
-      let mobile = this.form.mobile
-      if(this.$util.checkMobile(mobile) == false){
-        this.$msg('请输入正确手机号')
-        return
-      }
-      getStaffAuthCode({mobile}).then(res=>{
-        if(res.code == 1){
-          that.hasGet = true
-          that.count = 120
-          that.INT = setInterval(function(){
-            if(that.count <= 0){
-              clearInterval(that.INT)
-              that.hasGet = false
-              that.count = 120
-              return
-            }
-            that.count--
-          },1000)
-        }
-      })
-    },
-    init() {
-      let data = uni.getStorageSync("addStaffData");
-      if (data) {
-        uni.removeStorageSync("addStaffData");
-        this.form = data.form;
-        this.roleList = data.roleList;
-        this.roleSelData = data.roleSelData;
-      }
-      let memberData = uni.getStorageSync("addSelMember");
-      if (memberData) {
-        uni.removeStorageSync("addSelMember");
-        this.memberData = memberData;
-        this.form.userId = memberData.id;
-      }
-      if (data){
-        return false;
-      } 
-      this._getRoleList().then(res => {
-        if (this.option.id) {
-          this._getDet();
-        }
-      });
-    },
-    async _getRoleList() {
-      await getRoleList().then(res => {
-        if (this.$util.isEmpty(res.data)) return false;
-        this.roleList = res.data.list;
-      });
-    },
-    _getDet() {
-      getDet({ id: this.option.id }).then(res => {
-        if (this.$util.isEmpty(res.data)) return;
-        Object.keys(this.form).forEach((i, index) => {
-          this.form[i] = res.data[i];
-        });
-        this.roleSelData = this.roleList.filter(
-          e => this.form.roleId == e.id
-        )[0];
-
-        if (this.form.userId && this.form.userId != "0") {
-          this._getMemberDet();
-        }
-      });
-    },
-    _getMemberDet() {
-      getMemberDet({ userId: this.form.userId }).then(res => {
-        if (this.$util.isEmpty(res.data)) return;
-        this.memberData = res.data;
-      });
-    },
-    selMemberFn() {
-      let data = {
-        form: this.form,
-        roleList: this.roleList,
-        roleSelData: this.roleSelData
-      };
-      uni.setStorageSync("addStaffData", data);
-      this.$util.pageTo(1);
-    },
-    changeRoleFn(e) {
-      this.roleSelData = this.roleList[e.detail.value];
-      this.form.roleId = this.roleSelData.id;
-    },
-    remindChangeFn(e) {
-      this.form.remind = e.detail.value ? 1 : 0;
-    },
-    statusChangeFn(e) {
-      this.form.status = e.detail.value ? 1 : 0;
-    },
-    complete(){
-      this.$util.pageTo(1)
-    },
-    formSubmit(e) {
-      let that = this
-      let rules = [{ name: "roleId", rule: ["required"], msg: ["请选择角色"] }]
-      let formData = e.detail.value;
-      let checkRes = form.validation(formData, rules);
-      if (!checkRes) {
-        uni.showLoading({mask:true});
-        createStaff(that.form).then(res => {
-          uni.hideLoading()
-          if(res.code == 1){
-            that.$msg('添加成功')
-            setTimeout(() => {
-              uni.navigateBack()
-            }, 1000)
-          }
-        })
-      } else {
-        this.$msg(checkRes);
-      }
-    }
+ 
   }
 };
 </script>

+ 2 - 2
ghsApp/src/admin/expend/addSalary.vue

@@ -13,7 +13,7 @@
 							</view>
 						</view>
 						<view class="list-det-right">
-							<input type="digit" v-model="item.amount" style="border:1upx solid #cccccc;height:60upx;" placeholder="请填写工资"/>
+							<input type="digit" v-model="item.amount" style="border:1upx solid #cccccc;height:60upx;width:300upx;color:#333333;font-size:30upx;" placeholder="请填写工资"/>
 						</view>
 					</view>
 				</view>
@@ -91,7 +91,7 @@ export default {
 				this.$msg('请填写工资')
 				return false
 			}
-			this.$util.confirmModal({content:'确认提交?'},() => {
+			this.$util.confirmModal({content:'确认填写无误?'},() => {
 				addSalary({data:JSON.stringify(params)}).then(res=>{
 					if(res.code == 1){
 						this.$msg("提交成功");

+ 8 - 0
ghsApp/src/admin/expend/list.vue

@@ -28,6 +28,11 @@
 		<block v-else>
 			<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
 		</block>
+
+		<view class="app-footer open_btn">
+			<view @click="addExpend" class="admin-button-com big blue" style="width:230upx;">新增</view>
+		</view>
+
 	</view>
 </template>
 
@@ -46,6 +51,9 @@ export default {
 		};
 	},
 	methods: {
+		addExpend(){
+			this.$util.pageTo({url: '/admin/expend/addExpend'})
+		},
 		async init(){
 			const res = await changeList({
 				page:this.list.page,tx:0

+ 2 - 1
ghsApp/src/admin/home/apply.vue

@@ -44,7 +44,7 @@ export default {
                     title:'支出',
                     list:[
                         {name: "工资",img: `${this.$constant.imgUrl}/ghs/home/kcyjs.png`,url: "/admin/expend/salary"},
-                        {name: "店租水电伙食",img: `${this.$constant.imgUrl}/ghs/home/kcyjs.png`,url: "/admin/expend/list"},
+                        {name: "支出登记",img: `${this.$constant.imgUrl}/ghs/home/kcyjs.png`,url: "/admin/expend/list"},
                     ]
                 },
                 {
@@ -78,6 +78,7 @@ export default {
                         {name: "供应商",img: `${this.$constant.imgUrl}/ghs/home/icon_ghs.png`,url: "/pagesPurchase/supplier"},
                         {name: "采购单",img: `${this.$constant.imgUrl}/ghs/home/icon_caigou.png`,url: "/pagesPurchase/order"},
                         {name: "采购设置",img: `${this.$constant.imgUrl}/ghs/home/icon_caigou.png`,url: "/admin/cg/set"},
+                        {name: "采购结账单",img: `${this.$constant.imgUrl}/ghs/home/kcyjs.png`,url: "/admin/clear/list"}
                     ]
                 },
                 {

+ 1 - 1
ghsApp/src/admin/home/workbench.vue

@@ -149,7 +149,7 @@ export default {
 				{ name: "出库记录", img: 'ghs/home/dbck.png', url: "/pagesStorehouse/allot/allotEx" },
 				{ name: "入库记录", img: 'ghs/home/dbrk.png', url: "/pagesStorehouse/allot/allotPut" },
 				{name : "销售结账单", img : "ghs/home/kcyjs.png", url : "/admin/clear/customList"},
-				{name : "采购结账单", img : "ghs/home/kcyjs.png", url : "/admin/clear/list"},
+				{name : "支出登记", img : "ghs/home/kcyjs.png", url : "/admin/expend/addExpend"},
 			],
 			totalData: [
 				{ name: "客户数", value: 0, url:'/admin/home/member', type:4 },

+ 1 - 1
ghsApp/src/pages.json

@@ -385,7 +385,7 @@
 		{
 			"root": "admin/expend",
 			"pages": [
-				{"path": "addExpend","style": {"navigationBarTitleText": "登记支出"}},
+				{"path": "addExpend","style": {"navigationBarTitleText": "支出登记"}},
 				{"path": "addSalary","style": {"navigationBarTitleText": "发工资"}},
 				{"path": "salary","style": {"navigationBarTitleText": "发工资记录"}},
 				{"path": "list","style": {"navigationBarTitleText": "支出记录"}}