Sfoglia il codice sorgente

Merge branch 'feature/Feature-sales' into develop

莫绍宝 3 anni fa
parent
commit
1bc8aece44

+ 4 - 4
src/api/policy_list.js

@@ -286,7 +286,7 @@ export function getProductList(params) {
 //获取轮播图列表
 export function getImgCarouseList(params) {
   return request({
-    url:'/record/list',
+    url: '/record/list',
     method: 'get',
     params
   })
@@ -295,7 +295,7 @@ export function getImgCarouseList(params) {
 //轮播图显示与隐藏
 export function handleImgIsShow(params) {
   return request({
-    url:'/record/updateImgStatus',
+    url: '/record/updateImgStatus',
     method: 'post',
     params
   })
@@ -304,7 +304,7 @@ export function handleImgIsShow(params) {
 //增加轮播图
 export function addImgCarousel(params) {
   return request({
-    url:'/record/carousel/add',
+    url: '/record/carousel/add',
     method: 'post',
     data: params
   })
@@ -313,7 +313,7 @@ export function addImgCarousel(params) {
 //修改轮播图
 export function editImgCarousel(params) {
   return request({
-    url:'/record/update',
+    url: '/record/update',
     method: 'post',
     data: params
   })

+ 2 - 2
src/views/basic_data/material/components/material_list-detail.vue

@@ -55,7 +55,7 @@
               </el-col>
 
               <el-col>
-                <el-form-item label="旧物料编码" size="small">
+                <el-form-item label="金蝶编码" size="small">
                   <el-input v-model="detail.number"></el-input>
                 </el-form-item>
               </el-col>
@@ -177,7 +177,7 @@
 
                 <el-col :span="24">
                   <el-form-item label="存货类别" size="small">
-                    <el-input v-model="detail.categoryId"></el-input>
+                    <el-input v-model="detail.categoryName"></el-input>
                   </el-form-item>
                 </el-col>
 

+ 3 - 3
src/views/basic_data/material/components/modify_list-apply.vue

@@ -121,7 +121,7 @@
                     <el-option
                       v-for="item in scope.row.saleTypes"
                       :label="item.saleName"
-                      :value="item.mainId"
+                      :value="item.id"
                     ></el-option>
                   </el-select>
                   <!-- <el-select
@@ -920,13 +920,13 @@ export default {
       this.rebateList = this.rebateList.filter((k) => {
 
           saleArr = saleTypes.filter((i) => {
-            return e == i.mainId;
+            return e == i.id;
           })
           return saleArr[0].id === k.saleTypeId
 
       });
 
-      this.items[index].mainId = saleArr[0].mainId
+
       this.items[index].mainName = saleArr[0].mainName
       this.items[index].saleTypeId = saleArr[0].id
       this.items[index].saleTypeName = saleArr[0].saleName

+ 38 - 31
src/views/engin_deposit/deposit_list.vue

@@ -59,7 +59,7 @@
                 </el-date-picker>
               </el-form-item>
             </el-col>
-            <el-col :xs="24" :sm="12" :lg="6">
+            <!-- <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="产品名称" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
@@ -68,19 +68,22 @@
               <el-form-item label="规格型号" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
-            </el-col>
-
-            <el-col :xs="24" :sm="24" :lg="12">
+            </el-col> -->
+            <el-col :xs="24" :sm="24" :lg="24">
               <el-form-item label="" class="fr">
-                <el-button size="small" @click="resetScreenForm">清空</el-button>
-                <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
+                <el-button size="small" @click="resetScreenForm"
+                  >清空</el-button
+                >
+                <el-button size="small" type="primary" @click="submitScreenForm"
+                  >搜索</el-button
+                >
               </el-form-item>
             </el-col>
           </el-row>
         </el-form>
       </div>
       <!-- 按钮 -->
-      <div class="btn-group clearfix" style="display:flex">
+      <div class="btn-group clearfix" style="display: flex">
         <el-button type="primary" size="small" @click="hanleDownloadFiles"
           >导出</el-button
         >
@@ -108,11 +111,7 @@
             @select-all="handleSelectionAllChange"
             @selection-change="handleSelectionAllChange"
           >
-            <el-table-column
-              align="center"
-              type="selection"
-              width="55"
-            >
+            <el-table-column align="center" type="selection" width="55">
             </el-table-column>
             <el-table-column
               align="center"
@@ -241,10 +240,20 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                <el-button type="text" class="textColor" @click="detailFn(scope.row)"
+                <el-button
+                  type="text"
+                  class="textColor"
+                  @click="detailFn(scope.row)"
                   >详情</el-button
                 >
-                <el-button type="text" class="textColor"  v-if="scope.row.examineStatus == 'SAVE'" @click="surrenderFn(scope.row)"
+                <el-button
+                  type="text"
+                  class="textColor"
+                  v-if="
+                    scope.row.examineStatus == 'SAVE' &&
+                    $checkBtnRole('apply', $route.meta.roles)
+                  "
+                  @click="surrenderFn(scope.row)"
                   >申请退押</el-button
                 >
                 <!-- <el-button type="text" class="textColor" slot="reference"
@@ -309,9 +318,9 @@ export default {
       listLoading: false, // 列表加载loading
       deduction: "全部",
       showPage: 1,
-      importFileList:[],
-      selectData:[],
-      baseURL:''
+      importFileList: [],
+      selectData: [],
+      baseURL: "",
     };
   },
 
@@ -322,12 +331,12 @@ export default {
     },
     //申请退押
     surrenderFn(row) {
-      this.depositManageId = row.depositManageId
+      this.depositManageId = row.depositManageId;
       this.showPage = 4;
     },
     detailFn(row) {
-      this.depositManageId = row.depositManageId
-      this.refEnginRecordNo = row.refEnginRecordNo
+      this.depositManageId = row.depositManageId;
+      this.refEnginRecordNo = row.refEnginRecordNo;
       this.showPage = 2;
     },
     getList() {
@@ -343,20 +352,19 @@ export default {
         this.listTotal = res.data.total;
       });
     },
-    handleRadio(){
-      this.getList()
+    handleRadio() {
+      this.getList();
     },
     hanleDownloadFiles() {
       if (this.selectData.length) {
-        const arr = []
+        const arr = [];
         for (let i = 0; i < this.selectData.length; i++) {
-            arr.push( this.selectData[i].depositManageId)
+          arr.push(this.selectData[i].depositManageId);
         }
-       downloadFiles("/deposit-manage/export",{id:arr});
-      }else{
-        this.$errorMsg('请选择押金项')
+        downloadFiles("/deposit-manage/export", { id: arr });
+      } else {
+        this.$errorMsg("请选择押金项");
       }
-
     },
     // 导入
     async handleImport(param) {
@@ -381,10 +389,9 @@ export default {
         });
       }
     },
-     handleSelectionAllChange(e) {
+    handleSelectionAllChange(e) {
       this.selectData = e;
     },
-
   },
 };
 </script>
@@ -393,7 +400,7 @@ export default {
 .dateStyle {
   width: 100%;
 }
-.import-btn{
+.import-btn {
   margin-left: 10px;
 }
 </style>

+ 126 - 113
src/views/login/index.vue

@@ -9,7 +9,7 @@
           class="login-form"
           auto-complete="on"
           label-position="left"
-         @submit.native.prevent="handleLogin"
+          @submit.native.prevent="handleLogin"
         >
           <div class="flex">
             <div class="image-container">
@@ -46,146 +46,151 @@
                     微信登录
                   </div>
                 </div>
-                  <transition name="slide">
+                <transition name="slide">
                   <div v-if="acitve == 'pas'">
-                  <el-form-item prop="username" class="input-box">
-                    <span class="svg-container">
-                      <el-image
-                        style="width: 20px; height: 20px"
-                        :src="require('@/assets/login/icon_001.png')"
-                        fit="contain "
-                      ></el-image>
-                    </span>
-                    <el-input
-                      ref="username"
-                      v-model="loginForm.username"
-                      placeholder="请输入用户名"
-                      name="username"
-                      type="text"
-                      tabindex="1"
-                      auto-complete="on"
-                    />
-                  </el-form-item>
-
-                  <el-form-item prop="password" class="input-box">
-                    <span class="svg-container">
-                      <el-image
-                        style="width: 20px; height: 20px"
-                        :src="require('@/assets/login/icon_002.png')"
-                        fit="contain "
-                      ></el-image>
-                    </span>
-                    <el-input
-                      :key="passwordType"
-                      ref="password"
-                      v-model="loginForm.password"
-                      :type="passwordType"
-                      placeholder="请输入密码"
-                      name="password"
-                      tabindex="2"
-                      auto-complete="off"
-                      @keyup.enter.native="handleLogin"
-                    />
-                    <span class="show-pwd" @click="showPwd">
-                      <svg-icon
-                        :icon-class="
-                          passwordType === 'password' ? 'eye' : 'eye-open'
-                        "
+                    <el-form-item prop="username" class="input-box">
+                      <span class="svg-container">
+                        <el-image
+                          style="width: 20px; height: 20px"
+                          :src="require('@/assets/login/icon_001.png')"
+                          fit="contain "
+                        ></el-image>
+                      </span>
+                      <el-input
+                        ref="username"
+                        v-model="loginForm.username"
+                        placeholder="请输入用户名"
+                        name="username"
+                        type="text"
+                        tabindex="1"
+                        auto-complete="on"
                       />
-                    </span>
-                  </el-form-item>
+                    </el-form-item>
 
-                  <div class="input-box">
-                    <el-form-item prop="codeValue">
+                    <el-form-item prop="password" class="input-box">
                       <span class="svg-container">
                         <el-image
                           style="width: 20px; height: 20px"
-                          :src="require('@/assets/login/icon_003.png')"
+                          :src="require('@/assets/login/icon_002.png')"
                           fit="contain "
                         ></el-image>
                       </span>
                       <el-input
-                        ref="codeValue"
-                        v-model="loginForm.codeValue"
-                        placeholder="请输入验证码"
-                        name="codeValue"
-                        type="text"
-                        tabindex="3"
+                        :key="passwordType"
+                        ref="password"
+                        v-model="loginForm.password"
+                        :type="passwordType"
+                        placeholder="请输入密码"
+                        name="password"
+                        tabindex="2"
                         auto-complete="off"
                         @keyup.enter.native="handleLogin"
                       />
+                      <span class="show-pwd" @click="showPwd">
+                        <svg-icon
+                          :icon-class="
+                            passwordType === 'password' ? 'eye' : 'eye-open'
+                          "
+                        />
+                      </span>
                     </el-form-item>
-                    <div class="code" @click.stop="getCode">
-                      <img
-                        :src="'data:image/jpeg;base64,' + codeImage"
-                        alt=""
-                      />
+
+                    <div class="input-box">
+                      <el-form-item prop="codeValue">
+                        <span class="svg-container">
+                          <el-image
+                            style="width: 20px; height: 20px"
+                            :src="require('@/assets/login/icon_003.png')"
+                            fit="contain "
+                          ></el-image>
+                        </span>
+                        <el-input
+                          ref="codeValue"
+                          v-model="loginForm.codeValue"
+                          placeholder="请输入验证码"
+                          name="codeValue"
+                          type="text"
+                          tabindex="3"
+                          auto-complete="off"
+                          @keyup.enter.native="handleLogin"
+                        />
+                      </el-form-item>
+                      <div class="code" @click.stop="getCode">
+                        <img
+                          :src="'data:image/jpeg;base64,' + codeImage"
+                          alt=""
+                        />
+                      </div>
                     </div>
-                  </div>
 
-                  <div class="checkbox">
-                    <div class="check-yes">
-                      <el-image
-                        style="width: 16px; height: 16px"
-                        :src="require('@/assets/login/icon_004.png')"
-                        fit="contain "
-                      ></el-image>
-                      <el-image
-                        v-if="isRemenberPw"
-                        class="yes"
-                        style="width: 11px; height: 11px"
-                        :src="require('@/assets/login/icon_005.png')"
-                        fit="contain "
-                      ></el-image>
+                    <div class="checkbox">
+                      <div class="check-yes">
+                        <el-image
+                          style="width: 16px; height: 16px"
+                          :src="require('@/assets/login/icon_004.png')"
+                          fit="contain "
+                        ></el-image>
+                        <el-image
+                          v-if="isRemenberPw"
+                          class="yes"
+                          style="width: 11px; height: 11px"
+                          :src="require('@/assets/login/icon_005.png')"
+                          fit="contain "
+                        ></el-image>
+                      </div>
+                      <el-checkbox v-model="isRemenberPw"
+                        >记住账号密码</el-checkbox
+                      >
                     </div>
-                    <el-checkbox v-model="isRemenberPw"
-                      >记住账号密码</el-checkbox
-                    >
-                  </div>
 
-                  <div class="button-container">
-                    <el-button
-                      :loading="loading"
-                      type="primary"
-                      @click.native.prevent="handleLogin"
-                      >登录</el-button
-                    >
+                    <div class="button-container">
+                      <el-button
+                        :loading="loading"
+                        type="primary"
+                        @click.native.prevent="handleLogin"
+                        >登录</el-button
+                      >
+                    </div>
                   </div>
-                </div>
-                <div v-else class="wei">
-                  <div style="width: 250px; height: 250px">
-                    <!-- <el-image
+                  <div v-else class="wei">
+                    <div style="width: 250px; height: 250px">
+                      <!-- <el-image
                       style="width: 250px; height: 250px"
                       :src="require('@/assets/login/icon_001.png')"
                       fit="contain "
                     ></el-image> -->
+                    </div>
+                    <div>
+                      <div class="wei-item-tip">使用手机微信扫码登录</div>
+                      <div class="wei-item-text">
+                        网页版微信需要配合手机使用
+                      </div>
+                    </div>
                   </div>
-                  <div>
-                    <div class="wei-item-tip">使用手机微信扫码登录</div>
-                    <div class="wei-item-text">网页版微信需要配合手机使用</div>
-                  </div>
-                </div>
-                  </transition>
-
+                </transition>
               </div>
             </div>
           </div>
         </el-form>
       </div>
-      <div class="info" >
+      <div class="info">
         <div class="info-item">
           <a :href="companyList[0].icpRecordLink">{{
             companyList[0].icpRecord
           }}</a>
-          <div style="margin: 0 20px" v-if=" companyList[0].companyName && companyList[0].icpRecordLink">|</div>
+          <div
+            style="margin: 0 20px"
+            v-if="companyList[0].companyName && companyList[0].icpRecordLink"
+          >
+            |
+          </div>
           <a :href="companyList[0].pubSecurityRecordLink">
-          <el-image
-            style="width: 14px; height: 16px;"
-            :src="require('@/assets/login/icon_0001.png')"
-          ></el-image>
-          {{
-            companyList[0].pubSecurityRecord
-          }}</a>
+            <el-image
+              style="width: 14px; height: 16px"
+              :src="require('@/assets/login/icon_0001.png')"
+            ></el-image>
+            {{ companyList[0].pubSecurityRecord }}</a
+          >
         </div>
         <div>{{ companyList[0].companyName }}</div>
       </div>
@@ -285,13 +290,11 @@ export default {
     getCompanyList() {
       getCompanyList().then((res) => {
         this.companyList = res.data;
-
       });
     },
     getList() {
       getList().then((res) => {
         this.banner = res.data;
-
       });
     },
     hanleTabs(val) {
@@ -311,7 +314,7 @@ export default {
 
     // 登录
     handleLogin() {
-      console.log(this.loginForm,'lll');
+      console.log(this.loginForm, "lll");
       this.$refs.loginForm.validate((valid) => {
         if (valid) {
           this.loading = true;
@@ -321,7 +324,7 @@ export default {
               console.log(this.redirect);
               this.$router.push({ path: this.redirect || "/" });
               this.saveUnAndPw();
-                this.$store.commit("user/showMessage", "yes");
+              this.$store.commit("user/showMessage", "yes");
               this.loading = false;
             })
             .catch(() => {
@@ -493,7 +496,7 @@ $back: #333;
     transition: all 0.8s cubic-bezier(1, 0.5, 0.8, 1);
   }
 
-  .slide-fade-leave-active  {
+  .slide-fade-leave-active {
     transform: translateX(10px);
     opacity: 0;
   }
@@ -551,7 +554,7 @@ $light_gray: #eee;
   font-size: 24px;
   color: #666666;
   line-height: 40px;
-  border-bottom: 3px solid #FFFFFF;
+  border-bottom: 3px solid #ffffff;
 }
 .acitve {
   font-weight: bold;
@@ -697,6 +700,16 @@ $light_gray: #eee;
   }
 }
 
+::v-deep .el-form-item__error {
+  color: #f56c6c;
+  font-size: 12px;
+  line-height: 1;
+  padding-top: 6px;
+  position: absolute;
+  top: 100%;
+  left: 0;
+}
+
 @media only screen and (max-width: 600px) {
   .image-container {
     display: none;

+ 26 - 34
src/views/sales_policy/components/AddCondition.vue

@@ -1,10 +1,7 @@
 <template>
   <el-container>
     <el-header height="50px" class="header">
-      <el-page-header
-        @back="handleBack"
-        :content="!id ? '添加页面' : '详情页面'"
-      >
+      <el-page-header @back="handleBack" :content="!id ? '新增' : '详情页面'">
       </el-page-header>
     </el-header>
     <div class="line">
@@ -489,33 +486,28 @@ export default {
       // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
       // 如果没有返回值则默认返回false(全部无法选中)
     },
-    getCommonApi() {
+    async getCommonApi() {
       if (this.id) {
-        getConditionMaterialDetail({ id: this.policyId }).then((res) => {
-          this.pop = res.data.pop;
-          let pop = res.data.pop.split(":");
-          for (let i = 0; i < pop.length; i++) {
-            if (i == 0) {
-              this.limit = pop[i];
-              continue;
-            }
-
-            this.$set(this.popArr, `line_${i - 1}`, pop[i]);
+        const res = await getConditionMaterialDetail({ id: this.policyId });
+        this.pop = res.data.pop;
+        let pop = res.data.pop.split(":");
+        for (let i = 0; i < pop.length; i++) {
+          if (i == 0) {
+            this.limit = pop[i];
+            continue;
           }
-          console.log(this.popArr);
+          this.$set(this.popArr, `line_${i - 1}`, pop[i]);
+        }
+        for (let k = 0; k < pop.length; k++) {
+          const { data } = await getConditionMaterialList({
+            pageNum: 1,
+            pageSize: -1,
+            policyConditionId: res.data.id,
+            popType: k + 1,
+          });
 
-          for (let k = 0; k < pop.length; k++) {
-            getConditionMaterialList({
-              pageNum: 1,
-              pageSize: -1,
-              policyConditionId: res.data.id,
-              popType: k + 1,
-            }).then((res) => {
-              this.conditionBoxs.push(res.data.records);
-            });
-          }
-          console.log(this.conditionBoxs);
-        });
+          this.conditionBoxs.push(data.records);
+        }
       }
     },
     toggleSelection(rows) {
@@ -626,12 +618,12 @@ export default {
         for (let j = 0; j < this.conditionBox.length; j++) {
           datas = [...datas, ...this.conditionBox[j]];
         }
-    /**
-     * @value newConditionBox 首页保存的所有选中者,即条件1
-     * @value res.data.records,this.conditList 每次点击添加获取的最新数据
-     * @value disabled 添加条件都进行比较上一个条件或者所有条件当中的限定机型和配提机型,
-     * 如:上一个或者所有条件中已经存在disabled
-     */
+        /**
+         * @value newConditionBox 首页保存的所有选中者,即条件1
+         * @value res.data.records,this.conditList 每次点击添加获取的最新数据
+         * @value disabled 添加条件都进行比较上一个条件或者所有条件当中的限定机型和配提机型,
+         * 如:上一个或者所有条件中已经存在disabled
+         */
         if (this.newConditionBox.length) {
           this.conditList = res.data.records;
           for (let j = 0; j < this.newConditionBox.length; j++) {

+ 11 - 17
src/views/sales_policy/components/AddPolicy.vue

@@ -4,7 +4,7 @@
       <el-header height="50px" class="header">
         <el-page-header
           @back="($parent.isShow = 1), ($parent.isFlag = '')"
-          content="详情页面"
+          content="新增"
         >
         </el-page-header>
       </el-header>
@@ -56,7 +56,7 @@
                   </el-select>
                 </el-form-item>
               </el-col>
-              <el-col :xs="24" :ms="12" :lg="12">
+              <!-- <el-col :xs="24" :ms="12" :lg="12">
                 <el-form-item label="产品品类" prop="mainId">
                   <el-select
                     v-model="searchForm.mainId"
@@ -71,7 +71,7 @@
                     ></el-option>
                   </el-select>
                 </el-form-item>
-              </el-col>
+              </el-col> -->
               <el-col :xs="24" :ms="12" :lg="12">
                 <el-form-item label="生效日期" prop="startTime">
                   <el-date-picker
@@ -120,7 +120,7 @@
                 </h4>
                 <template>
                   <el-upload
-                    v-show="fang == true"
+
                     class="import-btn"
                     :action="baseURL + 'student/import'"
                     :http-request="handleImport"
@@ -130,13 +130,7 @@
                     <el-button size="small">导入货品价格表</el-button>
                   </el-upload>
                 </template>
-                <el-button
-                  size="small"
-                  class="import-btn"
-                  v-show="fang == false"
-                  @click="handelStop"
-                  >导入货品价格表</el-button
-                >
+
                 <el-button size="small" @click="hanleDownloadFiles"
                   >下载模板</el-button
                 >
@@ -488,7 +482,7 @@ export default {
       const formData = new FormData();
       formData.append("file", file);
       formData.append("policyId", this.searchForm.code);
-        formData.append("mainId", this.searchForm.mainId);
+        // formData.append("mainId", this.searchForm.mainId);
       let result = await handleImport("/policy/material/import", formData);
       this.importLoading = false;
       this.importFileList = [];
@@ -551,11 +545,11 @@ export default {
             remark: "",
           });
         });
-        this.dictList.forEach((k) => {
-          if (k.dictCode == this.searchForm.mainId) {
-            this.searchForm.mainName = k.dictValue;
-          }
-        });
+        // this.dictList.forEach((k) => {
+        //   if (k.dictCode == this.searchForm.mainId) {
+        //     this.searchForm.mainName = k.dictValue;
+        //   }
+        // });
         const params = {
           adminCompanyId: "",
           code: "",

+ 775 - 0
src/views/sales_policy/components/EditCondition.vue

@@ -0,0 +1,775 @@
+<template>
+  <el-container>
+    <el-header height="50px" class="header">
+      <el-page-header @back="handleBack" content="编辑"> </el-page-header>
+    </el-header>
+    <div class="line">
+      <el-divider></el-divider>
+      <h4>限定条件</h4>
+      <el-divider></el-divider>
+    </div>
+    <el-main v-if="id">
+      <el-row>
+        <el-row :gutter="50">
+          <el-col
+            :xs="24"
+            :sm="24"
+            :lg="24"
+            class="mgb"
+            v-for="(item, index) in conditionBox"
+            :key="index"
+          >
+            <el-row>
+              <el-row class="pdt">
+                <el-button
+                  type="primary"
+                  size="small"
+                  @click="(VisibleModle = true), getMaterialLists(index)"
+                  >添加机型</el-button
+                >
+
+                <el-button
+                  type="primary"
+                  size="small"
+                  @click="handleDeleteRow(index)"
+                  >删除机型</el-button
+                >
+              </el-row>
+              <el-row>
+                <el-table
+                  style="width: 100%"
+                  :data="item"
+                  border
+                  @select="hanleSelectAll($event, index)"
+                  @select-all="hanleSelectAll($event, index)"
+                >
+                  <el-table-column type="selection" width="55" align="center">
+                  </el-table-column>
+                  <el-table-column
+                    label="货品名称"
+                    width="300"
+                    align="center"
+                    prop="materialName"
+                  >
+                  </el-table-column>
+                  <el-table-column
+                    prop="specification"
+                    label="规格型号"
+                    align="center"
+                  >
+                  </el-table-column>
+                </el-table>
+              </el-row>
+            </el-row>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-form label-width="120px" :inline="false" size="small">
+            <el-row>
+              <el-form-item label="配置比例设置"> </el-form-item>
+            </el-row>
+            <el-col :xs="24" :sm="8" :lg="8">
+              <el-form-item label="限定机型">
+                <el-input size="small" v-model="limit"></el-input>
+              </el-form-item>
+            </el-col>
+
+            <el-col
+              :xs="24"
+              :sm="8"
+              :lg="8"
+              v-for="(len, index) in conditionBox.length - 1"
+            >
+              <el-form-item :label="'配提' + (index + 1) + '比例'">
+                <el-input
+                  size="small"
+                  v-model="popArr['line_' + index]"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+        <el-divider></el-divider>
+      </el-row>
+    </el-main>
+    <el-main v-else>
+      <el-row>
+        <el-row :gutter="50">
+          <el-col
+            :xs="24"
+            :sm="24"
+            :lg="24"
+            class="mgb"
+            v-for="(item, index) in conditionBoxs"
+            :key="index"
+          >
+            <el-row>
+              <el-row>
+                <el-table style="width: 100%" :data="item" border>
+                  <el-table-column
+                    type="selection"
+                    width="55"
+                    align="center"
+                    v-if="!id"
+                  >
+                  </el-table-column>
+                  <el-table-column
+                    type="index"
+                    label="序号"
+                    width="55"
+                    align="center"
+                    v-else
+                  >
+                  </el-table-column>
+                  <el-table-column
+                    label="货品名称"
+                    width="300"
+                    align="center"
+                    prop="materialName"
+                  >
+                    <template slot-scope="scope">{{
+                      scope.row.materialName
+                    }}</template>
+                  </el-table-column>
+                  <el-table-column
+                    prop="specification"
+                    label="规格型号"
+                    align="center"
+                  >
+                  </el-table-column>
+                </el-table>
+              </el-row>
+            </el-row>
+          </el-col>
+        </el-row>
+        <el-row v-if="conditionBoxs.length">
+          <el-form label-width="120px" :inline="false" size="small">
+            <el-row>
+              <el-form-item label="配置比例设置"> </el-form-item>
+            </el-row>
+            <el-col :xs="24" :sm="8" :lg="8">
+              <el-form-item label="限定机型">
+                <el-input
+                  size="small"
+                  v-model="limit"
+                  :readonly="!id ? false : true"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+
+            <el-col
+              :xs="24"
+              :sm="8"
+              :lg="8"
+              v-for="(len, index) in conditionBoxs.length - 1"
+            >
+              <el-form-item :label="'配提' + (index + 1) + '比例'">
+                <el-input
+                  size="small"
+                  :readonly="!id ? false : true"
+                  v-model="popArr['line_' + index]"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-form>
+          <el-col class="text_rihgt" v-if="false">
+            <el-button type="primary" size="small" @click=""
+              >添加限定条件</el-button
+            ></el-col
+          >
+        </el-row>
+        <el-divider></el-divider>
+      </el-row>
+    </el-main>
+    <el-footer height="100px" v-if="id">
+      <el-row :gutter="20">
+        <el-col :xs="24" :sm="12" :lg="12" :offset="0">
+          <el-button type="primary" size="small" @click="handleSubmit"
+            >保存</el-button
+          >
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="12" :offset="0" class="tr">
+          <el-button type="primary" size="small" @click="hanleAddModel"
+            >添加</el-button
+          >
+          <el-button type="primary" size="small" @click="handleresale"
+            >重置</el-button
+          >
+        </el-col>
+      </el-row>
+    </el-footer>
+    <el-dialog :visible.sync="VisibleModle" width="70%" center>
+      <div>
+        <el-container>
+          <el-header height="">
+            <el-form label-width="0" :inline="false" size="small">
+              <el-col :xs="24" :sm="8" :lg="8" :offset="0">
+                <el-form-item label="">
+                  <el-input
+                    v-model="saleTypeCode"
+                    placeholder="类型编号"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+            </el-form>
+          </el-header>
+          <el-main height="">
+            <el-row>
+              <el-row :gutter="50">
+                <el-col :xs="10" :ms="10" :lg="10">
+                  <el-row>
+                    <el-row> </el-row>
+                    <el-row>
+                      <el-row class="title"> 可选产品列表 </el-row>
+                      <el-table
+                        style="width: 100%"
+                        :data="conditList"
+                        border
+                        height="400"
+                        @select-all="handleSelectionAllChange"
+                        @selection-change="handleSelectionChange"
+                      >
+                        <el-table-column
+                          type="selection"
+                          width="55"
+                          :selectable="selectable"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          label="产品编码"
+                          prop="materialNumber"
+                          width="120"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          prop="materialName"
+                          label="产品名称"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          prop="specification"
+                          label="产品型号"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          prop="price"
+                          label="产品价格"
+                          align="center"
+                        >
+                        </el-table-column>
+                      </el-table>
+                      <el-row class="mg">
+                        <div>
+                          <el-pagination
+                            @size-change="handleSizeChange"
+                            @current-change="handleCurrentChange"
+                            :current-page="currentPage"
+                            :page-sizes="[10, 20, 30, 50]"
+                            :page-size="10"
+                            layout="total, sizes, prev, pager, next, jumper"
+                            :total="listTotal"
+                          >
+                          </el-pagination>
+                        </div>
+                      </el-row>
+                    </el-row>
+                  </el-row>
+                </el-col>
+                <el-col :xs="4" :ms="4" :lg="4" class="middle">
+                  <el-row :gutter="20" justify="center" align="middle">
+                    <el-row class="btn">
+                      <el-button
+                        type="primary"
+                        size="small "
+                        @click="handleAllAdd"
+                        :disabled="type == 2"
+                        >全部添加</el-button
+                      >
+                    </el-row>
+                    <el-row class="btn">
+                      <el-button
+                        type="primary"
+                        size="small "
+                        @click="handleAdd"
+                        :disabled="type == 2"
+                        >增加</el-button
+                      >
+                    </el-row>
+                    <el-row class="btn">
+                      <el-button
+                        type="primary"
+                        size="small "
+                        @click="handleDelete"
+                        :disabled="type == 1"
+                        >删除</el-button
+                      ></el-row
+                    >
+                    <el-row class="btn"
+                      ><el-button
+                        :disabled="type == 1"
+                        type="primary"
+                        size="small  "
+                        @click="handleAllDelete"
+                        >全部删除</el-button
+                      ></el-row
+                    >
+                  </el-row>
+                </el-col>
+                <el-col :xs="10" :ms="10" :lg="10">
+                  <el-row>
+                    <el-row> </el-row>
+                    <el-row>
+                      <el-row class="title"> 已选产品列表 </el-row>
+                      <el-table
+                        style="width: 100%"
+                        :data="conditList2"
+                        @select-all="handleSelectionAllChange2"
+                        @selection-change="handleSelectionChange2"
+                        border
+                        height="400"
+                      >
+                        <el-table-column
+                          type="selection"
+                          width="55"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          label="产品编码"
+                          prop="materialNumber"
+                          width="120"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          prop="materialName"
+                          label="产品名称"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          prop="specification"
+                          label="产品型号"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          prop="price"
+                          label="产品价格"
+                          align="center"
+                        >
+                        </el-table-column>
+                      </el-table>
+                      <el-row class="mg">
+                        <!-- <Pagination /> -->
+                      </el-row>
+                    </el-row>
+                  </el-row>
+                </el-col>
+              </el-row>
+            </el-row>
+          </el-main>
+        </el-container>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="VisibleModle = false">取 消</el-button>
+        <el-button type="primary" @click="handleDiaSubmit">确 定</el-button>
+      </span>
+    </el-dialog>
+  </el-container>
+</template>
+
+<script>
+import {
+  getId,
+  addPoliyCondition,
+  getConditionMaterialList,
+  getMaterialList,
+  getConditionMaterialDetail,
+} from "@/api/policy_list";
+import TabelTransfer from "./TabelTransfer.vue";
+
+import { mapState } from "vuex";
+import AddModel from "./AddModel";
+import Minxin from "@/mixin";
+
+export default {
+  mixins: [Minxin],
+  props: {
+    id: {
+      type: String,
+      default: "",
+    },
+    policyId: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      base: {
+        id: null,
+        policyConditionMaterials: [
+          {
+            id: null,
+            materialId: "",
+            materialName: "",
+            materialNumber: "",
+            policyConditionId: "",
+            policyId: "",
+            policyMaterialId: "",
+            popType: 0,
+            specification: "",
+            walletType: "",
+          },
+        ],
+        policyId: "",
+        policyName: "",
+        pop: "",
+      },
+      limit: "",
+      VisibleModle: false,
+      conditionBox: [[], []],
+      conditionBoxs: [],
+      multipleSelection: [],
+      searchForm: {
+        code: "",
+      },
+      pop: "",
+      conditList: [],
+      leftData: [],
+      rightData: [],
+      conditList2: [],
+      type: "",
+      saleTypeCode: "",
+      arrIndex: 0,
+      popArr: {},
+      fang: false,
+      newConditionBox: [],
+      currentPage: 1,
+    };
+  },
+  created() {
+    this.getCommonApi();
+  },
+  computed: mapState({
+    comCode: (state) => state.sales.code,
+  }),
+  methods: {
+    getList() {},
+    handleBack() {
+      console.log(this.id, this.policyId);
+      this.$parent.isEdit = 1;
+    },
+    /**
+     * 根据条件禁用行复选框
+     * 函数返回值为false则禁用选择(反之亦然)
+     * @param {Object} row - 行数据
+     * @param {String} index - 索引值
+     * @return Boolean
+     */
+    selectable: function (row, index) {
+      // row.disabled == undefined 才能被选中
+      if (row.disabled == undefined) {
+        return true;
+      }
+      // 函数必须有返回值且是布尔值
+      // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
+      // 如果没有返回值则默认返回false(全部无法选中)
+    },
+    async getCommonApi() {
+      if (this.id) {
+        const res = await getConditionMaterialDetail({ id: this.id });
+        this.pop = res.data.pop;
+        let pop = res.data.pop.split(":");
+        for (let i = 0; i < pop.length; i++) {
+          if (i == 0) {
+            this.limit = pop[i];
+            continue;
+          }
+          this.$set(this.popArr, `line_${i - 1}`, pop[i]);
+        }
+        this.conditionBox = [];
+        for (let k = 0; k < pop.length; k++) {
+          const { data } = await getConditionMaterialList({
+            pageNum: 1,
+            pageSize: -1,
+            policyConditionId: res.data.id,
+            popType: k + 1,
+          });
+
+          this.conditionBox.push(data.records);
+        }
+      }
+    },
+    toggleSelection(rows) {
+      if (rows) {
+        rows.forEach((row) => {
+          this.$refs.multipleTable.toggleRowSelection(row);
+        });
+      } else {
+        this.$refs.multipleTable.clearSelection();
+      }
+    },
+    hanleAddModel() {
+      this.conditionBox.push([]);
+    },
+    handleSubmit() {
+      var tableData = [];
+
+      this.newConditionBox.push(JSON.parse(JSON.stringify(this.conditionBox)));
+      for (let i = 0; i < this.conditionBox.length; i++) {
+        for (let j = 0; j < this.conditionBox[i].length; j++) {
+          this.conditionBox[i][j].popType = i + 1;
+          this.conditionBox[i][j].policyId = this.policyId;
+
+          //  this.conditionBox[i][j].policyMaterialId =this.conditionBox[i][j].materialId
+        }
+        tableData = [...tableData, ...this.conditionBox[i]];
+      }
+
+      if (!tableData.length) {
+        this.$errorMsg("请选择机型");
+        return;
+      }
+      var pop = [this.limit];
+      for (const key in this.popArr) {
+        pop.push(this.popArr[key]);
+      }
+      console.log(pop.join(":"));
+      const params = {
+        id: this.id,
+        policyConditionMaterials: tableData,
+        policyId: this.policyId,
+        policyName: "",
+        pop: pop.join(":"),
+      };
+      addPoliyCondition(params).then((res) => {
+        this.$successMsg("添加成功");
+        this.conditionBox = [[], []];
+        this.conditionBoxs = [];
+        this.limit = "";
+        this.pop = "";
+        this.popArr = {};
+        this.$parent.isCondition = 0;
+        this.$parent.isEdit = 1;
+        // Object.assign(this.$data, this.$options.data());
+        // this.$emit("handleSubmitCon", this.policyId);
+      });
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+
+    // 筛选全部数据
+    hanleSelectAll(selection, index) {
+      this.arrIndex = index;
+      this.ids = selection.map((k) => {
+        return k.id;
+      });
+      console.log(this.ids);
+    },
+    handleDeleteRow(index) {
+      if (this.arrIndex == index && this.ids.length) {
+        var arr = [];
+        for (var i = 0; i < this.conditionBox[index].length; i++) {
+          if (this.ids.indexOf(this.conditionBox[index][i].id) == -1) {
+            arr.push(this.conditionBox[index][i]);
+          }
+        }
+        this.conditionBox[index] = [];
+        this.$set(this.conditionBox, index, arr);
+      }
+    },
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.getMaterialLists(this.arrIndex);
+    },
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.getMaterialLists(this.arrIndex);
+    },
+    // 更改列表当前页
+    handleTableCurrentChange(val) {
+      this.currentPage = val;
+      this.getMaterialLists(this.arrIndex);
+    },
+    getMaterialLists(index) {
+      this.arrIndex = index;
+      getMaterialList({
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        saleTypeCode: this.saleTypeCode,
+        policyId: this.policyId,
+      }).then((res) => {
+        let datas = [];
+        for (let j = 0; j < this.conditionBox.length; j++) {
+          datas = [...datas, ...this.conditionBox[j]];
+        }
+        /**
+         * @value newConditionBox 首页保存的所有选中者,即条件1
+         * @value res.data.records,this.conditList 每次点击添加获取的最新数据
+         * @value disabled 添加条件都进行比较上一个条件或者所有条件当中的限定机型和配提机型,
+         * 如:上一个或者所有条件中已经存在disabled
+         */
+        if (this.newConditionBox.length) {
+          this.conditList = res.data.records;
+          for (let j = 0; j < this.newConditionBox.length; j++) {
+            for (let o = 0; o < this.newConditionBox[j].length; o++) {
+              if (o == index) {
+                console.log(this.newConditionBox[j][o], "dier");
+                for (let i = 0; i < res.data.records.length; i++) {
+                  for (let k = 0; k < this.newConditionBox[j][o].length; k++) {
+                    if (
+                      this.newConditionBox[j][o][k].id == res.data.records[i].id
+                    ) {
+                      res.data.records[i].disabled = true;
+                    }
+                  }
+                }
+              } else {
+                this.conditList = res.data.records;
+              }
+            }
+          }
+          this.conditList = res.data.records;
+        } else {
+          const newData = datas;
+          if (newData.length) {
+            for (let j = 0; j < res.data.records.length; j++) {
+              for (let i = 0; i < this.conditionBox[index].length; i++) {
+                if (
+                  this.conditionBox[index][i].policyMaterialId ==
+                  res.data.records[j].id
+                ) {
+
+                  res.data.records[j].disabled = true;
+                }
+              }
+            }
+          }
+          this.conditList = res.data.records;
+          this.listTotal = res.data.total;
+        }
+      });
+    },
+    handleSelectionAllChange(e) {
+      this.leftData = e;
+      this.type = 1;
+    },
+    handleSelectionChange(e) {
+      this.leftData = e;
+      this.type = 1;
+    },
+    handleSelectionAllChange2(e) {
+      this.rightData = e;
+      this.type = 2;
+    },
+    handleSelectionChange2(e) {
+      this.rightData = e;
+      this.type = 2;
+    },
+    handleAllAdd() {
+      this.conditList2 = this.leftData;
+      this.leftData = [];
+    },
+    handleAllDelete() {
+      this.conditList2 = [];
+    },
+    handleAdd() {
+      this.conditList2 = this.leftData;
+    },
+    //去掉相同数据
+    resArr(arr1, arr2) {
+      return arr1.filter((v) => arr2.every((val) => val.id != v.id));
+    },
+    handleDelete() {
+      if (this.type == 2) {
+        this.conditList2 = this.resArr(this.conditList2, this.rightData);
+        this.rightData = [];
+      }
+    },
+    handleDiaSubmit() {
+      if (this.conditList2.length) {
+        for (let i = 0; i < this.conditionBox.length; i++) {
+          if (i == this.arrIndex) {
+            this.$set(this.conditionBox, i, [
+              ...this.conditList2,
+              ...this.conditionBox[i],
+            ]);
+          }
+        }
+        this.VisibleModle = false;
+        this.conditList2 = [];
+      } else {
+        this.$errorMsg("请选择内容");
+      }
+    },
+    handleresale() {
+      Object.assign(this.$data, this.$options.data());
+    },
+  },
+  components: {
+    AddModel,
+    TabelTransfer,
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.line {
+  margin: 0 20px;
+}
+.mgb {
+  margin-bottom: 20px;
+}
+.pdt {
+  padding-bottom: 20px;
+}
+.text_rihgt {
+  text-align: right;
+}
+.header {
+  margin-bottom: 40px;
+}
+.el-main {
+  overflow: hidden;
+}
+.btn {
+  margin: 20px 0;
+  text-align: center;
+}
+.query_btn {
+  margin-left: 0;
+}
+.mg {
+  margin: 20px;
+}
+.pdt {
+  margin: 20px 0;
+}
+.el-main {
+  overflow: hidden;
+}
+.middle {
+  height: 430px;
+  display: flex;
+  align-content: center;
+  justify-content: center;
+  align-items: center;
+}
+.title {
+  padding: 10px 0;
+  text-align: center;
+  border-left: 1px solid #ebeef5;
+  border-right: 1px solid #ebeef5;
+  border-top: 1px solid #ebeef5;
+}
+</style>

File diff suppressed because it is too large
+ 785 - 261
src/views/sales_policy/components/Examine.vue


+ 10 - 11
src/views/sales_policy/policy_list.vue

@@ -133,7 +133,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :ms="6" :lg="6"> </el-col>
-            <el-col :xs="24" :ms="6" :lg="6" class="tr">
+            <el-col :xs="24" :ms="6" :lg="12" class="tr">
               <el-form-item>
                 <el-button type="primary" size="small" @click="submitScreenForm"
                   >查询</el-button
@@ -161,15 +161,16 @@
     </div>
     <div class="mymain-container">
       <el-table :data="dataList" border style="width: 100%">
-        <el-table-column fixed="left" label="操作" width="250" align="center">
+        <el-table-column fixed="left" label="操作" min-width="150" align="center">
           <template slot-scope="scope">
-            <!-- <el-button
+            <el-button
               type="text"
               size="small"
+              v-if=" scope.row.examineStatus == 'SAVE'"
               @click="(isShow = 5), (id = scope.row.id)"
               >编辑</el-button
 
-            > -->
+            >
             <el-button
               type="text"
               size="small"
@@ -217,13 +218,13 @@
             </el-popconfirm>
           </template>
         </el-table-column>
-        <!-- <el-table-column label="状态" width="120" align="center">
+        <el-table-column label="状态" width="120" align="center">
           <template slot-scope="scope">
             <el-tag v-if="scope.row.status == '1'">已生效</el-tag>
             <el-tag v-else-if="scope.row.status == '0'">未生效 </el-tag>
           </template>
-        </el-table-column> -->
-        <el-table-column label="状态" width="120" align="center">
+        </el-table-column>
+        <el-table-column label="审核状态" width="120" align="center">
           <template slot-scope="scope">
             <el-tag v-if="scope.row.examineStatus == 'SAVE'">保存</el-tag>
             <el-tag v-else-if="scope.row.examineStatus == 'WAIT'"
@@ -247,11 +248,11 @@
           align="center"
         >
         </el-table-column>
-        <el-table-column
+        <!-- <el-table-column
           prop="mainName"
           label="产品品类"
           align="center"
-        ></el-table-column>
+        ></el-table-column> -->
         <el-table-column
           prop="remark"
           label="表头备注"
@@ -301,9 +302,7 @@
     </div>
   </div>
   <AddPolicy v-else-if="isShow == 2" />
-
   <AddCondition v-else-if="isShow == 10" :id="id" :policyId="policyId" />
-
   <Examine v-else />
 </template>
 

+ 15 - 19
src/views/sales_rebate/rebate_list.vue

@@ -190,9 +190,9 @@
               :readonly="true"
             ></el-input>
           </el-form-item>
-          <el-form-item label="产品使用品类" prop="mainName">
+          <!-- <el-form-item label="产品使用品类" prop="mainName">
             <el-input v-model="dialogForm.mainName" :readonly="true"></el-input>
-          </el-form-item>
+          </el-form-item> -->
 
           <el-form-item label="返利折扣比例" prop="rebateRate">
 
@@ -272,11 +272,7 @@ export default {
           lable: "销售类型名称",
           widht: 160,
         },
-        {
-          prop: "mainName",
-          lable: "产品大类",
-          widht: 160,
-        },
+
         {
           prop: "name",
           lable: "返利类型",
@@ -372,8 +368,8 @@ export default {
       this.typeList.find((k) => {
         if (e == k.saleCode) {
           this.dialogForm.saleTypeName = k.saleName;
-          this.dialogForm.mainId = k.mainId;
-          this.dialogForm.mainName = k.mainName;
+          // this.dialogForm.mainId = k.mainId;
+          // this.dialogForm.mainName = k.mainName;
         }
       });
     },
@@ -400,8 +396,8 @@ export default {
       console.log(item);
       this.dialogForm = {
         adminCompanyId: item.adminCompanyId,
-        mainId: item.mainId,
-        mainName: item.mainName,
+        mainId: '',
+        mainName:'',
         name: item.name,
         rebateRate: item.rebateRate,
         rabateSort: item.rabateSort,
@@ -449,7 +445,7 @@ export default {
       this.$refs.dialogForm.validate((valid) => {
         if (valid) {
           if (this.type) {
-            this.hanleScreen(this.dialogForm.mainId);
+            // this.hanleScreen(this.dialogForm.mainId);
             const params = {
               ...this.dialogForm,
             };
@@ -492,13 +488,13 @@ export default {
       this.dialogVisible = false;
     },
     hanleScreen(code) {
-      this.dictListData.find((k) => {
-        if (k.dictCode == code) {
-          this.dialogForm.mainId = k.dictCode;
-          this.dialogForm.mainName = k.dictValue;
-          return;
-        }
-      });
+      // this.dictListData.find((k) => {
+      //   if (k.dictCode == code) {
+      //     this.dialogForm.mainId = k.dictCode;
+      //     this.dialogForm.mainName = k.dictValue;
+      //     return;
+      //   }
+      // });
     },
   },
   components: {

+ 5 - 11
src/views/sales_rebate/salestype_list.vue

@@ -166,7 +166,7 @@
           <el-form-item label="销售类型名称" prop="saleName">
             <el-input v-model="dialogForm.saleName"></el-input>
           </el-form-item>
-          <el-form-item label="产品大类" prop="mainId">
+          <!-- <el-form-item label="产品大类" prop="mainId">
             <el-select v-model="dialogForm.mainId" @change="handleChange">
               <el-option
                 v-for="(item, index) in productList"
@@ -177,8 +177,8 @@
               </el-option>
             </el-select>
 
-            <!-- <el-input v-model="dialogForm.mainName"></el-input> -->
-          </el-form-item>
+            <el-input v-model="dialogForm.mainName"></el-input> -->
+          <!-- </el-form-item>  -->
           <el-form-item label="状态" prop="status">
             <el-switch
               v-model="dialogForm.status"
@@ -251,11 +251,7 @@ export default {
           widht: 160,
         },
 
-        {
-          prop: "mainName",
-          lable: "产品大类",
-          widht: 160,
-        },
+
         {
           prop: "status",
           lable: "状态",
@@ -303,9 +299,7 @@ export default {
         saleName: [
           { required: true, message: "请输入销售类型名称", trigger: "blur" },
         ],
-        mainName: [
-          { required: true, message: "请输入品类名称", trigger: "blur" },
-        ],
+
       },
       productList: [],
     };

+ 24 - 16
src/views/supply/policy/components/retail_form2.vue

@@ -12,7 +12,7 @@
     <el-form
       ref="mainForm"
       :model="mainForm"
-      :rules="mainFormRules"
+
       label-width="120px"
       size="small"
       label-position="right"
@@ -53,7 +53,7 @@
             </el-date-picker>
           </el-form-item>
         </el-col>
-        <el-col :xs="24" :sm="12" :lg="8">
+        <!-- <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="产品大类" prop="type">
             <el-select
               v-model="mainForm.type"
@@ -68,8 +68,8 @@
               ></el-option>
             </el-select>
           </el-form-item>
-        </el-col>
-        <el-col :xs="24" :sm="16" :lg="16">
+        </el-col> -->
+        <el-col :xs="24" :sm="8" :lg="8">
           <el-form-item label="备注" prop="remark">
             <el-input
               v-model="mainForm.remark"
@@ -350,11 +350,11 @@
         </el-table-column>
         <el-table-column align="center" label="操作" width="100" fixed="right">
           <template slot-scope="scope">
-            <el-button
+            <!-- <el-button
               type="text"
               @click="(dialogVisible = true), (cid = scope.row.id)"
               >修改</el-button
-            >
+            > -->
             <el-button type="text" @click="deleteItem(scope.$index)"
               >删除</el-button
             >
@@ -663,6 +663,7 @@ import {
   getConditionList,
   getConditionDetail,
   getpolicyTypeList,
+  getMaterialTypeList ,
   getPolicyConditionList,
 } from "@/api/supply/policy";
 import { getDictList } from "@/api/common";
@@ -704,9 +705,9 @@ export default {
         policyRemark: "",
         policyId: "",
       },
-      mainFormRules: {
-        type: [{ required: true, message: "请选择品类", trigger: "change" }],
-      },
+      // mainFormRules: {
+      //   type: [{ required: true, message: "请选择品类", trigger: "change" }],
+      // },
       goodsList: [],
       warehouseList: [],
       warehouseValue: "",
@@ -886,7 +887,7 @@ export default {
       if (this.screenForm.factorId) {
         this.getConditionList(this.policyConditionId, this.cusIndex + 1);
       } else {
-        this.getpolicyTypeList();
+        this.getMaterialTypeList();
       }
     },
     // 获取某一个比例下的数据 ,查询popType 当前 this.cusIndex+1
@@ -1062,7 +1063,14 @@ export default {
         pageSize: 10,
         policyId: this.screenForm.policyId,
         saleTypeCode: this.screenForm.saleTypeCode,
-      }).then((res) => {});
+      }).then((res) => {
+          for (let i = 0; i < res.data.records.length; i++) {
+          res.data.records[i].qty = 1;
+        }
+        this.dataList = res.data.records;
+        this.total = res.data.total;
+        console.log(this.dataList, "kkkk");
+      });
     },
 
     handleShow() {
@@ -1301,14 +1309,14 @@ export default {
     clickSubmitForm() {
       this.$refs.mainForm.validate((valid) => {
         if (valid) {
-          let mainName =
-            this.typeList[
-              findElem(this.typeList, "dictCode", this.mainForm.type)
-            ].dictValue;
+          // let mainName =
+          //   this.typeList[
+          //     findElem(this.typeList, "dictCode", this.mainForm.type)
+          //   ].dictValue;
           let params = {
             theTime: this.mainForm.date,
             mainId: this.mainForm.type,
-            mainName,
+            mainName:'',
             remark: this.mainForm.remark,
             type: 2, // 1:普通零售单,2:政策零售单
             retailOrderItemList: this.goodsList,

+ 34 - 6
src/views/supply/policy/policy_list.vue

@@ -66,6 +66,14 @@
               <el-form-item label="订单日期" prop="date">
                 <el-date-picker
                   v-model="screenForm.date"
+                  class="dateStyle"
+                  type="datetime"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  placeholder="选择订单日期"
+                >
+                </el-date-picker>
+                <!-- <el-date-picker
+                  v-model="screenForm.date"
                   type="datetimerange"
                   range-separator="至"
                   style="width: 100%"
@@ -73,7 +81,7 @@
                   start-placeholder="开始日期"
                   end-placeholder="结束日期"
                 >
-                </el-date-picker>
+                </el-date-picker> -->
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -351,19 +359,28 @@
                   <el-button slot="reference" type="text">提审</el-button>
                 </el-popconfirm>
                 <el-button
-                  v-if="scope.row.examineStatus == 'WAIT'&&$checkBtnRole('examine', $route.meta.roles)"
+                  v-if="
+                    scope.row.examineStatus == 'WAIT' &&
+                    $checkBtnRole('examine', $route.meta.roles)
+                  "
                   type="text"
                   @click="toExamine(scope.row)"
                   >审核</el-button
                 >
                 <el-button
                   type="text"
-                  v-if="scope.row.examineStatus === 'SAVE'&&$checkBtnRole('edit', $route.meta.roles)"
+                  v-if="
+                    scope.row.examineStatus === 'SAVE' &&
+                    $checkBtnRole('edit', $route.meta.roles)
+                  "
                   @click="toForm(scope.row)"
                   >编辑</el-button
                 >
                 <el-popconfirm
-                  v-if="scope.row.examineStatus == 'WAIT'&&$checkBtnRole('apply', $route.meta.roles)"
+                  v-if="
+                    scope.row.examineStatus == 'WAIT' &&
+                    $checkBtnRole('apply', $route.meta.roles)
+                  "
                   style="margin-left: 10px"
                   title="确定撤回?"
                   @onConfirm="handleCancel(scope.row.id)"
@@ -379,10 +396,21 @@
                 <el-button
                   type="text"
                   @click="toReturn(scope.row)"
-                  v-if="scope.row.examineStatus === 'OK'&&$checkBtnRole('examine', $route.meta.roles)"
+                  v-if="
+                    scope.row.examineStatus === 'OK' &&
+                    $checkBtnRole('examine', $route.meta.roles)
+                  "
                   >退订</el-button
                 >
-   <el-popconfirm style="margin-left: 10px;" title="确定关闭吗?" @onConfirm="handleClose(scope.row.id)" v-if="!scope.row.closeTime&&$checkBtnRole('examine', $route.meta.roles)" >
+                <el-popconfirm
+                  style="margin-left: 10px"
+                  title="确定关闭吗?"
+                  @onConfirm="handleClose(scope.row.id)"
+                  v-if="
+                    scope.row.examineStatus === 'SAVE' &&
+                    $checkBtnRole('examine', $route.meta.roles)
+                  "
+                >
                   <el-button slot="reference" type="text">关闭</el-button>
                 </el-popconfirm>
               </template>

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