Bladeren bron

fix:分类编辑

snow 1 jaar geleden
bovenliggende
commit
96053fd481

+ 50 - 33
src/components/manage/src/letter/_template.js

@@ -1,29 +1,31 @@
 const mapFields = {
     name: "name",
-    primaryClassification: 'primaryClassification', // 一级分类
-    secondaryClassification: 'secondaryClassification',  // 二级分类
+    // primaryClassification: 'primaryClassification', // 一级分类
+    // secondaryClassification: 'secondaryClassification',  // 二级分类
     threeLevelClassification: 'service_cat', // 三级分类
     price: 'price', // 单价
     unit: 'unit', // 单位
-    nonTaxQuotes: 'assess_price', // 非税报价
+    nonTaxQuotes: 'pay_fee', // 非税报价
     taxRate: 'tax', // 税率
-    tax: 'assess_tax_price', // 税额
-    taxIncludedQuote: 'assess_total_price', //含税报价
-    num: 'num'
+    tax: 'tax_fee', // 税额
+    taxIncludedQuote: 'total_fee',
+    num: 'num',
+    remark:'remark'
   }
   
   const mapTemplateToTable = {
-    '服务名称': mapFields.name,
+    '三级服务分类名称': mapFields.name,
     // '一级服务分类': mapFields.primaryClassification,
     // '二级服务分类': mapFields.secondaryClassification,
-    '服务分类': mapFields.threeLevelClassification,
+    '三级服务分类ID': mapFields.threeLevelClassification,
     '单价': mapFields.price,
     '单位': mapFields.unit,
     '数量': mapFields.num,
-    // '非税报价': mapFields.nonTaxQuotes,
+    '非税报价': mapFields.nonTaxQuotes,
     '税率': mapFields.taxRate,
-    // '税额': mapFields.tax,
-    // '含税报价': mapFields.taxIncludedQuote,
+    '税额': mapFields.tax,
+    '含税报价': mapFields.taxIncludedQuote,
+    '备注':mapFields.remark
   }
   
   export const columns = [
@@ -34,8 +36,8 @@ const mapFields = {
     },
      {
        prop: mapFields.name,
-       label: '服务名称',
-       width: '120px',
+       label: '三级服务分类名称',
+       width: '130px',
        required: true
      },
     // {
@@ -52,7 +54,7 @@ const mapFields = {
     // },
     {
       prop: mapFields.threeLevelClassification,
-      label: '服务分类',
+      label: '三级服务分类ID',
       minWidth: '120px',
       required: true
     },
@@ -74,30 +76,36 @@ const mapFields = {
       minWidth:'100px',
       required:true
     },
-    // {
-    //   prop: mapFields.nonTaxQuotes,
-    //   label: '非税报价',
-    //   width: '126px',
-    //   required: false
-    // },
+    {
+      prop: mapFields.nonTaxQuotes,
+      label: '非税报价',
+      width: '126px',
+      required: true
+    },
     {
       prop: mapFields.taxRate,
       label: '税率',
       minWidth: '126px',
       required: true
     },
-    // {
-    //   prop: mapFields.tax,
-    //   label: '税额',
-    //   width: '126px',
-    //   required: false
-    // },
-    // {
-    //   prop: mapFields.taxIncludedQuote,
-    //   label: '含税报价',
-    //   width: '120px',
-    //   required: false
-    // }
+    {
+      prop: mapFields.tax,
+      label: '税额',
+      width: '126px',
+      required: true
+    },
+    {
+      prop: mapFields.taxIncludedQuote,
+      label: '含税报价',
+      width: '120px',
+      required: true
+    },
+    {
+      prop: mapFields.remark,
+      label: '备注',
+      width: '120px',
+      required: true
+    }
   ]
   
   export const getTableProperty = (key) => mapTemplateToTable[key]
@@ -117,11 +125,16 @@ const mapFields = {
     mapFields.num,
     mapFields.taxRate,
     mapFields.nonTaxQuotes,
-    mapFields.taxIncludedQuote
+    mapFields.taxIncludedQuote,
+    mapFields.remark,
+    mapFields.tax
   ]
 
   export const numberFields = [
     mapFields.price,
+    mapFields.taxIncludedQuote,
+    mapFields.nonTaxQuotes,
+    mapFields.tax
   ]
 
   export const intergeFields = [
@@ -137,6 +150,10 @@ const mapFields = {
     mapFields.unit,
     mapFields.num,
     mapFields.taxRate,
+    mapFields.remark,
+    mapFields.taxIncludedQuote,
+    mapFields.nonTaxQuotes,
+    mapFields.tax
   ]
   
 

+ 2 - 0
src/components/manage/src/letter/xlsxUploadModal.vue

@@ -140,12 +140,14 @@ export default {
       })
     },
     validateTableHeader(header, importHeader) {
+      console.log(header,importHeader)
       let isHeaderOk = true
       if (header.length !== importHeader.length) return false
       for (const index in header) {
         const field = header[index]
         const importField = importHeader[index]
         if (field !== importField) {
+          console.log(field,importField)
           isHeaderOk = false
           break
         }

+ 3 - 1
src/components/search/index.js

@@ -6,6 +6,7 @@ import SearchActivityType from "./src/activity-type"
 import SearchPeopleNumber from "./src/people-number"
 import SearchAddr from "./src/addr"
 import SearchCategory from "./src/category"
+import SearchSort from "./src/sort"
 
 const searchComponents = [
   SearchStore,
@@ -15,7 +16,8 @@ const searchComponents = [
   SearchActivityType,
   SearchAddr,
   SearchPeopleNumber,
-  SearchCategory
+  SearchCategory,
+  SearchSort
 ]
 
 export default searchComponents

+ 47 - 42
src/views/customerService/workbench/_template.js

@@ -5,11 +5,12 @@ const mapFields = {
     threeLevelClassification:'cat_name', // 三级分类
     price:'price', // 单价
     unit:'unit', // 单位
-    nonTaxQuotes:'assess_price', // 非税报价
+    nonTaxQuotes:'pay_fee', // 非税报价
     taxRate:'tax', // 税率
-    tax:'assess_tax_price', // 税额
-    taxIncludedQuote:'assess_total_price', //含税报价
-    num:'num'
+    tax:'tax_fee', // 税额
+    taxIncludedQuote:'total_fee', //含税报价
+    num:'num',
+    remark:'remark',
   }
   
   const mapTemplateToTable = {
@@ -32,29 +33,27 @@ const mapFields = {
         label: '序号',
         width: '70px'
     },
-     {
-       prop: mapFields.name,
-       label: '服务名称',
-       width: '120px',
-       required: true
-     },
-    // {
-    //   prop: mapFields.primaryClassification,
-    //   label: '一级服务分类',
-    //   width: '120px',
-    //   required: false
-    // },
-    // {
-    //   prop: mapFields.secondaryClassification,
-    //   label: '二级服务分类',
-    //   width: '120px',
-    //   required: false
-    // },
+    {
+      prop: mapFields.primaryClassification,
+      label: '一级服务分类',
+      minWidth: '120px',
+      _slot_:'one',
+      required: true,
+    },
+    {
+      prop: mapFields.secondaryClassification,
+      label: '二级服务分类',
+      minWidth: '120px',
+      required: true,
+      _slot_:'two'
+
+    },
     {
       prop: mapFields.threeLevelClassification,
-      label: '服务分类',
+      label: '三级服务分类',
       minWidth: '120px',
-      required: true
+      required: true,
+      _slot_:'three'
     },
     {
       prop: mapFields.price,
@@ -74,30 +73,36 @@ const mapFields = {
       minWidth:'100px',
       required:true
     },
-    // {
-    //   prop: mapFields.nonTaxQuotes,
-    //   label: '非税报价',
-    //   width: '126px',
-    //   required: false
-    // },
+    {
+      prop: mapFields.nonTaxQuotes,
+      label: '非税报价',
+      width: '126px',
+      required: true
+    },
     {
       prop: mapFields.taxRate,
       label: '税率',
       minWidth: '126px',
       required: true
     },
-    // {
-    //   prop: mapFields.tax,
-    //   label: '税额',
-    //   width: '126px',
-    //   required: false
-    // },
-    // {
-    //   prop: mapFields.taxIncludedQuote,
-    //   label: '含税报价',
-    //   width: '120px',
-    //   required: false
-    // }
+    {
+      prop: mapFields.tax,
+      label: '税额',
+      width: '126px',
+      required: true
+    },
+    {
+      prop: mapFields.taxIncludedQuote,
+      label: '含税报价',
+      width: '120px',
+      required: true
+    },
+    {
+      prop: mapFields.remark,
+      label: '备注',
+      width: '120px',
+      required: true
+    }
   ]
   
   export const getTableProperty = (key) => mapTemplateToTable[key]

+ 18 - 2
src/views/customerService/workbench/letterEditing.vue

@@ -24,12 +24,28 @@
     </div>
 
     <ex-table
-      :columns="[ ...columns,{ _slot_: 'action', label: '操作', width: '160px' } ]"
+      :columns="[ ...columns,{ _slot_: 'action', fixed:'right' ,label: '操作', width: '160px' } ]"
       :table="table"
       :data="tableData.planinfo"
       style="margin: 15px 0 0 0"
       :noPagination="true"
     >
+      <!-- <template #one={scope}>{{ -->
+        <!-- scope.   -->
+      <!-- }}</template> -->
+      <!-- <template v-for="(slotName,index) in ['one','two','three']"> -->
+      <template #one="{scope}">
+          {{scope.row.merge_cat.split("-")[0] || '--'}}
+        </template>
+
+      <template #two="{scope}">
+          {{scope.row.merge_cat.split("-")[1] || '--'}}
+      </template>
+
+      <template #three="{scope}">
+          {{scope.row.merge_cat.split("-")[2] || '--'}}
+        </template>
+      <!-- </template> -->
       <template #action={scope}>
         <el-button size="mini" type="text" @click="handleItem(scope.$index, ModalTypes.copy)">复制</el-button>
         <el-button size="mini" type="text" @click="handleItem(scope.$index, ModalTypes.update)">编辑</el-button>
@@ -142,7 +158,7 @@ export default {
     async onSubmit() {
       this.loading = true
       const param = {
-        plan_info: this.tableData.planinfo.map(({name, service_cat, price,unit,  num, tax,  id   }) =>  ({ name, service_cat, price, unit, num, tax, id })),
+        plan_info: this.tableData.planinfo.map(({name, service_cat, price,unit,  num, tax,  id,total_fee   }) =>  ({total_fee ,name, service_cat, price, unit, num, tax, id })),
         plan_id:this.$route.query.id,
         store_id:this.tableData.store_id
       }

+ 100 - 6
src/views/customerService/workbench/modal.vue

@@ -1,12 +1,15 @@
 <template>
   <el-dialog :visible="innerVisible" :title="title" center :close-on-click-modal="false" @close="handleClose">
     <el-form ref="ruleForm" label-width="110px" size="mini" :rules="rules" :model="ruleForm">
-      <el-form-item label="服务名称" prop="name">
+      <!-- <el-form-item label="服务名称" prop="name">
         <el-input placeholder="服务名称" v-model="ruleForm.name" />
       </el-form-item>
-
       <el-form-item label="服务分类" prop="service_cat">
         <search-category :value.sync="ruleForm.service_cat" style="width:100%" ref="category" />
+      </el-form-item> -->
+
+      <el-form-item label="服务分类" prop="service_cat">
+        <search-sort ref="sort" :value="service_cat" size="mini" placeholder="服务分类" @handleChange="handleCategoryChange" />
       </el-form-item>
 
       <el-form-item label="单价" prop="price">
@@ -43,10 +46,25 @@
         />
       </el-form-item>
 
+      <el-form-item label="非税报价" prop="pay_fee">
+        <digital-input
+          :values="ruleForm.pay_fee"
+          :placeholder="'非税报价'"
+          :min="0"
+          :max="100000000000"
+          :position="'right'"
+          :precision="2"
+          :size="'mini'"
+          :controls="false"
+          :append="'元'"
+          @reschange="number_change($event, 'pay_fee')"
+        />
+      </el-form-item>
+
        <el-form-item label="税率" prop="tax">
         <digital-input
           :values="ruleForm.tax"
-          :placeholder="'数量'"
+          :placeholder="'税率'"
           :min="0"
           :max="100000000000"
           :position="'right'"
@@ -58,6 +76,40 @@
         />
       </el-form-item>
 
+      <el-form-item label="税额" prop="tax_fee">
+        <digital-input
+          :values="ruleForm.tax_fee"
+          :placeholder="'税额'"
+          :min="0"
+          :max="100000000000"
+          :position="'right'"
+          :precision="2"
+          :size="'mini'"
+          :controls="false"
+          :append="'元'"
+          @reschange="number_change($event, 'tax_fee')"
+        />
+      </el-form-item>
+
+      <el-form-item label="含税金额" prop="total_fee">
+        <digital-input
+          :values="ruleForm.total_fee"
+          :placeholder="'含税金额'"
+          :min="0"
+          :max="100000000000"
+          :position="'right'"
+          :precision="2"
+          :size="'mini'"
+          :controls="false"
+          :append="'元'"
+          @reschange="number_change($event, 'total_fee')"
+        />
+      </el-form-item>
+
+      <el-form-item label="备注" prop="remark">
+        <el-input type="textarea" v-model="ruleForm.remark" />
+      </el-form-item>
+
       <el-form-item class="flex-end">
         <el-button :loading="loading" type="primary" size="mini" @click="onSave">保存</el-button>
       </el-form-item>
@@ -97,6 +149,7 @@ export default {
   data(){
     return {
       ruleForm:{},
+      service_cat:[],
       loading:false,
       rules:{
         name:[
@@ -134,12 +187,40 @@ export default {
             trigger: 'change'
           }
         ],
+      total_fee:[
+          {
+            required: true,
+            message: '请输入含税报价',
+            trigger: 'change'
+          }
+      ],
+      pay_fee:[
+          {
+            required: true,
+            message: '请输入非税报价',
+            trigger: 'change'
+          }
+      ],
        tax:[
           {
             required: true,
             message: '请输入税率',
             trigger: 'change'
           }
+        ],
+        tax_fee:[
+          {
+            required: true,
+            message: '请输入税额',
+            trigger: 'change'
+          }
+        ],
+        remark:[
+          {
+            required: true,
+            message: '请输入备注',
+            trigger: 'change'
+          }
         ]
       }
     }
@@ -147,11 +228,21 @@ export default {
   methods:{
     initForm(){
       this.ruleForm = {...this.sitem}
-      this.$refs.category.init(this.sitem.service_cat)
+      this.$refs.sort.init(this.sitem.merge_id.split('-'))
     },
     number_change(num,prop){
       this.ruleForm[prop] = num
     },
+    handleCategoryChange(value = []){
+      if(value.length !== 3){
+        this.ruleForm.service_cat = ""
+        this.service_cat = []
+        return 
+      }
+
+      this.ruleForm.service_cat = value[2]
+      this.service_cat = value
+    },
     handleClose(){
       this.innerVisible = false
     },
@@ -159,7 +250,7 @@ export default {
       this.$refs.ruleForm.validate(async isValid => {
         if(!isValid) return
 
-        const { id,name,service_cat,unit,price,num,remark,store_id,tax } = this.ruleForm;
+        const { id,name,service_cat,unit,price,num,remark,total_fee,tax,pay_fee,tax_fee } = this.ruleForm;
 
         const params = {
           id,
@@ -171,7 +262,10 @@ export default {
           remark,
           planId: this.$route.query.id,
           store_id: this.storeId,
-          tax
+          total_fee,
+          pay_fee,
+          tax,
+          tax_fee
         }
 
         if(this.type === ModalTypes.copy){