shish hace 2 años
padre
commit
dc900b5fb8
Se han modificado 3 ficheros con 94 adiciones y 63 borrados
  1. 5 2
      ghsApp/src/admin/stat/stock.vue
  2. 69 42
      pt/src/saas/shop/shop.vue
  3. 20 19
      pt/vue.config.js

+ 5 - 2
ghsApp/src/admin/stat/stock.vue

@@ -4,9 +4,9 @@
 			<view class="input-wrap">
 			<view class="input-wrap">
 				<view style="padding:0 0upx 0 20upx;" >
 				<view style="padding:0 0upx 0 20upx;" >
 					<button class="admin-button-com middle blue" 
 					<button class="admin-button-com middle blue" 
-					style="width:300upx;background-color:green;border:1upx solid green;margin-right:30upx;"
+					style="background-color:green;border:1upx solid green;margin-right:60upx;"
 					@click="allOutSelectShop(1)">全部出库并入库到</button>
 					@click="allOutSelectShop(1)">全部出库并入库到</button>
-					<!--<button class="admin-button-com middle blue" @click="allOutSelectShop(0)">全部出库到</button>-->
+					<button class="admin-button-com middle default" @click="clearAll()">清空全部库存</button>
 				</view>
 				</view>
 			</view>
 			</view>
 			<view class="top-bar" style="margin-left:110upx;">实时</view>
 			<view class="top-bar" style="margin-left:110upx;">实时</view>
@@ -136,6 +136,9 @@ export default {
 	methods: {
 	methods: {
 		init(){
 		init(){
 
 
+		},
+		clearAll(){
+			this.$msg('功能开发中,请联系石头清空')
 		},
 		},
 		allOutSelectShop(flag){
 		allOutSelectShop(flag){
 			//是否直接入库
 			//是否直接入库

+ 69 - 42
pt/src/saas/shop/shop.vue

@@ -1,52 +1,51 @@
 <template>
 <template>
     <div class="app-list-content">
     <div class="app-list-content">
         <x-crud class="liu-crud-wrap" @load="onLoad">
         <x-crud class="liu-crud-wrap" @load="onLoad">
-            <!-- 余额 -->
             <template #table-column-balance="{scope}">
             <template #table-column-balance="{scope}">
                 <el-link :underline="true" @click="detailShowFn(scope.row)" style="font-size:12px;display:inline-block;">{{ scope.row.balance }}</el-link>
                 <el-link :underline="true" @click="detailShowFn(scope.row)" style="font-size:12px;display:inline-block;">{{ scope.row.balance }}</el-link>
             </template>
             </template>
-            <!-- 收入 -->
             <template #table-column-totalIncome="{scope}">
             <template #table-column-totalIncome="{scope}">
                 <el-link :underline="true" @click="AmountShowFn(scope.row,'1')" style="font-size:12px;display:inline-block;">{{ scope.row.totalIncome }}</el-link>
                 <el-link :underline="true" @click="AmountShowFn(scope.row,'1')" style="font-size:12px;display:inline-block;">{{ scope.row.totalIncome }}</el-link>
             </template>
             </template>
-            <!-- 支出 -->
-            <template #table-column-totalExpend="{scope}">
-                <el-link :underline="true" @click="AmountShowFn(scope.row,'0')" style="font-size:12px;display:inline-block;">{{ scope.row.totalExpend }}</el-link>
-            </template>
-            <!-- 收款码 -->
-            <template #table-column-gatheringCode>
-                <el-button type="text">下载</el-button>
-            </template>
-            <!-- 充值 -->
             <template #slot-apply="{scope}">
             <template #slot-apply="{scope}">
               <el-button type="text" @click="addStaff(scope.row)">添加员工</el-button>
               <el-button type="text" @click="addStaff(scope.row)">添加员工</el-button>
+              <el-button type="text" @click="clearStock(scope.row)">清库存</el-button>
             </template>
             </template>
         </x-crud>
         </x-crud>
 
 
-        <!-- 用户详情 -->
         <balance-detail v-if='showBalanceDetail' @closeFn='showBalanceDetail = false' ref="balanceDetail" :orderOperate="optionData" />
         <balance-detail v-if='showBalanceDetail' @closeFn='showBalanceDetail = false' ref="balanceDetail" :orderOperate="optionData" />
-        
+
         <amount-detail v-if='showAmountDetail' @closeFn='showAmountDetail = false' ref="amountDetail" :orderOperate="optionData" />
         <amount-detail v-if='showAmountDetail' @closeFn='showAmountDetail = false' ref="amountDetail" :orderOperate="optionData" />
 
 
-        <el-dialog :visible.sync="addYgPop" :close-on-click-modal="false" width="500px" >
-          <el-form :model="addStaffForm" :rules="ruleForm" ref="adForm" label-width="80px" class="demo-form" >
+        <el-dialog :visible.sync="addStaffPop" :close-on-click-modal="false" width="500px"  title="添加员工">
+          <el-form :model="addStaffForm" :rules="addStaffRule" ref="addStaffRef" label-width="80px" class="demo-form" >
             <el-form-item label="手机号" prop="mobile" style="text-align:left;" >
             <el-form-item label="手机号" prop="mobile" style="text-align:left;" >
               <el-input placeholder="请输入手机号" size="small" v-model="addStaffForm.mobile" ></el-input>
               <el-input placeholder="请输入手机号" size="small" v-model="addStaffForm.mobile" ></el-input>
             </el-form-item>
             </el-form-item>
             <el-form-item label="昵称" prop="nickName" style="text-align: left;" >
             <el-form-item label="昵称" prop="nickName" style="text-align: left;" >
               <el-input placeholder="请输入昵称" size="small" v-model="addStaffForm.nickName"></el-input>
               <el-input placeholder="请输入昵称" size="small" v-model="addStaffForm.nickName"></el-input>
             </el-form-item>
             </el-form-item>
-
             <el-form-item label="超管" prop="super">
             <el-form-item label="超管" prop="super">
               <el-select v-model="addStaffForm.superName" size="small" placeholder="请选择" @change="changeSuperFn">
               <el-select v-model="addStaffForm.superName" size="small" placeholder="请选择" @change="changeSuperFn">
                 <el-option v-for="(item, index) in superList" :key="index" :value="item.name" >{{ item.name }}</el-option>
                 <el-option v-for="(item, index) in superList" :key="index" :value="item.name" >{{ item.name }}</el-option>
               </el-select>
               </el-select>
             </el-form-item>
             </el-form-item>
+          </el-form>
+          <div slot="footer" class="dialog-footer">
+            <el-button size="small" @click="resetAddStaffForm">取 消</el-button>
+            <el-button type="primary" size="small" @click="putAddStaffForm">确认</el-button>
+          </div>
+        </el-dialog>
 
 
+        <el-dialog :visible.sync="clearStockPop" :close-on-click-modal="false" width="500px" title="清空库存">
+          <el-form :model="clearStockForm" :rules="clearStockRule" ref="clearStockRef" label-width="80px" class="demo-form" >
+            <el-form-item label="密码" prop="password" style="text-align: left;" >
+              <el-input placeholder="请输入密码" size="small" v-model="clearStockForm.password" show-password></el-input>
+            </el-form-item>
           </el-form>
           </el-form>
           <div slot="footer" class="dialog-footer">
           <div slot="footer" class="dialog-footer">
-            <el-button size="small" @click="resetForm">取 消</el-button>
-            <el-button type="primary" size="small" @click="submitForm">确认</el-button>
+            <el-button size="small" @click="resetclearStockForm">取 消</el-button>
+            <el-button type="primary" size="small" @click="putClearStockForm">确认</el-button>
           </div>
           </div>
         </el-dialog>
         </el-dialog>
 
 
@@ -63,8 +62,7 @@ export default {
             showBalanceDetail: false,
             showBalanceDetail: false,
             showAmountDetail: false,
             showAmountDetail: false,
             optionData: {},
             optionData: {},
-            addYgPop: false,
-            dialogTitle: '',
+            addStaffPop: false,
             addStaffForm: {
             addStaffForm: {
               mobile: '',
               mobile: '',
               nickName: '',
               nickName: '',
@@ -72,20 +70,54 @@ export default {
               superName:'是',
               superName:'是',
               shopId:0
               shopId:0
             },
             },
-            ruleForm: {
-              mobile: [{ required: true, message: '请输入充值金额', trigger: 'blur' }],
-              nickName: [{ required: true, message: '请输入登录密码', trigger: 'blur' }],
+            addStaffRule: {
+              mobile: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
+              nickName: [{ required: true, message: '请输入昵称', trigger: 'blur' }],
             },
             },
-            superList:[{name:'是',id:1},{name:'否',id:0}]
+            superList:[{name:'是',id:1},{name:'否',id:0}],
+            clearStockPop:false,
+            clearStockForm:{
+              password:'',
+              shopId:0
+            },
+            clearStockRule:{
+              password: [{ required: true, message: '请输入密码', trigger: 'blur' }]
+            }
         };
         };
     },
     },
     mounted() {
     mounted() {
     },
     },
     methods: {
     methods: {
+        clearStock(shop){
+          this.clearStockPop = true 
+          this.clearStockForm.shopId = shop.id
+        },
+        resetclearStockForm(){
+          this.$refs['clearStockRef'].resetFields()
+          this.clearStockPop = false
+        },
         addStaff(shop) {
         addStaff(shop) {
-          this.addYgPop = true
+          this.addStaffPop = true
           this.addStaffForm.shopId = shop.id
           this.addStaffForm.shopId = shop.id
         },
         },
+        putClearStockForm(){
+          let that = this
+          that.$refs['clearStockRef'].validate(valid => {
+            if (valid) {
+              // that.$service.shop.addStaff(that.addStaffForm).then(res => {
+              //     if(res.id && Number(res.id)>0){
+              //       that.$message.success('操作成功')
+              //       that.addStaffPop = false
+              //       that.$refs['addStaffRef'].resetFields()
+              //       that.app.refresh()
+              //   }
+              // })
+            } else {
+              console.log('出错了哦');
+              return false;
+            }
+          })
+        },
         changeSuperFn(val){
         changeSuperFn(val){
           let index = this.superList.findIndex((e) => e.name == val);
           let index = this.superList.findIndex((e) => e.name == val);
           this.addStaffForm.super = this.superList[index].id;
           this.addStaffForm.super = this.superList[index].id;
@@ -131,12 +163,6 @@ export default {
                             width: '100',
                             width: '100',
                             align: 'center'
                             align: 'center'
                         },
                         },
-                        {
-                            prop: 'totalExpend',
-                            label: '支出',
-                            width: '100',
-                            align: 'center'
-                        },
                         {
                         {
                             prop: 'mobile',
                             prop: 'mobile',
                             label: '手机号',
                             label: '手机号',
@@ -173,9 +199,9 @@ export default {
                         }
                         }
                     ],
                     ],
                     op: {
                     op: {
-                      visible: true, // 是否显示
+                      visible: true,
                       props: {
                       props: {
-                        width: 120,
+                        width: 190,
                         align: 'center',
                         align: 'center',
                         fixed: 'right',
                         fixed: 'right',
                         label: '操作'
                         label: '操作'
@@ -205,26 +231,27 @@ export default {
                 .done();
                 .done();
             app.refresh();
             app.refresh();
         },
         },
-        resetForm () {
-          this.$refs['adForm'].resetFields();
-          this.addYgPop = false;
+        resetAddStaffForm () {
+          this.$refs['addStaffRef'].resetFields()
+          this.addStaffPop = false
         },
         },
-        submitForm () {
+        putAddStaffForm () {
           let that = this
           let that = this
-          that.$refs['adForm'].validate(valid => {
+          that.$refs['addStaffRef'].validate(valid => {
             if (valid) {
             if (valid) {
               that.$service.shop.addStaff(that.addStaffForm).then(res => {
               that.$service.shop.addStaff(that.addStaffForm).then(res => {
                   if(res.id && Number(res.id)>0){
                   if(res.id && Number(res.id)>0){
                     that.$message.success('操作成功')
                     that.$message.success('操作成功')
-                    that.addYgPop = false
+                    that.addStaffPop = false
+                    that.$refs['addStaffRef'].resetFields()
                     that.app.refresh()
                     that.app.refresh()
                 }
                 }
               })
               })
             } else {
             } else {
-              console.log('error submit!!');
+              console.log('出错了哦');
               return false;
               return false;
             }
             }
-          });
+          })
         },
         },
         detailShowFn(item){
         detailShowFn(item){
             this.optionData = item;
             this.optionData = item;
@@ -243,4 +270,4 @@ export default {
         }
         }
     }
     }
 };
 };
-</script>
+</script>

+ 20 - 19
pt/vue.config.js

@@ -2,8 +2,9 @@ const path = require('path');
 
 
 const isProduction = process.env.NODE_ENV === 'production';
 const isProduction = process.env.NODE_ENV === 'production';
 
 
-//http和https切换请修改这里,修改后需要重新运行npm run serve shish 2021.4.12
-const proxyTarget = 'http://api.shop.hzghd.com';
+//http和https切换请修改这里,修改后需要重新运行 npm run serve 即可 shish 2021.4.12
+const proxyTarget =
+	process.env.NODE_ENV == 'local' ? 'http://api.pt.huaml.com' : 'http://api.pt.huaml.com';
 
 
 function resolve(dir) {
 function resolve(dir) {
 	return path.join(__dirname, dir);
 	return path.join(__dirname, dir);
@@ -45,6 +46,8 @@ const cdn = {
 			`${hostUrl}cdn/viewerjs/1.3.7/viewer.min.js`,
 			`${hostUrl}cdn/viewerjs/1.3.7/viewer.min.js`,
 			`${hostUrl}cdn/echarts/4.4.0-rc.1/echarts.min.js`,
 			`${hostUrl}cdn/echarts/4.4.0-rc.1/echarts.min.js`,
 			`${hostUrl}cdn/npm/vue-echarts@4.0.2.js`
 			`${hostUrl}cdn/npm/vue-echarts@4.0.2.js`
+			// https://cdn.bootcss.com
+			// 'https://cdn.jsdelivr.net/npm/vue-echarts@4.0.2'
 		]
 		]
 	}
 	}
 };
 };
@@ -53,9 +56,9 @@ module.exports = {
 	publicPath: '/',
 	publicPath: '/',
 	lintOnSave: true,
 	lintOnSave: true,
 	productionSourceMap: false,
 	productionSourceMap: false,
-	parallel: require('os').cpus().length > 1,
 	// 输出文件目录
 	// 输出文件目录
-	outputDir: 'dist/shop/',
+	outputDir: 'dist/web/',
+	parallel: require('os').cpus().length > 1,
 
 
 	css: {
 	css: {
 		extract: isProduction,
 		extract: isProduction,
@@ -65,7 +68,6 @@ module.exports = {
 				import: '~@/assets/css/common.styl'
 				import: '~@/assets/css/common.styl'
 			},
 			},
 			sass: {
 			sass: {
-				// additionalData: `@import "~@/assets/css/base.scss";`
 				prependData: `@import "~@/assets/css/base.scss";`
 				prependData: `@import "~@/assets/css/base.scss";`
 			}
 			}
 		}
 		}
@@ -78,9 +80,9 @@ module.exports = {
 		compress: false,
 		compress: false,
 		overlay: {
 		overlay: {
 			warnings: false,
 			warnings: false,
-			errors: false
+			errors: true
 		},
 		},
-		
+
 		proxy: {
 		proxy: {
 			'/dev': {
 			'/dev': {
 				target: proxyTarget,
 				target: proxyTarget,
@@ -106,19 +108,18 @@ module.exports = {
 		// 移除 preload 插件
 		// 移除 preload 插件
 		// config.plugins.delete('preload');
 		// config.plugins.delete('preload');
 		// svg
 		// svg
-		config.module.rule('svg').uses.clear();
+		// config.module.rule('svg').uses.clear();
 
 
-		config.module
-			.rule('svg-sprite')
-			.test(/.svg$/)
-			.exclude.add(/node_modules/)
-			.end()
-			.use('svg-sprite-loader')
-			.loader('svg-sprite-loader')
-			.options({
-				symbolId: '[name]',
-				extract: false
-			});
+		// config.module
+		// 	.rule('svg-sprite-loader')
+		// 	.test(/.svg$/)
+		// 	.exclude.add(/node_modules/)
+		// 	.end()
+		// 	.use('svg-sprite-loader')
+		// 	.loader('svg-sprite-loader')
+		// 	.options({
+		// 		symbolId: '[name]'
+		// 	});
 
 
 		// 去掉元素之间空格
 		// 去掉元素之间空格
 		config.module
 		config.module