Prechádzať zdrojové kódy

管理后台-用户中心:存酒

panyong 3 rokov pred
rodič
commit
5a8d9dba06

+ 1 - 1
htmldev/manage/src/utils/rules.js

@@ -162,7 +162,7 @@ const confirmPasswordValidator = (rule, value, callback, password) => {
 
 const formRules = {
   QQ: [{ required: true, validator: QQV, trigger: 'blur' }],
-  code: [{ required: true, pattern: /^\d{6}$/, message: '4位手机验证码', trigger: 'blur' }],
+  code: [{ required: true, pattern: /^\d{6}$/, message: '手机验证码', trigger: 'blur' }],
   mobile: [{ required: true, pattern: /^1[0-9]{10}$/, message: '目前只支持中国大陆的手机号码', trigger: 'blur' }],
   password: [{ required: true, min: 6, max: 18, message: '长度必须大于6位长度在 6 到 18 个字符之间', trigger: 'blur' }],
   confirmPassword: (form) => {

+ 37 - 28
htmldev/manage/src/views/business/saveWine/details.vue

@@ -9,16 +9,16 @@
                :model="form"
                :rules="formRules"
                label-width="160px">
-        <el-form-item prop="user_song_name"
+        <el-form-item prop="storage_name"
                       :rules="formRules.required"
                       label="酒名:">
           <el-col :span="16">
-            <el-input v-model="form.user_song_name"
+            <el-input v-model="form.storage_name"
                       placeholder="请输入酒名"
                       clearable></el-input>
           </el-col>
         </el-form-item>
-        <el-form-item prop="plan_cover_url"
+        <el-form-item prop="storage_img_url"
                       :rules="formRules.uploadImgs"
                       label="实物图:">
           <el-upload :on-remove="handleRemove"
@@ -35,38 +35,39 @@
             <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过5M</div>
           </el-upload>
         </el-form-item>
-        <el-form-item prop="phone"
+        <el-form-item prop="user_phone"
                       :rules="formRules.mobile"
                       label="用户手机号:">
           <el-col :span="16">
-            <el-input v-model="form.phone"
+            <el-input v-model="form.user_phone"
                       placeholder="请输入用户手机号"
-                      @input="form.phone = form.phone.replace(/[^\d]/g, '').slice(0, 11)"
+                      @input="form.user_phone = form.user_phone.replace(/[^\d]/g, '').slice(0, 11)"
                       clearable></el-input>
           </el-col>
         </el-form-item>
-        <el-form-item prop="user_song_name"
+        <el-form-item prop="user_name"
                       :rules="formRules.required"
                       label="用户昵称:">
           <el-col :span="16">
-            <el-input v-model="form.user_song_name"
+            <el-input v-model="form.user_name"
                       placeholder="请输入用户昵称"
                       clearable></el-input>
           </el-col>
         </el-form-item>
-        <el-form-item prop="user_sign_status"
+        <el-form-item prop="storage_status"
                       :rules="formRules.required"
                       label="状态:">
-          <el-radio v-model="form.user_sign_status"
-                    label="1">已取
-          </el-radio>
-          <el-radio v-model="form.user_sign_status"
+          <el-radio v-model="form.storage_status"
                     label="0">存酒中
           </el-radio>
+          <el-radio v-model="form.storage_status"
+                    label="1">已取
+          </el-radio>
         </el-form-item>
-        <el-form-item label="备注:">
+        <el-form-item prop="storage_remark"
+                      label="备注:">
           <el-col :span="16">
-            <el-input v-model="form.note"
+            <el-input v-model="form.storage_remark"
                       type="textarea"
                       rows="6">
             </el-input>
@@ -82,7 +83,6 @@
 </template>
 
 <script>
-import { fen2Yuan, yuan2Fen } from '@/utils'
 import getCode from '@/views/ums/mixin/getCode'
 
 export default {
@@ -104,11 +104,12 @@ export default {
     return {
       dialog: !!this.value,
       form: {
-        user_song_name: '', // 歌手名称
-        phone: '', // 手机号码
-        code: '', // 验证码
-        plan_cover_url: [],
-        user_sign_status: '1', // 艺人签约状态(0未签约1已签约)
+        storage_name: '', // 酒名
+        storage_img_url: [], // 存酒图片
+        user_phone: '', // 用户手机号码
+        user_name: '', // 用户姓名
+        storage_status: '1', // 存酒状态(0存酒中1已取出)
+        storage_remark: '' // 存酒备注
       },
       fileList: []
     }
@@ -126,12 +127,12 @@ export default {
       if (file.response && file.response.data) {
         path = file.response.data.path
       }
-      this.form.plan_cover_url = this.form.plan_cover_url.filter(item => item !== path)
+      this.form.storage_img_url = this.form.storage_img_url.filter(item => item !== path)
     },
     handleAvatarSuccess (res) {
       if (res.code === 200) {
         const { path } = res.data
-        this.form.plan_cover_url.push(path)
+        this.form.storage_img_url.push(path)
       } else {
         this.$message.error('图片上传失败')
       }
@@ -143,13 +144,12 @@ export default {
       })
     },
     handleSubmit () {
-      // todo 艺人添加、艺人海报数组转字符串
-      const url = this.exData.id ? '/v1/user/member/song/modify' : ''
+      const url = this.exData.id ? '/v1/user/storage/modify' : ''
       this.$refs.form.validate(async valid => {
         if (valid) {
           const data = await this.$fetch(url, {
             ...this.form,
-            place_price: yuan2Fen(this.form.place_price)
+            storage_img_url: this.form.storage_img_url[0]
           })
           if (data.code === 200) {
             this.$message.success('提交成功')
@@ -163,12 +163,21 @@ export default {
   mounted () {
     if (this.exData.id) {
       this.$set(this.form, 'id', this.exData.id)
+      this.fileList = [
+        {
+          name: '',
+          url: this.exData.storage_img_url
+        }
+      ]
       for (const key in this.exData) {
         if (this.form.hasOwnProperty(key)) {
           let value = this.exData[key]
           if ((Array.isArray(value) && value.length >= 1) || (Object.prototype.toString.call(value) === '[object Object]') || (typeof value === 'string' && value) || typeof value === 'number') {
-            if (key === 'place_price') {
-              value = fen2Yuan(value)
+            if (key === 'storage_img_url') {
+              value = [value]
+            }
+            if (key === 'storage_status') {
+              value = value.toString()
             }
             this.$set(this.form, key, value)
           }

+ 36 - 15
htmldev/manage/src/views/business/saveWine/index.vue

@@ -5,10 +5,20 @@
                :inline="true"
                :model="searchForm"
                clearable
-               label-width="100px"
                class="mt-10">
-        <el-form-item label="座位名称:">
-          <el-input v-model="searchForm.department_name" placeholder="请输入座位名称" clearable></el-input>
+        <el-form-item label="订单编号:">
+          <el-input v-model="searchForm.storage_number" placeholder="请输入订单编号" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="存入时间:">
+          <el-date-picker
+            :editable="false"
+            v-model="time"
+            @change="timearr => {timearr ? (searchForm.start_time = timearr[0] + ' 00:00:00', searchForm.end_time = timearr[1] + ' 23:59:59') : searchForm.start_time = searchForm.end_time = undefined}"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            start-placeholder="开始时间"
+            end-placeholder="结束时间"
+          ></el-date-picker>
         </el-form-item>
         <el-form-item class="ml-10">
           <el-button icon="el-icon-search" type="primary" @click="searchSubmit">查询</el-button>
@@ -18,19 +28,32 @@
     <el-table :data="tableData"
               stripe
               v-loading="tableLoading"
-              fit
               class="marginT-10 order-table"
               border
               :max-height="vheight">
       <el-table-column label="ID" prop="id"></el-table-column>
-      <el-table-column label="酒名" prop="bar_name"></el-table-column>
+      <el-table-column label="订单编号" prop="storage_number"></el-table-column>
+      <el-table-column label="酒名" prop="storage_name"></el-table-column>
+      <el-table-column label="存酒图片">
+        <template slot-scope="scope">
+          <el-image style="width: 100px; height: 100px"
+                    :src="scope.row.storage_img_url"
+                    :preview-src-list="[scope.row.storage_img_url]">
+          </el-image>
+        </template>
+      </el-table-column>
       <el-table-column label="用户昵称" prop="user_name"></el-table-column>
       <el-table-column label="用户手机" prop="user_phone"></el-table-column>
-      <el-table-column label="状态" prop="user_birthday"></el-table-column>
-      <el-table-column label="录入时间" prop="user_sex"></el-table-column>
-      <el-table-column label="取酒时间" prop="created_at"></el-table-column>
-      <el-table-column label="录入人" prop="created_at"></el-table-column>
-      <el-table-column label="取酒人" prop="created_at"></el-table-column>
+      <el-table-column label="存储状态">
+        <template slot-scope="scope">
+          <p>{{ ['存储中', '已取走'][scope.row.storage_status] }}</p>
+        </template>
+      </el-table-column>
+      <el-table-column label="存酒时间" prop="created_at"></el-table-column>
+      <el-table-column label="取酒时间" prop="storage_out_at"></el-table-column>
+      <el-table-column label="录入人" prop="operation_in_name"></el-table-column>
+      <el-table-column label="取酒人" prop="operation_out_name"></el-table-column>
+      <el-table-column label="备注" prop="storage_remark"></el-table-column>
       <el-table-column label="操作">
         <template slot-scope="scope">
           <el-button type="text"
@@ -74,11 +97,9 @@ export default {
         exData: {}
       },
       time: [],
-      searchForm: {
-        user_type: '0' // 用户类型(0用户1艺人2吧台3老板)
-      },
+      searchForm: {},
       tableData: [],
-      tableUrl: '/v1/user/member/List'
+      tableUrl: '/v1/user/storage/list'
     }
   },
   methods: {
@@ -89,7 +110,7 @@ export default {
   },
   mounted () {
     this.init()
-  },
+  }
 }
 </script>
 

+ 2 - 2
htmldev/manage/src/views/ums/mixin/getCode.js

@@ -7,8 +7,8 @@ export default {
   },
   methods: {
     validatePhone (formName) {
-      this.$refs[formName].validateField('phone', emailError => {
-        if (!emailError) {
+      this.$refs[formName].validateField('phone', error => {
+        if (!error) {
           this.funGetCode()
         } else {
           return false

+ 13 - 5
htmldev/manage/src/views/ums/singer/details.vue

@@ -83,7 +83,6 @@
 </template>
 
 <script>
-import { fen2Yuan, yuan2Fen } from '@/utils'
 import getCode from '@/views/ums/mixin/getCode'
 
 export default {
@@ -144,13 +143,12 @@ export default {
       })
     },
     handleSubmit () {
-      // todo 艺人添加、艺人海报数组转字符串
       const url = this.exData.id ? '/v1/user/member/song/modify' : ''
       this.$refs.form.validate(async valid => {
         if (valid) {
           const data = await this.$fetch(url, {
             ...this.form,
-            place_price: yuan2Fen(this.form.place_price)
+            plan_cover_url: this.form.plan_cover_url[0]
           })
           if (data.code === 200) {
             this.$message.success('提交成功')
@@ -164,12 +162,22 @@ export default {
   mounted () {
     if (this.exData.id) {
       this.$set(this.form, 'id', this.exData.id)
+      this.$set(this.form, 'phone', this.exData.user_phone)
+      this.fileList = [
+        {
+          name: '',
+          url: this.exData.plan_cover_url
+        }
+      ]
       for (const key in this.exData) {
         if (this.form.hasOwnProperty(key)) {
           let value = this.exData[key]
           if ((Array.isArray(value) && value.length >= 1) || (Object.prototype.toString.call(value) === '[object Object]') || (typeof value === 'string' && value) || typeof value === 'number') {
-            if (key === 'place_price') {
-              value = fen2Yuan(value)
+            if (key === 'plan_cover_url') {
+              value = [value]
+            }
+            if (key === 'user_sign_status') {
+              value = value.toString()
             }
             this.$set(this.form, key, value)
           }