Xiao_Mo 4 jaren geleden
bovenliggende
commit
d27bad4d02

+ 8 - 1
src/api/businessManager.js

@@ -80,5 +80,12 @@ export function getSubjectChangeList (data) {
     params: data
   })
 }
-
+// 更新成本差
+export function updateCostMargin (data) {
+  return request({
+    url: api + `/subjectChange/updateCostMargin`,
+    method: 'post',
+    data: qs.stringify(data)
+  })
+}
 

+ 17 - 1
src/utils/searchArray.js

@@ -151,6 +151,21 @@ const saleStatus = [
 
 ]
 
+const classStatus = [
+  { value: '1', label: '一年级' },
+  { value: '2', label: '二年级' },
+  { value: '3', label: '三年级' },
+  { value: '4', label: '四年级' },
+  { value: '5', label: '五年级' },
+  { value: '6', label: '六年级' },
+  { value: '7', label: '初一' },
+  { value: '8', label: '初二' },
+  { value: '9', label: '初三' },
+  { value: '10', label: '高一' },
+  { value: '11', label: '高二' },
+  { value: '12', label: '高三' },
+]
+
 export {
   courseType,
   attendance,
@@ -169,5 +184,6 @@ export {
   practiceGroupType,
   visitChiose,
   paymentChannelStatus,
-  saleStatus
+  saleStatus,
+  classStatus
 }

+ 52 - 0
src/utils/utils.js

@@ -9,3 +9,55 @@ export const formatData = (times, keys, format = 'YYYY-MM-DD') => {
   }
   return data
 }
+
+
+export const getNowDateAndMonday=(time)=> {
+  let timestamp = new Date(time.replace(/-/g, "/")).getTime();
+  let serverDate = new Date(time);
+  if (serverDate.getDay() == 0) {
+    timestamp -= 7 * 24 * 60 * 60 * 1000;
+  }
+  let mondayTime =
+    timestamp - (serverDate.getDay() - 1) * 24 * 60 * 60 * 1000;
+
+  let mondayData = new Date(mondayTime);
+  //年
+  let mondayY = mondayData.getFullYear();
+  //月
+  let mondayM =
+    mondayData.getMonth() + 1 < 10
+      ? "0" + (mondayData.getMonth() + 1)
+      : mondayData.getMonth() + 1;
+  //日
+  let mondayD =
+    mondayData.getDate() < 10
+      ? "0" + mondayData.getDate()
+      : mondayData.getDate();
+
+  let str = mondayY + "-" + mondayM + "-" + mondayD;
+  return str;
+}
+export const getNowDateAndSunday=(time) =>{
+  let timestamp = new Date(time.replace(/-/g, "/")).getTime();
+  let serverDate = new Date(time);
+
+  let num = 7 - serverDate.getDay();
+  if (num == 7) {
+    num = 0;
+  }
+  let sundayTiem = timestamp + num * 24 * 60 * 60 * 1000;
+  let SundayData = new Date(sundayTiem);
+  //年
+  let tomorrowY = SundayData.getFullYear(); //月
+  let tomorrowM =
+    SundayData.getMonth() + 1 < 10
+      ? "0" + (SundayData.getMonth() + 1)
+      : SundayData.getMonth() + 1;
+  //日
+  let tomorrowD =
+    SundayData.getDate() < 10
+      ? "0" + SundayData.getDate()
+      : SundayData.getDate();
+  let str = tomorrowY + "-" + tomorrowM + "-" + tomorrowD;
+  return str;
+}

+ 28 - 11
src/views/businessManager/resetList/index.vue

@@ -10,11 +10,11 @@
         <el-form-item>
           <el-input v-model.trim="searchForm.search"
                     @keyup.enter.native="search"
-                    placeholder></el-input>
+                    placeholder='流水号 订单号 学生姓名'></el-input>
         </el-form-item>
         <el-form-item prop="organId">
           <el-select class="multiple"
-                     v-model.trim="searchForm.organId"
+                     v-model.trim="searchForm.organIdList"
                      filterable
                      clearable
                      placeholder="请选择分部">
@@ -49,7 +49,7 @@
         </el-form-item> -->
         <el-form-item>
           <el-date-picker style="width:410px;"
-                          v-model.trim="searchForm.resetDate"
+                          v-model.trim="resetDate"
                           type="daterange"
                           value-format="yyyy-MM-dd"
                           range-separator="至"
@@ -90,9 +90,6 @@
                 <el-form-item label="交易方式">
                   <span>{{ props.row.paymentChannel| paymentChannelStatus}}</span>
                 </el-form-item>
-                <!-- <el-form-item label="收款账户">
-                  <span>{{ props.row.address }}</span>
-                </el-form-item> -->
               </el-form>
             </template>
           </el-table-column>
@@ -160,7 +157,7 @@
                            prop="cooperationOrganName"
                            label="所属学校"></el-table-column>
           <el-table-column align="center"
-                           prop="studentId"
+                           prop="musicGroupName"
                            label="乐团"></el-table-column>
           <el-table-column align="center"
                            prop="studentId"
@@ -191,6 +188,7 @@
     </div>
     <resetSound :show="show"
                 @closeReset='closeReset'
+                @getList='getList'
                 :item='activeRow' />
   </div>
 </template>
@@ -204,15 +202,24 @@ import { getTeacher, getEmployeeOrgan, getCooperation } from "@/api/buildTeam";
 import { getSubjectChangeList } from "@/api/businessManager"
 import resetSound from './resetSound'
 import { saleStatus } from '@/utils/searchArray'
-
+import cleanDeep from 'clean-deep'
+import {getNowDateAndMonday,getNowDateAndSunday} from '@/utils/utils'
+let nowTime = new Date();
+nowTime =
+  nowTime.getFullYear() +
+  "-" +
+  (nowTime.getMonth() + 1) +
+  "-" +
+  nowTime.getDate();
 export default {
   components: { pagination, resetSound },
   data () {
     return {
       searchForm: {
         search: null,
-        resetDate: null
+       
       },
+       resetDate: [],
       show: false,
       teacherList: [],
       tableList: [],
@@ -233,6 +240,9 @@ export default {
   created () { },
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted () {
+    this.resetDate = [];
+    this.resetDate.push(getNowDateAndMonday(nowTime));
+    this.resetDate.push(getNowDateAndSunday(nowTime));
     getCooperation({ 'rows': 1000, })
       .then(res => {
         if (res.code == 200) {
@@ -261,7 +271,13 @@ export default {
       let params = this.searchForm
       params.rows = this.rules.limit
       params.page = this.rules.page
-      getSubjectChangeList(params).then(res => {
+      if(this.searchForm.resetDate&&this.searchForm.resetDate.length >1){
+             params.startTime = this.searchForm.resetDate[0]
+      params.endTime = this.searchForm.resetDate[1]
+      }
+ 
+     
+      getSubjectChangeList(cleanDeep(params)).then(res => {
         if (res.code === 200) {
           this.rules.total = res.data.total;
           this.tableList = res.data.rows
@@ -269,7 +285,8 @@ export default {
       })
     },
     reset (row) {
-      this.row = activeRow
+      console.log(row)
+      this.activeRow = row 
       this.show = true
     },
     closeReset () {

+ 97 - 57
src/views/businessManager/resetList/resetSound.vue

@@ -1,48 +1,58 @@
 <template>
   <div>
-    <el-dialog title="修改"
-               width="500px"
-               :visible.sync="soundVisible">
-      <el-form :model="soundForm"
-               label-position="right"
-               label-width="120px"
-               :inline="true"
-               ref="soundForm">
+    <el-dialog title="修改" width="500px" :visible.sync="soundVisible">
+      <el-form
+        :model="soundForm"
+        label-position="right"
+        label-width="120px"
+        :inline="true"
+        ref="soundForm"
+      >
         <el-form-item label="原乐器">
-          <el-input style="width:330px"
-                    disabled
-                    v-model="soundForm.originalMusicalGoods"></el-input>
+          <el-input
+            style="width: 330px"
+            disabled
+            v-model="soundForm.originalMusicalGoods"
+          ></el-input>
         </el-form-item>
         <el-form-item label="原教辅">
-          <el-input style="width:330px"
-                    disabled
-                    v-model="soundform.originalAccessories"></el-input>
+          <el-input
+            style="width: 330px"
+            disabled
+            v-model="soundForm.originalAccessories"
+          ></el-input>
         </el-form-item>
         <el-form-item label="更换乐器">
-          <el-input style="width:330px"
-                    disabled
-                    v-model="soundForm.changeMusicalGoods"></el-input>
+          <el-input
+            style="width: 330px"
+            disabled
+            v-model="soundForm.changeMusicalGoods"
+          ></el-input>
         </el-form-item>
         <el-form-item label="更换教辅">
-          <el-input style="width:330px"
-                    disabled
-                    v-model="soundForm.changeAccessories"></el-input>
+          <el-input
+            style="width: 330px"
+            disabled
+            v-model="soundForm.changeAccessories"
+          ></el-input>
         </el-form-item>
         <el-form-item label="支付差价">
-          <el-input style="width:330px"
-                    disabled
-                    v-model="soundForm.money"></el-input>
+          <el-input
+            style="width: 330px"
+            disabled
+            v-model="soundForm.money"
+          ></el-input>
         </el-form-item>
         <el-form-item label="成本差(元)">
-          <el-input style="width:330px"
-                    disabled
-                    v-model="soundForm.costMargin"></el-input>
+          <el-input
+            style="width: 330px"
+            v-model="soundForm.costMargin"
+          ></el-input>
         </el-form-item>
       </el-form>
-      <div slot="footer"
-           class="dialog-footer">
+      <div slot="footer" class="dialog-footer">
         <el-button @click="soundVisible = false">取 消</el-button>
-        <el-button type="primary">确 定</el-button>
+        <el-button type="primary" @click="resetCostMargin">确 定</el-button>
       </div>
     </el-dialog>
   </div>
@@ -50,9 +60,11 @@
 <style lang="scss">
 </style>
 <script>
+import numeral from "numeral";
+import { updateCostMargin } from "@/api/businessManager";
 export default {
-  props: ['show', 'item'],
-  data () {
+  props: ["show", "item"],
+  data() {
     return {
       soundForm: {
         originalMusicalGoods: null,
@@ -61,46 +73,74 @@ export default {
         changeAccessories: null,
         money: null,
         costMargin: null,
-        id: null
+        id: null,
       },
       soundVisible: false,
-      value1: null
-    }
+    };
   },
-  mounted () { },
+  mounted() {},
   methods: {
-    accessoriesFormatter (accessories) {
-      let arr = accessories.map(res => {
-        return res.name
+    accessoriesFormatter(accessories) {
+      let arr = accessories.map((res) => {
+        return res.name;
+      });
+      return arr.join(",");
+    },
+    resetCostMargin() {
+      updateCostMargin({id:this.soundForm.id,costMargin:this.soundForm.costMargin}).then(res=>{
+        if(res.code == 200){
+          this.$message.success('修改成功')
+          this.$emit('getList')
+        }
       })
-      return arr.join(',')
-    }
+    },
   },
   watch: {
-    show (val) {
-      this.soundVisible = val
+    show(val) {
+      this.soundVisible = val;
     },
-    soundVisible (val) {
+    soundVisible(val) {
       if (!val) {
-        // this.
-        this.$emit('closeReset')
+        this.$emit("closeReset");
       }
     },
     item: {
       immediate: true,
       deep: true,
-      handler (row) {
-        this.soundForm = {
-          originalMusicalGoods: row.originalMusicalGoods ? row.originalMusicalGoods.name : null,
-          originalAccessories: this.accessoriesFormatter(row.originalAccessoriesGoods) || null,
-          changeMusicalGoods: row.changeMusicalGoods ? row.changeMusicalGoods.name : null,
-          changeAccessories: this.accessoriesFormatter(row.changeAccessoriesGoods) || null,
-          money: ((row.changeMusicalPrice + row.changeAccessoriesPrice) - (row.originalMusicalPrice + row.originalAccessoriesPrice)) | moneyFormat,
-          costMargin: row.costMargin,
-          id: null
+      handler(row, oldValue) {
+        if (row) {
+          this.soundForm = {
+            originalMusicalGoods: row.originalMusicalGoods
+              ? row.originalMusicalGoods.name
+              : null,
+            originalAccessories:
+              this.accessoriesFormatter(row.originalAccessoriesGoods) || null,
+            changeMusicalGoods: row.changeMusicalGoods
+              ? row.changeMusicalGoods.name
+              : null,
+            changeAccessories:
+              this.accessoriesFormatter(row.changeAccessoriesGoods) || null,
+            money: numeral(
+              row.changeMusicalPrice +
+                row.changeAccessoriesPrice -
+                (row.originalMusicalPrice + row.originalAccessoriesPrice)
+            ).format("0,0.00"),
+            costMargin: numeral(row.costMargin).format("0,0.00"),
+            id: row.id,
+          };
+        } else {
+          this.soundForm = {
+            originalMusicalGoods: null,
+            originalAccessories: null,
+            changeMusicalGoods: null,
+            changeAccessories: null,
+            money: null,
+            costMargin: null,
+            id: null,
+          };
         }
       },
-    }
-  }
-}
+    },
+  },
+};
 </script>

File diff suppressed because it is too large
+ 522 - 323
src/views/teamBuild/components/teamBaseInfo.vue


+ 1 - 1
src/views/teamDetail/teamInfo.vue

@@ -29,7 +29,7 @@
   </div>
 </template>
 <script>
-import baseInfo from '@/views/teamDetail/components/baseInfo'
+import baseInfo from '@/views/teamBuild/components/teamBaseInfo'
 import soundeDetail from '@/views/resetTeaming/components/resetSound'
 export default {
   data () {

Some files were not shown because too many files changed in this diff