linwenxin il y a 8 mois
Parent
commit
762cfb8743
1 fichiers modifiés avec 90 ajouts et 203 suppressions
  1. 90 203
      src/views/auxiliaryFittings/attachmentProfile/index.vue

+ 90 - 203
src/views/auxiliaryFittings/attachmentProfile/index.vue

@@ -59,6 +59,7 @@ import {
 } from '@/api/auxiliaryFittings/attachmentProfile'
 import { commonTemplateDownload } from '@/api/common.js'
 import operation_mixin from '@/components/template/operation_mixin.js'
+import { getDataDictionary } from '@/api/dataDictionary.js'
 export default {
   components: { TemplatePage, ImageUpload },
   mixins: [import_mixin, operation_mixin],
@@ -102,6 +103,7 @@ export default {
       brandList: [],
       baseList: [],
       categoryList: [],
+      PARTS_M_GROUP: [],
       formType: 'add',
       formVisible: false
     }
@@ -431,208 +433,80 @@ export default {
             )
           }
         },
-        // {
-        //   md: 6,
-        //   isShow: this.formData.normType == 'M' ? true : false,
-        //   name: 'slot-component',
-        //   attributes: { placeholder: '请输入', type: 'number' },
-        //   formItemAttributes: {
-        //     label: '自有库存师傅分账金额',
-        //     prop: 'selfWorkerAmount',
-        //     rules: [...required]
-        //   },
-        //   render: (h, { props, onInput }) => {
-        //     var { value } = props
-        //     const that = this
-        //     return (
-        //       <div style="position: relative;">
-        //         <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-        //           <el-input
-        //             v-model={this.formData.selfWorkerAmount}
-        //             onChange={e => {
-        //               this.formData.selfWorkerAmount = Number(this.formData.selfWorkerAmount).toFixed(2)
-        //               if (e && Number(e) > Number(that.formData.normAmount)) {
-        //                 that.formData.selfWorkerAmount = ''
-        //                 return this.$message.warning('自有库存师傅分账金额必须小于收费标准!')
-        //               }
-        //               that.formData.selfWebsitAmount = this.Subtr(that.formData.normAmount, e)
-        //             }}
-        //             type="number"
-        //             placeholder="请输入"
-        //           ></el-input>
-        //           <span style="margin-left: 10px;">元</span>
-        //         </div>
-        //       </div>
-        //     )
-        //   }
-        // },
-        // {
-        //   md: 6,
-        //   isShow: this.formData.normType == 'M' ? false : true,
-        //   name: 'slot-component',
-        //   attributes: { placeholder: '请输入', type: 'number' },
-        //   formItemAttributes: {
-        //     label: '师傅分账比例',
-        //     prop: 'selfWorkerAmount',
-        //     rules: [...required]
-        //   },
-        //   render: (h, { props, onInput }) => {
-        //     var { value } = props
-        //     const that = this
-        //     return (
-        //       <div style="position: relative;">
-        //         <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-        //           <el-input
-        //             v-model={this.formData.selfWorkerAmount}
-        //             onChange={e => {
-        //               this.formData.selfWorkerAmount = Number(this.formData.selfWorkerAmount).toFixed(2)
-        //               if (e && Number(e) < 0) {
-        //                 return this.$message.warning('师傅分账比例不能为0!')
-        //               }
-        //               if (e && this.accAdd(Number(e), Number(that.formData.selfWebsitAmount)) > 100) {
-        //                 this.formData.selfWorkerAmount = 0
-        //                 return this.$message.warning('商户与师傅分账比例和最大只能100%!')
-        //               } else {
-        //                 that.formData.selfWebsitAmount = this.Subtr(100, e)
-        //               }
-        //             }}
-        //             type="number"
-        //             placeholder="请输入"
-        //           ></el-input>
-        //           <span style="margin-left: 10px;">%</span>
-        //         </div>
-        //       </div>
-        //     )
-        //   }
-        // },
-        // {
-        //   md: 6,
-        //   isShow: this.formData.normType == 'M' ? true : false,
-        //   name: 'slot-component',
-        //   attributes: { placeholder: '请输入', type: 'number' },
-        //   formItemAttributes: {
-        //     label: '外购配件师傅分账金额',
-        //     prop: 'outWorkerAmount',
-        //     rules: [...required]
-        //   },
-        //   render: (h, { props, onInput }) => {
-        //     var { value } = props
-        //     const that = this
-        //     return (
-        //       <div style="position: relative;">
-        //         <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-        //           <el-input
-        //             v-model={this.formData.outWorkerAmount}
-        //             onChange={e => {
-        //               this.formData.outWorkerAmount = Number(this.formData.outWorkerAmount).toFixed(2)
-        //               if (Number(e) > Number(that.formData.normAmount)) {
-        //                 this.formData.outWorkerAmount = ''
-        //                 return this.$message.warning('外购配件师傅分账金额必须小于收费标准!')
-        //               }
-        //               this.formData.outWebsitAmount = this.Subtr(this.formData.normAmount, e)
-        //             }}
-        //             type="number"
-        //             placeholder="请输入"
-        //           ></el-input>
-        //           <span style="margin-left: 10px;">元</span>
-        //         </div>
-        //       </div>
-        //     )
-        //   }
-        // },
-        // {
-        //   md: 6,
-        //   isShow: this.formData.normType == 'M' ? true : false,
-        //   name: 'slot-component',
-        //   attributes: { placeholder: '请输入', type: 'number' },
-        //   formItemAttributes: {
-        //     label: '自有库存商户分账金额',
-        //     prop: 'selfWebsitAmount',
-        //     rules: [...required]
-        //   },
-        //   render: (h, { props, onInput }) => {
-        //     var { value } = props
-        //     return (
-        //       <div style="position: relative;">
-        //         <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-        //           <el-input
-        //             v-model={this.formData.selfWebsitAmount}
-        //             disabled
-        //             type="number"
-        //             placeholder="请输入"
-        //           ></el-input>
-        //           <span style="margin-left: 10px;">元</span>
-        //         </div>
-        //       </div>
-        //     )
-        //   }
-        // },
-        // {
-        //   md: 6,
-        //   isShow: this.formData.normType == 'M' ? false : true,
-        //   name: 'slot-component',
-        //   attributes: { placeholder: '请输入', type: 'number' },
-        //   formItemAttributes: {
-        //     label: '商户分账比例',
-        //     prop: 'selfWebsitAmount',
-        //     rules: [...required]
-        //   },
-        //   render: (h, { props, onInput }) => {
-        //     var { value } = props
-        //     const that = this
-        //     return (
-        //       <div style="position: relative;">
-        //         <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-        //           <el-input
-        //             v-model={this.formData.selfWebsitAmount}
-        //             onChange={e => {
-        //               this.formData.selfWebsitAmount = Number(this.formData.selfWebsitAmount).toFixed(2)
-        //               if (e && Number(e) < 0) {
-        //                 return this.$message.warning('商户分账比例不能为0!')
-        //               }
-        //               if (e && this.accAdd(Number(e), Number(that.formData.selfWorkerAmount)) > 100) {
-        //                 this.formData.selfWebsitAmount = 0
-        //                 return this.$message.warning('商户与师傅分账比例和最大只能100%!')
-        //               } else {
-        //                 that.formData.selfWorkerAmount = this.Subtr(100, e)
-        //               }
-        //             }}
-        //             type="number"
-        //             placeholder="请输入"
-        //           ></el-input>
-        //           <span style="margin-left: 10px;">%</span>
-        //         </div>
-        //       </div>
-        //     )
-        //   }
-        // },
-        // {
-        //   md: 6,
-        //   isShow: this.formData.normType == 'M' ? true : false,
-        //   name: 'slot-component',
-        //   attributes: { placeholder: '请输入', type: 'number' },
-        //   formItemAttributes: {
-        //     label: '外购配件商户分账金额',
-        //     prop: 'outWebsitAmount',
-        //     rules: [...required]
-        //   },
-        //   render: (h, { props, onInput }) => {
-        //     var { value } = props
-        //     return (
-        //       <div style="position: relative;">
-        //         <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-        //           <el-input
-        //             v-model={this.formData.outWebsitAmount}
-        //             disabled
-        //             type="number"
-        //             placeholder="请输入"
-        //           ></el-input>
-        //           <span style="margin-left: 10px;">元</span>
-        //         </div>
-        //       </div>
-        //     )
-        //   }
-        // },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', type: 'number' },
+          formItemAttributes: {
+            label: '优惠价1',
+            prop: 'firstPrice',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', type: 'number' },
+          formItemAttributes: {
+            label: '优惠价2',
+            prop: 'secondPrice',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-radio',
+          options: [
+            { label: '首选配件', value: true },
+            { label: '非首选配件', value: false }
+          ],
+          attributes: {},
+          formItemAttributes: {
+            label: '是否首选配件',
+            prop: 'isHeadParts',
+            rules: []
+          }
+        },
+        {
+          isShow: true,
+          name: 'el-select',
+          md: 6,
+          options: [
+            { label: '退旧件', value: '退旧件' },
+            { label: '核销', value: '核销' },
+            { label: '无件返回', value: '无件返回' },
+            { label: '购买', value: '购买' }
+          ],
+          attributes: {
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '返厂方式',
+            prop: 'refundFactoryMode',
+            rules: []
+          }
+        },
+        {
+          isShow: true,
+          name: 'el-select',
+          md: 6,
+          options: this.PARTS_M_GROUP,
+          attributes: {
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '物料组名称',
+            prop: 'materialGroupName',
+            rules: []
+          }
+        },
         {
           md: 24,
           isShow: true,
@@ -647,7 +521,6 @@ export default {
       ]
     }
   },
-
   methods: {
     // 列表请求函数
     getList(p, cb) {
@@ -750,6 +623,20 @@ export default {
         // 打开时事件
         triggerEvent: () => {
           this.formCancel()
+          getDataDictionary({
+            pageNum: 1,
+            pageSize: -1,
+            params: [
+              { param: 'a.status', compare: '=', value: 'ON' },
+              { param: 'a.dict_type', compare: '=', value: 'PARTS_M_GROUP' }
+            ]
+          }).then(res => {
+            this.PARTS_M_GROUP = res.data.records.map(item => ({
+              value: item.dictCode,
+              label: item.dictValue
+            }))
+            console.log(this.PARTS_M_GROUP)
+          })
           this.$nextTick(() => {
             this.formType = type
             this.formVisible = true