Parcourir la source

Merge branch 'sit'

xiaodai2022 il y a 2 ans
Parent
commit
b76bf0f932

Fichier diff supprimé car celui-ci est trop grand
+ 10 - 0
dist/static/js/0.js


+ 2 - 0
src/apis/service/orderEntry/orderConfirm/index.js

@@ -20,4 +20,6 @@ export default {
     sourceList: (data, params) => http(api + "getsourcedata", data, "post", params),
     //验证售价
     salegetprice: (data, params) => http(api + "salegetprice", data, "post", params),
+    // 线上商品获取活动
+    goods_active: (data, params) => http(api + "actquery", data, "post", params),
 };

+ 9 - 0
src/apis/service/purchaseIn/recovery/index.js

@@ -0,0 +1,9 @@
+// 物业管理员
+import http from "@/apis/axios";
+const api = "admin/";
+export default {
+  // 分页查询
+  list: (data, params) => http(api + "consultbidlist", data, "post", params),
+  // 采返商品详情
+  good_detail: (data, params) => http(api + "consultfeadinfo", data, "post", params),
+};

+ 4 - 4
src/components/search-good-online-modal/main.vue

@@ -104,9 +104,8 @@
                     >
                       <el-option label="商品名称" value="1" />
                       <el-option label="商品编码" value="2" />
-                      <!-- <el-option label="平台商品编码" value="3" />  -->
-                      </el-select
-                  >
+                      <el-option label="平台商品编码" value="3" />
+                    </el-select>
                   </el-input>
                 </el-col>
 
@@ -198,6 +197,7 @@ export default {
         good_code: "", // 商品编码
         good_name: "", // 商品名称
         plat_code: "",
+
         page: 1, // 页码
         size: 15, // 每页显示条数
       },
@@ -300,7 +300,7 @@ export default {
         model.brandid.length > 0 ? model.brandid[model.brandid.length - 1] : "";
       model.good_code = this.select === "2" ? this.sinput : ""; // 商品编码
       model.good_name = this.select === "1" ? this.sinput : ""; // 商品名称
-      // model.platform_code = this.select === "3" ? this.sinput : "";
+      model.plat_code = this.select === "3" ? this.sinput : "";
       // model.platform_code =
       //   model.platform_code.length > 0
       //     ? model.platform_code[model.platform_code.length - 1]

+ 1 - 1
src/components/show-good-data-modal/main.vue

@@ -187,7 +187,7 @@ export default {
     async initData() {
       this.loading = true;
       const { code, message, data } = await asyncRequest.detail({
-        skuCode: this.id,
+        skuCode: this.skuCode,
       });
       this.loading = false;
       if (code === 0) {

+ 6 - 5
src/views/goodStore/active/components/baseForm.vue

@@ -113,12 +113,13 @@
         <el-col
           :span="24"
           v-if="
-            status == '' ||
             status == '4' ||
-            (status === '0' && powers.some((item) => item !== '056')) ||
-            (status === '1' && powers.some((item) => item !== '057')) ||
-            (status === '2' && powers.some((item) => item !== '058')) ||
-            (status === '3' && powers.some((item) => item !== '059'))
+            !(
+              (status === '0' && powers.some((item) => item == '056')) ||
+              (status === '1' && powers.some((item) => item == '057')) ||
+              (status === '2' && powers.some((item) => item == '058')) ||
+              (status === '3' && powers.some((item) => item == '059'))
+            )
           "
         >
           <el-form-item

+ 6 - 6
src/views/goodStore/active/detail.vue

@@ -234,15 +234,15 @@ export default {
 </script>
    <style lang="scss" scoped>
 .activeDetail {
-  position: relative;
-  height: 100%;
-  width: 100%;
+  // position: relative;
+  // height: 100%;
+  // width: 100%;
   box-sizing: border-box;
   .activeDetail-main {
-    overflow-y: scroll;
-    position: relative;
+    // overflow-y: scroll;
+    // position: relative;
     padding: 10px;
-    height: 100%;
+    // height: 100%;
     width: 100%;
   }
   .activeDetail-title {

+ 53 - 13
src/views/orderEntry/orderConfirm/columns.js

@@ -56,19 +56,52 @@ const ruleForm = {
   price: "", //单价
   num: "", //数量
   before_discount_all_price: "", //优惠前总金额
-  activity_name: "", //优惠活动名称
-
+  activity_id: "", //优惠活动名称
   order_remark: "", //订单备注
-
   addr: "", //联系地址
   addr_code: [], //省市区
 }
 const rules = {
+  platform_code: [
+    {
+      required: true,
+      trigger: "blur",
+      message: "平台订单号不能为空",
+    },
+  ],
+  platform_time: [
+    {
+      required: true,
+      trigger: "change",
+      message: "平台订单下单时间不能为空",
+    },
+  ],
+  plat_code: [
+    {
+      required: true,
+      trigger: "blur",
+      message: "平台商品编号不能为空",
+    },
+  ],
+  mode: [
+    {
+      required: true,
+      trigger: "change",
+      message: "收费模式不能为空",
+    },
+  ],
+  sale_source: [
+    {
+      required: true,
+      trigger: "change",
+      message: "销售渠道不能为空",
+    },
+  ],
   contactor: [
     {
       required: true,
       trigger: "blur",
-      message: "联系人不能为空",
+      message: "收货人不能为空",
     },
   ],
   mobile: [
@@ -108,6 +141,13 @@ const rules = {
       trigger: "blur",
     },
   ],
+  order_remark: [
+    {
+      required: true,
+      message: "订单备注不能为空",
+      trigger: "blur",
+    },
+  ],
 }
 //是否定制
 const options1 = [
@@ -195,7 +235,7 @@ const onlineColumns = [
     prop: "company",
     label: "业务企业名称",
     _slot_: "company",
-    span:24
+    span: 24
   },
   // {
   //   prop: "online_reason",
@@ -212,12 +252,12 @@ const onlineColumns = [
   {
     prop: "platform_name",
     label: "所属平台",
-    span:24
+    span: 24
   },
   {
     prop: "brand_name",
     label: "品牌",
-    span:24
+    span: 24
   },
   // {
   //   prop: "platform_code_en",
@@ -232,15 +272,15 @@ const onlineColumns = [
   {
     prop: "cat_info",
     label: "分类",
-    _slot_:'cat_info',
-    span:24
+    _slot_: 'cat_info',
+    span: 24
   },
 
 
   {
     prop: "unit",
     label: "单位",
-    span:10
+    span: 10
   },
 
 
@@ -255,13 +295,13 @@ const onlineColumns = [
     prop: "is_stock",
     label: "是否库存品",
     _slot_: "is_stock",
-    span:14
+    span: 14
   },
   {
     prop: "tax",
     label: "税点",
     append: '%',
-    span:10
+    span: 10
   },
 
 
@@ -269,7 +309,7 @@ const onlineColumns = [
     prop: "exclusive",
     label: "专属类型",
     _slot_: "exclusive",
-    span:14
+    span: 14
   },
 ]
 export {

+ 241 - 90
src/views/orderEntry/orderConfirm/index.vue

@@ -51,21 +51,31 @@
                 <el-col :span="11" class="nop">
                   <el-row>
                     <el-col :span="12" class="border">
-                      <el-form-item prop="platform_code">
+                      <el-form-item
+                        prop="platform_code"
+                        :style="{
+                          marginBottom: status !== '2' ? '0px' : '18px',
+                        }"
+                      >
                         <el-input
                           v-model="ruleForm.platform_code"
                           maxlength="100"
-                          :disabled="isDetail"
+                          :disabled="status !== '2'"
                           placeholder="平台订单号"
                         /> </el-form-item
                     ></el-col>
 
                     <el-col :span="12" class="border">
-                      <el-form-item prop="po_code">
+                      <el-form-item
+                        prop="po_code"
+                        :style="{
+                          marginBottom: status !== '2' ? '0px' : '18px',
+                        }"
+                      >
                         <el-input
                           v-model="ruleForm.po_code"
                           maxlength="100"
-                          :disabled="isDetail"
+                          :disabled="status !== '2'"
                           placeholder="其他单号"
                         />
                       </el-form-item>
@@ -130,10 +140,10 @@
                               <span>SPU编号:</span
                               ><span>{{ conGoodData.spuCode }}</span>
                             </li>
-                            <li>
+                            <!-- <li>
                               <span>平台商品编码:</span
                               ><span>{{ conGoodData.platform_code_en }}</span>
-                            </li>
+                            </li> -->
                           </ul>
                           <i
                             class="el-icon-warning-outline fr"
@@ -193,24 +203,37 @@
                 <el-col :span="11" class="nop">
                   <el-row>
                     <el-col :span="12" class="border">
-                      <el-form-item prop="platform_time">
+                      <el-form-item
+                        prop="platform_time"
+                        :style="{
+                          marginBottom: status !== '2' ? '0px' : '18px',
+                        }"
+                      >
                         <el-date-picker
                           type="datetime"
                           placeholder="平台订单下单时间"
                           v-model="ruleForm.platform_time"
                           style="width: 100%"
                           value-format="yyyy-MM-dd HH:mm:ss"
+                          :disabled="status !== '2'"
                           :picker-options="pickerOptions"
                           @change="selectTime"
                         >
                         </el-date-picker> </el-form-item
                     ></el-col>
                     <el-col :span="12" class="border">
-                      <el-form-item prop="plat_code">
+                      <el-form-item
+                        prop="plat_code"
+                        :style="{
+                          marginBottom: status !== '2' ? '0px' : '18px',
+                        }"
+                      >
                         <el-input
                           v-model="ruleForm.plat_code"
                           maxlength="100"
-                          :disabled="isDetail"
+                          readonly
+                          :disabled="status !== '2'"
+                          @focus="showModel = true"
                           placeholder="平台商品编号"
                       /></el-form-item>
                     </el-col>
@@ -262,10 +285,10 @@
                                 <span>SPU编号:</span
                                 ><span>{{ subGoodData.spuCode }}</span>
                               </li>
-                              <li>
+                              <!-- <li>
                                 <span>平台商品编码:</span
                                 ><span>{{ subGoodData.platform_code_en }}</span>
-                              </li>
+                              </li> -->
                             </ul>
                             <i
                               class="el-icon-warning-outline fr"
@@ -348,10 +371,17 @@
                 <el-col :span="11" class="nop">
                   <el-row>
                     <el-col :span="12" class="border">
-                      <el-form-item prop="mode">
+                      <el-form-item
+                        prop="mode"
+                        :style="{
+                          marginBottom: status !== '2' ? '0px' : '18px',
+                        }"
+                      >
                         <el-select
                           v-model="ruleForm.mode"
                           style="width: 100%"
+                          clearable
+                          :disabled="status !== '2'"
                           placeholder="收费模式"
                         >
                           <el-option
@@ -365,10 +395,17 @@
                     </el-col>
 
                     <el-col :span="12" class="border">
-                      <el-form-item prop="sale_source">
+                      <el-form-item
+                        prop="sale_source"
+                        :style="{
+                          marginBottom: status !== '2' ? '0px' : '18px',
+                        }"
+                      >
                         <el-select
                           v-model="ruleForm.sale_source"
                           style="width: 100%"
+                          clearable
+                          :disabled="status !== '2'"
                           placeholder="销售渠道"
                         >
                           <el-option
@@ -409,21 +446,31 @@
                 <el-col :span="11" class="nop">
                   <el-row>
                     <el-col :span="12" class="border">
-                      <el-form-item prop="contactor">
+                      <el-form-item
+                        prop="contactor"
+                        :style="{
+                          marginBottom: status !== '2' ? '0px' : '18px',
+                        }"
+                      >
                         <el-input
                           v-model="ruleForm.contactor"
                           maxlength="100"
-                          :disabled="isDetail"
+                          :disabled="status !== '2'"
                           placeholder="收货人"
                         />
                       </el-form-item>
                     </el-col>
                     <el-col :span="12" class="border">
-                      <el-form-item prop="mobile">
+                      <el-form-item
+                        prop="mobile"
+                        :style="{
+                          marginBottom: status !== '2' ? '0px' : '18px',
+                        }"
+                      >
                         <el-input
                           v-model="ruleForm.mobile"
                           maxlength="100"
-                          :disabled="isDetail"
+                          :disabled="status !== '2'"
                           placeholder="收货电话"
                         />
                       </el-form-item>
@@ -442,31 +489,44 @@
             <div class="tab-item-main">
               <el-row class="tab-title">
                 <el-col :span="4">
-                  <div>{{ importSitem.addr }}</div>
+                  <div style="min-height: 26px">&nbsp;</div>
                   <div>{{ importSitem.addr }}</div></el-col
                 >
                 <el-col :span="9">
-                  <div>{{ confirmSitem.addr }}</div>
+                  <div style="min-height: 26px">
+                    {{ confirmSitem.addr_name }}&nbsp;
+                  </div>
                   <div>{{ confirmSitem.addr }}</div>
                 </el-col>
                 <el-col :span="11" class="nop">
                   <el-row>
                     <el-col :span="12" class="border">
-                      <el-form-item prop="addr_code">
+                      <el-form-item
+                        prop="addr_code"
+                        :style="{
+                          marginBottom: status !== '2' ? '0px' : '18px',
+                        }"
+                      >
                         <select-area
                           :value="ruleForm.addr_code"
                           :size="'mini'"
+                          :disabled="status !== '2'"
                           placeholder="收货省市区"
                           @selectChange="select_area_change($event)"
                         />
                       </el-form-item>
                     </el-col>
                     <el-col :span="12" class="border">
-                      <el-form-item prop="addr">
+                      <el-form-item
+                        prop="addr"
+                        :style="{
+                          marginBottom: status !== '2' ? '0px' : '18px',
+                        }"
+                      >
                         <el-input
                           v-model="ruleForm.addr"
                           maxlength="100"
-                          :disabled="isDetail"
+                          :disabled="status !== '2'"
                           placeholder="详细地址"
                         />
                       </el-form-item>
@@ -486,11 +546,16 @@
                 <el-col :span="4">{{ importSitem.order_remark }}</el-col>
                 <el-col :span="9">{{ confirmSitem.order_remark }}</el-col>
                 <el-col :span="11">
-                  <el-form-item prop="order_remark">
+                  <el-form-item
+                    prop="order_remark"
+                    :style="{
+                      marginBottom: status !== '2' ? '0px' : '18px',
+                    }"
+                  >
                     <el-input
                       v-model="ruleForm.order_remark"
                       maxlength="100"
-                      :disabled="isDetail"
+                      :disabled="status !== '2'"
                       placeholder="订单备注" /></el-form-item
                 ></el-col>
               </el-row>
@@ -515,29 +580,39 @@
                 <el-col :span="11" class="nop">
                   <el-row>
                     <el-col :span="12" class="border">
-                      <el-form-item prop="num">
+                      <el-form-item
+                        prop="num"
+                        :style="{
+                          marginBottom: status !== '2' ? '0px' : '18px',
+                        }"
+                      >
                         <digital-input
                           :values="ruleForm.num"
                           :placeholder="'数量'"
                           :min="0"
-                          :disabled="false"
                           :max="100000000000"
                           :position="'right'"
                           :precision="0"
                           :size="'mini'"
                           :controls="false"
                           :append="''"
+                          :disabled="status !== '2'"
                           @reschange="number_change($event, 'num')"
                         />
                       </el-form-item>
                     </el-col>
                     <el-col :span="12" class="border">
-                      <el-form-item prop="price">
+                      <el-form-item
+                        prop="price"
+                        :style="{
+                          marginBottom: status !== '2' ? '0px' : '18px',
+                        }"
+                      >
                         <digital-input
                           :values="ruleForm.price"
                           :placeholder="'单价'"
                           :min="price_min"
-                          :disabled="false"
+                          :disabled="status !== '2'"
                           :max="100000000000"
                           :position="'right'"
                           :precision="2"
@@ -563,14 +638,30 @@
                 <el-col :span="4">{{ importSitem.activity_name }}</el-col>
                 <el-col :span="9">{{ confirmSitem.activity_name }}</el-col>
                 <el-col :span="11">
-                  <el-form-item prop="activity_name">
-                    <el-input
-                      v-model="ruleForm.activity_name"
-                      maxlength="100"
-                      :disabled="isDetail"
+                  <el-form-item
+                    prop="activity_code"
+                    :style="{
+                      marginBottom: status !== '2' ? '0px' : '18px',
+                    }"
+                  >
+                    <el-select
+                      v-model="ruleForm.activity_code"
+                      style="width: 100%"
+                      clearable
+                      :disabled="status !== '2'"
+                      @change="get_new_price"
                       placeholder="活动名称"
-                    /> </el-form-item
-                ></el-col>
+                    >
+                      <el-option
+                        v-for="(item, i) in actOptions"
+                        :key="item.activity_code + i"
+                        :label="item.activity_name"
+                        :value="item.activity_code"
+                      >
+                      </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
               </el-row>
             </div>
           </div>
@@ -592,25 +683,29 @@
               </el-row>
             </div>
           </div>
-          <div class="tab-row">
+          <div class="tab-row" v-if="status === '2'">
             <div class="tab-item-label">
               <label style="color: transparent">*</label>
             </div>
             <div class="tab-item-main tr">
-              <el-button
-                v-if="!isDetail"
-                type="primary"
-                @click="submitForm"
-                :size="'mini'"
+              <el-button type="primary" @click="submitForm" :size="'mini'"
                 >保 存
               </el-button>
-              <el-button @click="showModelThis = false" :size="'mini'">{{
+              <!-- <el-button @click="showModelThis = false" :size="'mini'">{{
                 isDetail ? "关 闭" : "取 消"
-              }}</el-button>
+              }}</el-button> -->
             </div>
           </div>
         </div>
       </el-form>
+      <search-good-online-modal
+        :once="true"
+        :sitem="{}"
+        :active="true"
+        :show-model="showModel"
+        @resultList="resultList"
+        @cancel="showModel = false"
+      />
     </div>
     <div v-else>
       <no-auth></no-auth>
@@ -636,10 +731,13 @@ import {
   options9,
   onlineColumns,
 } from "./columns";
+import searchGoodOnlineModal from "@/components/search-good-online-modal";
 export default {
   name: "orderConfirm",
   mixins: [mixinPage, resToken],
-
+  components: {
+    searchGoodOnlineModal,
+  },
   computed: {
     powers() {
       let tran =
@@ -655,6 +753,7 @@ export default {
   },
   data() {
     return {
+      showModel: false,
       hasdiff: false,
       activeTabs: "1",
       isMetal: false,
@@ -678,6 +777,7 @@ export default {
       rulesThis: {},
       coptions: [],
       options,
+      actOptions: [],
       ruleForm: {},
       rules,
       options1,
@@ -698,9 +798,7 @@ export default {
     this.initForm();
   },
   methods: {
-    getNewTime() {
-      this.newTime = new Date().valueOf();
-    },
+    change_good() {},
 
     async initForm() {
       this.loading = true;
@@ -723,7 +821,7 @@ export default {
         price,
         num,
         before_discount_all_price,
-        activity_name,
+        activity_code,
         order_remark,
         addr,
         addr_code,
@@ -741,15 +839,21 @@ export default {
         price: price || "", //单价
         num: num || "", //数量
         before_discount_all_price: before_discount_all_price || "", //优惠前总金额
-        activity_name: activity_name || "", //优惠活动名称
+        activity_code: activity_code || "", //优惠活动名称
         order_remark: order_remark || "", //订单备注
         addr: addr || "", //联系地址
-        addr_code: addr_code && addr_code.length > 0 ? addr_code : [], //省市区
+        addr_code:
+          addr_code && addr_code.length > 0 ? addr_code.split(",") : [], //省市区
       };
       this.ruleForm.before_discount_all_price = this.accMul(
         this.ruleForm.num,
         this.ruleForm.price
       );
+      await this.get_goods_active();
+      const { platform_code: platformCode } = this.subGoodData;
+      if (platformCode) {
+        await this.get_source(platformCode);
+      }
     },
 
     async initData() {
@@ -763,28 +867,24 @@ export default {
         this.confirmSitem = confirm
           ? JSON.parse(JSON.stringify(confirm))
           : null;
-        this.subSitem = user_update
-          ? JSON.parse(JSON.stringify(user_update))
-          : null;
+
         this.status = status;
+        if (
+          !(this.status === "3" || this.status === "4" || this.status === "5")
+        ) {
+          this.subSitem = confirm ? JSON.parse(JSON.stringify(confirm)) : null;
+        } else {
+          this.subSitem = user_update
+            ? JSON.parse(JSON.stringify(user_update))
+            : null;
+        }
         // console.log(this.status);
         if (this.confirmSitem && this.confirmSitem.plat_code) {
           await this.onlineData(1, this.confirmSitem.plat_code);
-          if (
-            !(this.status === "3" || this.status === "4" || this.status === "5")
-          ) {
-            await this.againForm(this.confirmSitem);
-          }
         }
         if (this.subSitem && this.subSitem.plat_code) {
           await this.onlineData(2, this.subSitem.plat_code);
-          if (
-            this.status === "3" ||
-            this.status === "4" ||
-            this.status === "5"
-          ) {
-            await this.againForm(this.subSitem);
-          }
+          await this.againForm(this.subSitem);
         }
 
         this.getNewTime();
@@ -805,15 +905,13 @@ export default {
           this.conGoodData = data;
         } else {
           this.subGoodData = data;
-          const { platform_code } = this.subGoodData;
-          if (platform_code) {
-            await this.get_source(platform_code);
-          }
         }
       } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
         this.$message.warning(message);
+        this.ruleForm.num = "0";
+        await this.get_new_price();
       }
       this.loading = false;
     },
@@ -830,6 +928,30 @@ export default {
       } else {
         this.$message.warning(message);
       }
+      console.log(this.coptions.length);
+      if (this.coptions.length == 0) {
+        this.ruleForm.sale_source = "";
+        this.$refs.ruleForm.validateField("sale_source");
+      }
+    },
+    async resultList(e) {
+      if (e && e.length === 1) {
+        const { plat_code } = JSON.parse(JSON.stringify(e[0]));
+        this.ruleForm.plat_code = plat_code || "";
+        this.$refs.ruleForm.validateField("plat_code");
+        if (plat_code) {
+          await this.onlineData(2, plat_code);
+        } else {
+          this.subGoodData = null;
+          this.coptions = [];
+          this.ruleForm.num = "0";
+          this.ruleForm.price = "0";
+          this.ruleForm.sale_source = "";
+          this.$refs.ruleForm.validateField("num");
+          this.$refs.ruleForm.validateField("price");
+          this.$refs.ruleForm.validateField("sale_source");
+        }
+      }
     },
     //省市区选择
     async select_area_change(e) {
@@ -847,26 +969,9 @@ export default {
         this.ruleForm.price
       );
     },
-    accMul(arg1, arg2) {
-      var m = 0,
-        s1 = arg1.toString(),
-        s2 = arg2.toString();
 
-      try {
-        m += s1.split(".")[1].length;
-      } catch (e) {}
-
-      try {
-        m += s2.split(".")[1].length;
-      } catch (e) {}
-
-      return (
-        (Number(s1.replace(".", "")) * Number(s2.replace(".", ""))) /
-        Math.pow(10, m)
-      );
-    },
     async get_new_price() {
-      const { num, activity_name } = this.ruleForm;
+      const { num, activity_code } = this.ruleForm;
 
       if (num * 1 === 0) {
         this.price_min = "0";
@@ -882,8 +987,8 @@ export default {
               ? subSkuCode
               : conSkuCode,
           sale_num: num,
-          is_activity: activity_name ? "1" : "0",
-          act_code: activity_name ? activity_name : "",
+          is_activity: activity_code ? "1" : "0",
+          act_code: activity_code ? activity_code : "",
         };
         if (!this.priceLoding) {
           const { isok, price } = await this.set_salegetprice(model);
@@ -897,7 +1002,28 @@ export default {
         }
       }
     },
-
+    async get_goods_active() {
+      this.actOptions = [];
+      const { skuCode, companyNo, platform_code } = this.subGoodData;
+      let model = {
+        skuCode,
+        companyNo,
+        platform_id: platform_code,
+      };
+      const { code, data, message } = await asyncRequest.goods_active(model);
+      if (code === 0) {
+        const { act } = data;
+        this.actOptions = act;
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(message);
+      }
+      if (this.actOptions.length === 0) {
+        this.ruleForm.activity_code = "";
+        this.$refs.ruleForm.validateField("activity_code");
+      }
+    },
     async resetForm() {
       // 重置
       await this.$nextTick(() => {
@@ -932,6 +1058,24 @@ export default {
         }
       });
     },
+    accMul(arg1, arg2) {
+      var m = 0,
+        s1 = arg1.toString(),
+        s2 = arg2.toString();
+
+      try {
+        m += s1.split(".")[1].length;
+      } catch (e) {}
+
+      try {
+        m += s2.split(".")[1].length;
+      } catch (e) {}
+
+      return (
+        (Number(s1.replace(".", "")) * Number(s2.replace(".", ""))) /
+        Math.pow(10, m)
+      );
+    },
     async set_salegetprice(model) {
       this.priceLoding = true;
       let resModel = {
@@ -952,12 +1096,16 @@ export default {
       this.priceLoding = false;
       return resModel;
     },
+    getNewTime() {
+      this.newTime = new Date().valueOf();
+    },
   },
 };
 </script>
    <style lang="scss" scoped>
 .orderConfirm {
   font-size: 13px;
+
   color: #909399 !important;
   line-height: 26px;
   .tab-row {
@@ -965,6 +1113,9 @@ export default {
     border-top: 1px solid #ebeef5;
     display: flex;
     align-items: stretch;
+    &:last-child {
+      border-bottom: 1px solid #ebeef5;
+    }
     .tab-item-label {
       padding: 4px 5px;
       width: 125px;

+ 6 - 0
src/views/orderEntry/orderEnter/columns.js

@@ -3,6 +3,12 @@ const listCol = [{
     fixed: "left",
     _noset_: true
   },
+  {
+    prop: "status",
+    label: "当前状态",
+    _slot_: "statusTxt",
+    width: "152px",
+  },
   {
     prop: "platform_code",
     label: "平台订单号",

+ 146 - 121
src/views/orderEntry/orderEnter/index.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="box">
-    <div class="tableBox">
+    <div
+      class="tableBox"
+      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
+    >
       <ex-table
         ref="multipleTable"
         v-loading="loading"
-        v-if="
-          powers && powers.length > 0 && powers.some((item) => item == '001')
-        "
         :table="table"
         :data="tableData"
         :columns="columns"
@@ -26,28 +26,23 @@
         "
         @selection="selection_change"
         ><template #table-header="{}">
-          <div class="searchBox">
-            <el-button
-                
-                    class="btn entry"
-                    @click="entry"
-                    size="mini"
-                    >订单导入</el-button
-                  >
-            <el-form
-              ref="form"
-              :model="parmValue"
-              label-width="80px"
-              size="medium "
-              class="form"
-            >
-              <el-row>
-                <el-col :span="5">
-                  <el-form-item
-                    label="销售方"
-                    prop="status"
-                    label-width="100px"
-                  >
+          <div class="searchBox" style="width: 100%">
+            <el-form ref="form" :model="parmValue" size="medium " class="form" style="padding-left: 80px;">
+              <el-row :gutter="10">
+                <el-col :span="8" style="width: 361px">
+                  <el-form-item>
+                    <periodDatePickerActive
+                      :start="parmValue.platform_time_start"
+                      :end="parmValue.platform_time_end"
+                      :placeholder="'下单'"
+                      :width="'165px'"
+                      :size="searchSize"
+                      @timeReturned="platformTime"
+                    />
+                  </el-form-item>
+                </el-col>
+                <el-col :span="4" style="width: 160px">
+                  <el-form-item prop="status">
                     <el-select
                       @change="
                         pageInfo.curr = 1;
@@ -56,7 +51,7 @@
                       "
                       v-model="parmValue.status"
                       style="width: 100%"
-                      placeholder="咨询类型"
+                      placeholder="状态筛选"
                     >
                       <el-option
                         v-for="item in statusArr"
@@ -68,12 +63,8 @@
                     </el-select>
                   </el-form-item>
                 </el-col>
-                <el-col :span="5">
-                  <el-form-item
-                    label="平台订单号"
-                    prop="platform_code"
-                    label-width="110px"
-                  >
+                <el-col :span="6" style="width: 160px">
+                  <el-form-item prop="platform_code">
                     <el-input
                       v-model="parmValue.platform_code"
                       @blur="
@@ -85,18 +76,12 @@
                     ></el-input>
                   </el-form-item>
                 </el-col>
-                <el-col :span="10">
-                  <el-form-item label="平台下单时间" label-width="120px">
-                    <period-date-picker
-                      :start="parmValue.platform_time_start"
-                      :end="parmValue.platform_time_end"
-                      :width="'135px'"
-                      :size="searchSize"
-                      @timeReturned="platformTime"
-                    />
-                  </el-form-item>
-                </el-col>
-                <el-col :span="3">
+
+                <el-col
+                  :span="2"
+                  class="fr"
+                  style="width: 132px; margin-left: auto"
+                >
                   <el-button
                     size="mini"
                     type="primary"
@@ -106,7 +91,7 @@
                     >批量关联库存</el-button
                   >
                 </el-col>
-                <el-col :span="1">
+                <el-col :span="2" class="fr" style="width: 66px">
                   <el-button
                     size="mini"
                     type="primary"
@@ -118,20 +103,22 @@
                 </el-col>
               </el-row>
             </el-form>
-            <el-form
-              ref="form"
-              :model="parmValue"
-              label-width="80px"
-              size="medium "
-              class="form"
-            >
-              <el-row justify="space-around">
-                <el-col :span="5">
-                  <el-form-item
-                    label="PO编号"
-                    prop="po_code"
-                    label-width="100px"
-                  >
+            <el-form ref="form" :model="parmValue" size="medium " class="form">
+              <el-row :gutter="10">
+                <el-col :span="8" style="width: 361px">
+                  <el-form-item>
+                    <periodDatePickerActive
+                      :start="parmValue.addtime_start"
+                      :end="parmValue.addtime_end"
+                      :placeholder="'导入'"
+                      :width="'165px'"
+                      :size="searchSize"
+                      @timeReturned="addtime"
+                    />
+                  </el-form-item>
+                </el-col>
+                <el-col :span="4" style="width: 160px">
+                  <el-form-item prop="po_code">
                     <el-input
                       v-model="parmValue.po_code"
                       @blur="
@@ -143,12 +130,8 @@
                     ></el-input>
                   </el-form-item>
                 </el-col>
-                <el-col :span="5">
-                  <el-form-item
-                    label="平台商品编号"
-                    prop="plat_code"
-                    label-width="110px"
-                  >
+                <el-col :span="6" style="width: 160px">
+                  <el-form-item prop="plat_code">
                     <el-input
                       v-model="parmValue.plat_code"
                       @blur="
@@ -160,18 +143,12 @@
                     ></el-input>
                   </el-form-item>
                 </el-col>
-                <el-col :span="10">
-                  <el-form-item label="导入时间" label-width="120px">
-                    <period-date-picker
-                      :start="parmValue.addtime_start"
-                      :end="parmValue.addtime_end"
-                      :width="'135px'"
-                      :size="searchSize"
-                      @timeReturned="addtime"
-                    />
-                  </el-form-item>
-                </el-col>
-                <el-col :span="3">
+
+                <el-col
+                  :span="2"
+                  class="fr"
+                  style="width: 132px; margin-left: auto"
+                >
                   <el-button
                     type="primary"
                     icon="el-icon-download"
@@ -182,8 +159,15 @@
                     ></el-button
                   >
                 </el-col>
-                <el-col :span="1">
+
+                <el-col :span="2" class="fr" style="width: 90px">
+                  <el-button class="btn entry" @click="entry" size="mini" type="success"
+                    >订单导入</el-button
+                  >
+                </el-col>
+                <el-col :span="2" class="fr" style="width: 66px">
                   <el-button
+                  type="warning"
                     icon="el-icon-refresh-right"
                     class="btn"
                     @click="reset"
@@ -195,6 +179,9 @@
             </el-form>
           </div>
         </template>
+        <template #statusTxt="{ scope }">
+          <span>{{ statusActive(scope.row.status) }}</span>
+        </template>
         <template #operation="{ scope }">
           <el-tooltip
             v-if="powers.some((item) => item == '007')"
@@ -204,12 +191,7 @@
           >
             <i
               class="el-icon-view tb-icon"
-              @click="
-                routeGoto('orderConfirm', {
-                  id: scope.row.id,
-                  type: 'view',
-                })
-              "
+              @click="wantGo(scope.row.id, scope.row.status)"
             ></i>
           </el-tooltip>
         </template>
@@ -224,6 +206,9 @@
         <span>等待数据返回</span>
       </el-dialog> -->
     </div>
+    <div v-else>
+      <no-auth></no-auth>
+    </div>
   </div>
 </template>
 
@@ -233,8 +218,12 @@ import { mapGetters } from "vuex";
 import asyncRequest from "@/apis/service/orderEntry/orderEnter";
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
+import periodDatePickerActive from "./period-date-picker/main.vue";
 export default {
   mixins: [mixinPage, resToken],
+  components: {
+    periodDatePickerActive,
+  },
   data() {
     return {
       // centerDialogVisible: false,
@@ -248,7 +237,7 @@ export default {
         { value: "5", label: "订单录入成功" },
       ],
       parmValue: {
-        status: "1",
+        status: "",
         platform_code: "",
         // cs3: "",
         po_code: "",
@@ -291,6 +280,29 @@ export default {
         return [];
       }
     },
+    statusActive() {
+      return function (status) {
+        let active = "";
+        switch (status) {
+          case "1":
+            active = "系统验证数据中";
+            break;
+          case "2":
+            active = "待确认订单信息";
+            break;
+          case "3":
+            active = "待处理(待扣减库存)";
+            break;
+          case "4":
+            active = "库存不足";
+            break;
+          case "5":
+            active = "订单录入成功";
+            break;
+        }
+        return active;
+      };
+    },
   },
   mounted() {
     this.tableData = [];
@@ -342,6 +354,16 @@ export default {
       this.parmValue.platform_time_end = e.endTime || "";
       await this.searchList();
     },
+    wantGo(id, status) {
+      if (status === "1") {
+        this.$message.warning(`脚本验证中的数据能查看详情!`);
+        return;
+      }
+      this.routeGoto("orderConfirm", {
+        id: id,
+        type: "view",
+      });
+    },
     //批量关联库存规则判断
     selectStockIf() {
       if (this.changeList.length <= 0) {
@@ -349,7 +371,7 @@ export default {
         return;
       }
       let flag = false;
-      try { 
+      try {
         this.changeList.forEach((item, index) => {
           if (item.status == "4") {
             if (item.plat_code == this.changeList[0].plat_code) {
@@ -365,50 +387,43 @@ export default {
           }
           flag = true;
         });
-
       } catch {}
-      console.log("判断函数",flag)
-      return flag
+      console.log("判断函数", flag);
+      return flag;
     },
 
     //批量关联库存
     async selectStock() {
-      
-      
-
       if (!this.selectStockIf()) {
         return;
       }
 
       let ids = [];
       let plat_code = this.changeList[0].plat_code;
-      this.changeList.forEach((item)=>{
-        ids.push(item.id)
-      })
+      this.changeList.forEach((item) => {
+        ids.push(item.id);
+      });
       let model = {
         ids,
-        plat_code
+        plat_code,
       };
       let res = await asyncRequest.relationstockbatch(model);
       if (res && res.code === 0) {
-        console.log(res)
+        console.log(res);
         this.$message.success(res.message);
-        this.searchList()
+        this.searchList();
         //成功展示弹窗
         // this.centerDialogVisible = true;
-        
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
       } else {
         this.$message.warning(res.message);
       }
-
-      
     },
     //重置按钮
     reset() {
       this.parmValue = {
-        status: "1",
+        status: "",
         platform_code: "",
         // cs3: "",
         po_code: "",
@@ -435,8 +450,8 @@ export default {
       this.searchList();
     },
     //订单导入入口
-    entry(){
-      this.$router.push("/orderEntry/orderImport")
+    entry() {
+      this.$router.push("/orderEntry/orderImport");
     },
 
     //选中触发函数
@@ -457,47 +472,57 @@ export default {
 }
 .searchBox {
   width: 100%;
-  padding-right: 12px;
+  padding-right: 17px;
 
   box-sizing: border-box;
   // padding-top: 15px;
   // margin-top: 20px;
-  display: flex;
-  flex-wrap: wrap;
+  // display: flex;
+  // flex-wrap: wrap;
 }
 .form {
   width: 100%;
-  padding-left: 50px;
+  height: 38px;
   box-sizing: border-box;
 }
 .el-row {
   display: flex;
+  // justify-content: space-between;
 }
 /deep/ .el-input__inner {
-  height: 36px;
-  line-height: 36px;
+  height: 28px;
+  line-height: 28px;
 }
 .btn {
-  height: 36px;
+  height: 28px;
+  margin-top: 5px;
   margin-left: 0px;
   display: flex;
   align-items: center;
+  // float: right;
 }
 .tableBox {
   width: 100%;
   margin-top: 20px;
 }
-.entry{
-  position: absolute;
-  top: 69px;
-  left: -1px;
+/deep/ .setcol-table-lie{
+  top: 5px !important;
+}
+/deep/ .el-dropdown-selfdefine {
+  // background: #63cbe7;
+  // color: #fff;
+  // font-weight: bold;
+  // border: none;
+
+  height: 28px;
+  bottom: 0;
 }
-/deep/ .el-dropdown-selfdefine ,.entry {
-  background: #63cbe7;
-  color: #fff;
+.entry {
+  // background: #63cbe7;
+  // color: #fff;
   font-weight: bold;
-  border: none;
-  height: 36px;
+  // border: none;
+  height: 28px;
   bottom: 0;
 }
 </style>

+ 2 - 0
src/views/orderEntry/orderEnter/period-date-picker/index.js

@@ -0,0 +1,2 @@
+import Main from './main.vue'
+export default Main

+ 144 - 0
src/views/orderEntry/orderEnter/period-date-picker/main.vue

@@ -0,0 +1,144 @@
+<template>
+  <div class="fl time">
+    <el-date-picker
+      v-model="startTime"
+      style="margin: 0"
+      class="date-picker"
+      type="date"
+      :size="size"
+      :style="{ width: width }"
+      :placeholder="(placeholder||'') + '开始日期'"
+      value-format="yyyy-MM-dd"
+      :picker-options="pickerOptions1"
+      :editable="false"
+      :clearable="true"
+      :disabled="isEdit"
+      @change="timeChange"
+    />
+    <samp style="padding: 0 3px; margin: 0">至</samp>
+    <el-date-picker
+      style="margin: 0"
+      :size="size"
+      v-model="endTime"
+      class="date-picker"
+      :style="{ width: width }"
+      type="date"
+      :placeholder="(placeholder||'') + '结束日期'"
+      :disabled="isEdit"
+      :picker-options="pickerOptions2"
+      :editable="false"
+      value-format="yyyy-MM-dd"
+      :clearable="true"
+      @change="timeChange"
+    />
+  </div>
+</template>
+
+<script>
+// 选择时间段(只有日期)组件
+// timeReturned 返回值{startTime: Number,endTime: Number}
+export default {
+  name: "PeriodDatePicker",
+  props: ["start", "end", "disabled", "size", "width", "type", "placeholder"],
+  data() {
+    return {
+      startTime: this.start,
+      endTime: this.end,
+      isEdit: this.disabled,
+      pickerOptions1: {
+        disabledDate: (time) => {
+          if (this.endTime != null && this.endTime != "" && time) {
+            return time.getTime() > new Date(this.endTime).valueOf();
+          }
+        },
+      },
+      pickerOptions2: {
+        disabledDate: (time) => {
+          if (this.startTime != null && this.startTime != "" && time) {
+            return time.getTime() < new Date(this.startTime).valueOf();
+          }
+        },
+      },
+    };
+  },
+  watch: {
+    disabled: function (val) {
+      this.isEdit = val;
+    },
+    start(val) {
+      this.startTime = val;
+    },
+    end(val) {
+      this.endTime = val;
+    },
+  },
+  mounted() {},
+  methods: {
+    timeChange() {
+      if (
+        this.startTime !== "" &&
+        this.startTime !== null &&
+        this.endTime !== "" &&
+        this.endTime !== null
+      ) {
+        if (this.type + "" === "1" && !this.setType(365)) {
+          this.showMessage("时间跨度不能超过一年!");
+          return;
+        } else if (this.type + "" === "2" && !this.setType(90)) {
+          this.showMessage("时间跨度不能超过90天!");
+          return;
+        } else if (
+          new Date(this.endTime).valueOf() < new Date(this.startTime).valueOf()
+        ) {
+          this.showMessage("结束时间不大于开始时间!");
+          return;
+        } else {
+          this.timeReturned();
+        }
+      } else {
+        this.timeReturned();
+      }
+    },
+    timeReturned() {
+      let s = this.startTime == null ? "" : this.startTime;
+      let e = this.endTime == null ? "" : this.endTime;
+      let model = {
+        startTime: s == "" ? "" : this.transformTime(s),
+        endTime: e == "" ? "" : this.transformTime(e),
+      };
+
+      this.$emit("timeReturned", model);
+    },
+
+    transformTime(tTime) {
+      let time = new Date(tTime);
+      let y = time.getFullYear();
+      let M = time.getMonth() + 1;
+      let d = time.getDate();
+      return y + "-" + (M < 10 ? "0" + M : M) + "-" + (d < 10 ? "0" + d : d);
+    },
+    showMessage(message) {
+      this.$message.error(message);
+      this.startTime = "";
+      this.endTime = "";
+      this.timeReturned();
+    },
+    setType(days) {
+      let step = 24 * 3600 * 1000;
+      let sDay = new Date(this.startTime).valueOf();
+      let eDay = new Date(this.endTime).valueOf();
+      let isok = true;
+      if (eDay - sDay > step * days) {
+        isok = false;
+      }
+
+      return isok;
+    },
+  },
+};
+</script>
+<style lang="scss">
+.date-picker.el-input {
+  // width: 150px !important;
+}
+</style>

+ 0 - 0
src/views/orderEntry/orderEnter/period-date-picker/日期选择区间


+ 50 - 11
src/views/orderEntry/orderImport/index.vue

@@ -1,15 +1,20 @@
 <template>
   <div class="box">
     <div class="con">
-      <h1>订单导入</h1>
-      <upload-excel :on-success="handleSuccess" :before-upload="beforeUpload" />
-      <h1 style="color: #0099ff">用户导入字段</h1>
-      <ex-table :columns="columns" :table="table" :data="tableData"> </ex-table>
-    </div>
-    <div class="btn">
+      
+      <div class="tab">
+        <h1></h1>
+          <upload-excel :on-success="handleSuccess" :before-upload="beforeUpload" />
+      <h1 style="color: #0099ff"></h1>
+        <ex-table :columns="columns" :table="table" :data="tableData"> </ex-table>
+        <div class="btn">
       <el-button type="primary" @click="submit">提交</el-button>
       <el-button @click="cancel">取消</el-button>
     </div>
+      </div>
+      
+    </div>
+    
   </div>
 </template>
 
@@ -18,6 +23,7 @@ import asyncRequest from "@/apis/service/orderEntry/orderImport";
 import resToken from "@/mixins/resToken";
 import { province_list, city_list, county_list } from "@/assets/js/area-data";
 import { columns } from "./columns";
+import { set } from 'js-cookie';
 export default {
   mixins: [resToken],
   data() {
@@ -157,7 +163,7 @@ export default {
       const model = {
         list: this.tableData,
       };
-
+    
       let obj = [
         { name: "平台订单号", str: "platform_code" },
         { name: "销售渠道", str: "sale_source" },
@@ -168,7 +174,10 @@ export default {
         { name: "联系地址", str: "addr" },
       ];
       let flag = true;
+      let platform_code_arr = [];
       model.list.forEach((item, index) => {
+        platform_code_arr.push(item.platform_code)
+        //必填判断
         if (flag) {
         } else {
           return;
@@ -184,12 +193,23 @@ export default {
           }
         }
       });
-      
+
+      //去重锁
+      if(platform_code_arr.length != Array.from(new Set(platform_code_arr)).length){
+        this.$message.warning(`平台订单号不能重复`);
+        return;
+      }
       if(flag){
         this.submitHttp(model)
       }
     },
     async submitHttp(model) {
+      
+      if(model.list.length<=0){
+        this.$message.warning("导入数据不能为空");
+        return;
+      }
+     
       const res = await asyncRequest.orderimport(model);
       if (res && res.code === 0) {
         this.$notify.success({
@@ -211,16 +231,35 @@ export default {
 <style lang="scss" scoped>
 .box {
   width: 100%;
+  padding-top: 50px;
+  box-sizing: border-box;
+  height: 100vh;
+  // overflow: hidden;
+  background: #f7f7f7e1;
 }
 .con {
-  width: 100%;
+  width: 95%;
+  margin: 0px auto;
+  background: #fff;
+  padding: 50px;
+  box-sizing: border-box;
+  
 
   h1 {
-    margin: 30px 0 30px 20px;
-    font-size: 26px;
+    margin-bottom: 20px;
+    margin-top: 20px;
+    font-size: 16px;
     color: #333;
   }
 }
+.tab{
+  width: 100%;
+  overflow: hidden;
+  margin: auto;
+  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
+  padding: 30px;
+
+}
 .btn {
   width: 50%;
   margin: 50px auto 0;

+ 219 - 0
src/views/purchaseIn/recovery/columns.js

@@ -0,0 +1,219 @@
+const columns = [
+  {
+    prop: "infoNo",
+    label: "咨询单编号",
+    width: "155px",
+  },
+
+  {
+    prop: "bidNo",
+    label: "反馈编号",
+    width: "158px",
+  },
+  {
+    prop: "spuCode",
+    label: "反馈编号",
+    width: "158px",
+  },
+  {
+    prop: "good_name",
+    label: "商品名称",
+    _slot_: "good_name",
+    'min-width': "220px",
+  },
+  {
+    prop: "can",
+    label: "分类",
+    _slot_: "can",
+    'min-width': "180px",
+  },
+
+
+  {
+    prop: "brand_name",
+    label: "品牌",
+    width: "80px",
+  },
+
+
+  {
+    prop: "unit",
+    label: "单位",
+    width: "60px",
+  },
+  {
+    prop: "creater",
+    label: "采购员",
+    width: "60px",
+  },
+  {
+    prop: "addtime",
+    label: "创建时间",
+    width: "145px",
+  },
+  {
+    prop: "",
+    label: "操作",
+    fixed: "right",
+    _noset_: true,
+    width: "50px",
+    _slot_: "operation",
+  },
+]
+const statusOptions = [
+  { value: "0", label: "待与供应商确认" },
+  { value: "1", label: "待入库" },
+  { value: "2", label: "部分入库" },
+  { value: "3", label: "入库完成" },
+  { value: "4", label: "已取消订单" },
+];
+const order_type_options = [
+  {
+    value: "1",
+    label: "备货单",
+  },
+  {
+    value: "2",
+    label: "线上非库存品",
+  },
+  {
+    value: "3",
+    label: "咨询采返",
+  },
+  { value: "4", label: "项目采返" },
+];
+//是否定制
+const options1 = [
+  { id: "0", name: "否" },
+  { id: "1", name: "是" },
+]
+//专属类型
+const options2 = [
+  { id: "0", name: "非泰康" },
+  { id: "1", name: "泰康" },
+]
+//销售权限
+const options3 = [
+  { id: "0", name: "无销售权限" },
+  { id: "1", name: "有销售权限" },
+]
+
+//是否库存品
+const options4 = [
+  { id: "0", name: "非库存品" },
+  { id: "1", name: "库存品" },
+]
+//是否启用实时金价
+const options5 = [
+  { id: "0", name: "否" },
+  { id: "1", name: "是" },
+]
+//供货区域
+const options6 = [
+  { id: "1", name: "全国" },
+  { id: "2", name: "全国除偏远" },
+]
+//是否启用阶梯
+const options7 = [
+  { id: "0", name: "否" },
+  { id: "1", name: "是" },
+]
+const options8 = [
+  // { id: "0", name: "待提交" },
+  { id: "1", name: "待完善成本" },
+  { id: "2", name: "待产品审核" },
+  { id: "3", name: "待财务定价" },
+  { id: "4", name: "待财务审核定价" },
+  { id: "5", name: "待上线" },
+  { id: "6", name: "上线成功" },
+  { id: "7", name: "审核失败" },
+  { id: "8", name: "已下线" },
+]
+
+const options9 = [
+  { id: "0", name: "现结" },
+  { id: "1", name: "月清" },
+  { id: "2", name: "双月清" },
+]
+const costColumns = [
+  {
+    prop: "good_name",
+    label: "商品名称",
+    _slot_: "good_name",
+    span: 24,
+  },
+
+  {
+    prop: "cat",
+    label: "分类",
+    _slot_: "cat",
+    span: 8,
+  },
+
+  {
+    prop: "brand_name",
+    label: "品牌",
+    span: 6,
+  },
+
+
+  {
+    prop: "unit",
+    label: "单位",
+    span: 4,
+  },
+  {
+    prop: "send_way",
+    label: "发货方式",
+    _slot_: "send_way",
+    span: 6,
+  },
+
+  {
+    prop: "tax",
+    label: "税点",
+    append: '%',
+    span: 4,
+  },
+  {
+    prop: "pay_way",
+    label: "付款方式",
+    _slot_: "pay_way",
+    span: 4,
+  },
+
+
+  {
+    prop: "weight",
+    label: "商品总克重",
+    append: 'g',
+    span: 6,
+  },
+  {
+    prop: "creater",
+    label: "反馈人",
+    span: 4,
+  },
+  {
+    prop: "addtime",
+    label: "反馈时间",
+    span: 6,
+  },
+  {
+    prop: "noble",
+    _slot_: "noble",
+    label: "贵金属信息",
+    span: 24,
+  },
+  {
+    prop: "craft_desc",
+    label: "工艺说明",
+    span: 24,
+  },
+  {
+    prop: "remark",
+    label: "采返备注",
+    span: 24,
+  },
+]
+export { columns, statusOptions, order_type_options, options1, options2, options3, options4, options5, options6, options7, options8, options9, costColumns }

+ 229 - 0
src/views/purchaseIn/recovery/index.vue

@@ -0,0 +1,229 @@
+<template>
+  <div class="recovery pagePadding">
+    <div
+      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
+    >
+      <ex-table
+        v-loading="loading"
+        :table="table"
+        :data="tableData"
+        :columns="columns"
+        :page="pageInfo"
+        :size="size"
+        @page-curr-change="handlePageChange"
+        @page-size-change="handleSizeChange"
+        @screen-reset="
+          pageInfo.curr = 1;
+          parmValue.page = 1;
+          searchList();
+        "
+        @screen-submit="
+          pageInfo.curr = 1;
+          parmValue.page = 1;
+          searchList();
+        "
+      >
+        <template #table-header="{}">
+          <div style="width: 100%">
+            <el-row style="padding: 0 0 0 80px">
+              <el-col :span="6" style="width: 240px">
+                <el-input
+                  clearable
+                  placeholder="咨询单编号"
+                  v-model="parmValue.infoNo"
+                  maxlength="40"
+                  :size="searchSize"
+                  @blur="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                </el-input>
+              </el-col>
+              <el-col :span="6" style="width: 26s0px; padding: 0 0 0 10px">
+                <el-input
+                  clearable
+                  placeholder="反馈编号"
+                  v-model="parmValue.bidNo"
+                  maxlength="40"
+                  :size="searchSize"
+                  @blur="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                </el-input>
+              </el-col>
+
+              <el-col :span="4" style="width: 66px; float: right">
+                <el-button
+                  type="warning"
+                  class="fr"
+                  :size="searchSize"
+                  @click="restSearch"
+                >
+                  重置
+                </el-button>
+              </el-col>
+
+              <el-col :span="3" style="width: 66px; float: right">
+                <el-button
+                  :size="searchSize"
+                  type="primary"
+                  style="float: right; margin-left: 5px"
+                  @click="searchList"
+                >
+                  刷新
+                </el-button>
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+        <template #good_name="{ scope }">
+          <img
+            style="width: 20px; height: 20px"
+            class="hover fl"
+            v-viewer
+            :src="scope.row.good_img"
+            alt=""
+            v-if="scope.row.good_img"
+          />
+          <span>{{ scope.row.good_name }}</span>
+          <span v-for="(si, i) in scope.row.specinfo" :key="si.spec_id + i">
+            {{ i === 0 ? "__" : "--" }}{{ si.spec_name }}[{{ si.spec_value }}]
+          </span>
+        </template>
+        <template #can="{ scope }">
+          <span v-for="(si, i) in scope.row.can" :key="si.id + i">
+            {{ i === 0 ? "" : "_" }}{{ si.name }}
+          </span>
+        </template>
+
+        <template #operation="{ scope }">
+          <el-tooltip effect="dark" content="详情" placement="top">
+            <i
+              class="el-icon-view tb-icon"
+              @click="(modelId = scope.row.bidNo), (showModel = true)"
+            ></i>
+          </el-tooltip>
+        </template>
+      </ex-table>
+      <show-data
+        :showModel="showModel"
+        :bidNo="modelId"
+        @cancel="showModel = false"
+      />
+    </div>
+    <div v-else>
+      <no-auth></no-auth>
+    </div>
+  </div>
+</template>
+   <script>
+import mixinPage from "@/mixins/elPaginationHandle";
+import resToken from "@/mixins/resToken";
+import asyncRequest from "@/apis/service/purchaseIn/recovery";
+import { columns } from "./columns";
+import { mapGetters } from "vuex";
+import showData from "./showData";
+export default {
+  name: "recovery",
+  mixins: [mixinPage, resToken],
+  components: {
+    showData,
+  },
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    powers() {
+      let tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "recovery"
+        ) || {};
+      if (tran && tran.action && tran.action.length > 0) {
+        return tran.action;
+      } else {
+        return [];
+      }
+    },
+  },
+  data() {
+    return {
+      // 状态
+      loading: false,
+      showModel: false,
+      isDetail: false,
+      modelId: 0,
+
+      parmValue: {
+        infoNo: "",
+        bidNo: "",
+        is_own: "1",
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      },
+      tableData: [],
+      // 表格 - 数据
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        _defaultHeader_: ["setcol"],
+      },
+      // 表格 - 分页
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+      // 表格 - 列参数
+      columns: columns,
+    };
+  },
+  mounted() {
+    this.searchList();
+  },
+
+  methods: {
+    restSearch() {
+      this.parmValue = {
+        infoNo: "",
+        bidNo: "",
+        is_own: "1",
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      };
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 15,
+        curr: 1,
+        total: 0,
+      };
+      this.searchList();
+    },
+
+    async searchList() {
+      this.loading = true;
+      const res = await asyncRequest.list(this.parmValue);
+      if (res && res.code === 0 && res.data) {
+        this.tableData = res.data.list;
+        this.pageInfo.total = Number(res.data.count);
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.tableData = [];
+        this.pageInfo.total = 0;
+      }
+      this.loading = false;
+    },
+  },
+};
+</script>
+   <style lang="scss" scoped>
+.recovery {
+  // text-align: right;
+}
+</style>
+   

+ 164 - 0
src/views/purchaseIn/recovery/showData.vue

@@ -0,0 +1,164 @@
+<template>
+  <el-dialog
+    :title="'采返商品详情'"
+    :center="true"
+    align="left"
+    top="8vh"
+    width="1040px"
+    @close="showModelThis = false"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    v-loading="loading"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+    append-to-body
+  >
+    <show-data-table
+      style="margin: -20px 0 0 0"
+      :sitem="sitem"
+      :columns="costColumns"
+      :border="true"
+    >
+      <template slot="good_name">
+        <img
+          v-viewer
+          style="width: 23px; height: 23px; margin: 0 5px 0 0"
+          class="fl"
+          v-if="sitem.good_img"
+          :src="sitem.good_img"
+          alt=""
+        />
+        <span>{{ sitem.good_name }}</span>
+        <span v-for="(si, i) in sitem.specinfo" :key="si.spec_id + i">
+          <span v-if="i !== 0">-</span>
+          <span v-else>_</span>
+          <span>{{ si.spec_name }}[{{ si.spec_value_name }}]</span>
+        </span>
+        <el-popover placement="top" width="300" trigger="hover">
+          <ul>
+            <li>
+              <span>商品编号:</span><span>{{ sitem.spuCode }}</span>
+            </li>
+          </ul>
+          <i class="el-icon-warning-outline fr" slot="reference"></i>
+        </el-popover>
+      </template>
+      <template slot="cat">
+        <span v-for="(si, i) in sitem.cat_info" :key="si.id + i">
+          {{ i === 0 ? "" : "_" }}{{ si.name }}
+        </span>
+      </template>
+      <template slot="send_way">
+        <span>{{ sitem.send_way === "1" ? "供应商包邮" : "公司自提" }}</span>
+      </template>
+
+      <template slot="good_type">
+        <el-tag
+          :size="'mini'"
+          v-text="
+            (options1.find((item) => item.id == sitem.good_type) || {}).name ||
+            '--'
+          "
+        />
+        <span v-if="sitem.good_type === '1'" style="padding: 0 0 0 5px"
+          >{{ sitem.moq }}起订/工期{{ sitem.customized }}天</span
+        >
+      </template>
+      <template slot="pay_way">
+        <el-tag
+          :size="'mini'"
+          v-text="
+            (options9.find((item) => item.id == sitem.pay_way) || {}).name ||
+            '--'
+          "
+        />
+      </template>
+      <template slot="noble">
+        <span v-if="sitem.noble_name"
+          >{{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
+            sitem.noble_name
+          }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
+            sitem.is_gold_price === "0" ? "不" : ""
+          }}启用实时金价-{{ sitem.is_diff === "1" ? "有" : "无" }}工差-{{
+            sitem.config
+          }}-{{ sitem.other_config }}</span
+        >
+        <span v-else>--</span>
+      </template>
+    </show-data-table>
+  </el-dialog>
+</template>
+
+<script>
+import {
+  options1,
+  options2,
+  options3,
+  options4,
+  options5,
+  options6,
+  options7,
+  options8,
+  options9,
+  costColumns,
+} from "./columns";
+import resToken from "@/mixins/resToken";
+import asyncRequest from "@/apis/service/purchaseIn/recovery";
+export default {
+  name: "showData",
+  props: ["showModel", "bidNo"],
+  mixins: [resToken],
+  data() {
+    return {
+      newTime: "",
+      loading: true,
+      showModelThis: this.showModel,
+      sitem: "",
+      options1,
+      options2,
+      options3,
+      options4,
+      options5,
+      options6,
+      options7,
+      options8,
+      options9,
+      costColumns,
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initData();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+
+  methods: {
+    async initData() {
+      this.loading = true;
+      const { code, message, data } = await asyncRequest.good_detail({
+        bidNo: this.bidNo,
+      });
+      if (code === 0) {
+        this.sitem = data;
+        this.loading = false;
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(message);
+      }
+    },
+  },
+};
+</script>
+
+<style>
+</style>

+ 0 - 0
src/views/purchaseIn/recovery/采购采返查询


+ 111 - 4
src/views/purchaseIn/workbench/components/baseForm.vue

@@ -14,9 +14,28 @@
         :span="24"
         style="padding: 12px 16px 12px 16px; text-align: right"
       >
-        <!-- <span
-          >成本合计:<span>{{ back_total }}</span></span
-        > -->
+      <!-- 贵金属重量*供应商采购金价 + 工艺费*贵金属重量+加标费+包装费+证书费+成本裸价+运费+其他费用=成本合计 -->
+      <!-- 贵金属重量*供应商采购金价 + 工艺费*贵金属重量+加标费+包装费+证书费+成本裸价+运费=成本合计 -->
+      <!-- ps:没有其他费用-->  
+      <!-- (ruleForm.noble_weight*askItem.gold_price)+ (ruleForm.cost_fee*ruleForm.noble_weight)
+      + ruleForm.mark_fee + ruleForm.pakge_fee + ruleForm.cert_fee + ruleForm.nake_fee + ruleForm.delivery_fee-->
+      <!-- 乘法精度函数调用在mounted(初始调用),number_change函数(改变调用),如果放在dom层初始值时undifind会报错  r1,r2-->
+        <span
+          >成本合计:<span>
+            {{ 
+              accAdd(
+                r1,
+                r2,
+                ruleForm.mark_fee,
+                ruleForm.pakge_fee,
+                ruleForm.cert_fee,
+                ruleForm.nake_fee,
+                ruleForm.delivery_fee,
+                )
+            }}
+           <!-- {{ruleForm.delivery_fee}} -->
+            </span></span
+        >
         <span
           class="fl"
           style="height: 28px; font-size: 16px; line-height: 28px"
@@ -611,7 +630,7 @@ import {
 export default {
   name: "goodsCostAdd",
   mixins: [resToken],
-  props: ["showModel", "id", "type", "sitem", "askItem", "newTime", "editId"],
+  props: ["showModel", "id", "type", "sitem", "askItem", "newTime", "editId",],
   components: {
     baseFormAddEdit,
   },
@@ -666,12 +685,96 @@ export default {
       options11: options11,
       ruleForm: {},
       rules: JSON.parse(JSON.stringify(rules)),
+      r1:"",
+      r2:"",
     };
   },
   mounted() {
     this.initForm();
+
+  this.$nextTick(()=>{
+    this.r1 = this.accMul(this.ruleForm.noble_weight,this.askItem.gold_price)
+    this.r2 = this.accMul(this.ruleForm.cost_fee,this.ruleForm.noble_weight)
+   console.log(this.r1,this.r2)
+  })
+   
+    
   },
   methods: {
+    //加法精度问题
+//     accAdd(arg1,arg2){ 
+//     var r1,r2,m; 
+//     try{
+//     	r1=arg1.toString().split(".")[1].length;
+//     }catch(e){
+//     	r1=0;
+//     } 
+//     try{
+//     	r2=arg2.toString().split(".")[1].length;
+//     }catch(e){
+//     	r2=0;
+//     } 
+//     m=Math.pow(10,Math.max(r1,r2)) ;
+//     return (arg1*m+arg2*m)/m ;
+// },
+accAdd(arg1,arg2,arg3,arg4,arg5,arg6,arg7){ 
+    var r1,r2,r3,r4,r5,r6,r7,m; 
+    console.log(arg1,arg2,arg3,arg4,arg5,arg6,arg7)
+    try{
+    	r1=arg1.toString().split(".")[1].length;
+    }catch(e){
+    	r1=0;
+    } 
+    try{
+    	r2=arg2.toString().split(".")[1].length;
+    }catch(e){
+    	r2=0;
+    }
+    try{
+    	r3=arg3.toString().split(".")[1].length;
+    }catch(e){
+    	r3=0;
+    }  
+    try{
+    	r4=arg4.toString().split(".")[1].length;
+    }catch(e){
+    	r4=0;
+    } 
+    try{
+    	r5=arg5.toString().split(".")[1].length;
+    }catch(e){
+    	r5=0;
+    } 
+    try{
+    	r6=arg6.toString().split(".")[1].length;
+    }catch(e){
+    	r6=0;
+    } 
+    try{
+    	r7=arg7.toString().split(".")[1].length;
+    }catch(e){
+    	r7=0;
+    } 
+    m=Math.pow(10,Math.max(r1,r2,r3,r4,r5,r6,r7)) ;
+    return (arg1*m+arg2*m+arg3*m+arg4*m+arg5*m+arg6*m+arg7*m)/m ;
+},
+
+     //乘法精度问题
+    accMul(arg1, arg2) {
+        var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
+        try {
+            m += s1.split(".")[1].length;
+        }
+        catch (e) {
+        }
+        try {
+            m += s2.split(".")[1].length;
+        }
+        catch (e) {
+        }
+        let numStr = Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
+        return numStr.toString()
+    },
     async initForm() {
       this.supplierNo = [];
       console.log(this.id);
@@ -698,6 +801,10 @@ export default {
     number_change(e, key) {
       this.ruleForm[key] = e + "" || "0";
       this.$refs.ruleForm.validateField(key);
+      this.$nextTick(()=>{
+      this.r1 = this.accMul(this.ruleForm.noble_weight,this.askItem.gold_price)
+      this.r2 = this.accMul(this.ruleForm.cost_fee,this.ruleForm.noble_weight)
+  })
     },
     async initData() {
       this.loading = true;

+ 1 - 1
src/views/sellOut/bargainList/detail.vue

@@ -437,7 +437,7 @@ export default {
 
                 {
                   confirmButtonText: "确定",
-                  cancelButtonText: "取消2",
+                  cancelButtonText: "取消",
                   type: "error",
                 }
               )

+ 1 - 1
src/views/sellOut/salesOrder/components/ShowDataTableColumns.js

@@ -195,7 +195,7 @@ const showColumns = [
     span: 6,
   },
   {
-    prop: "sale_price",
+    prop: "total_price",
     label: "总金额",
     append: '元',
     span: 6,

+ 1 - 0
src/views/stock/allot/components/Inspection-table.vue

@@ -312,6 +312,7 @@ export default {
         resList = [];
       oldList.forEach((v1) => {
         let goodModel = {
+          id:v1.id,
           good_code: v1.type_code,
           usable_num: v1.usable_stock,
           error_num: v1.error_num,

+ 2 - 1
src/views/stock/allot/components/addForm.vue

@@ -622,6 +622,7 @@ export default {
       oldList.forEach((v1) => {
         let goodModel = {
           spuCode: v1.spuCode || "",
+          id: v1.id || "",
           // good_code: v1.type_code,
           allot_num: v1.allot_num,
           is_del: "0",
@@ -681,7 +682,7 @@ export default {
         dList = JSON.parse(JSON.stringify(this.delList));
       console.log(addList);
       addList.forEach((v1, index) => {
-        let oldindex = oldList.findIndex((v2) => v1.spuCode=== v2.spuCode);
+        let oldindex = oldList.findIndex((v2) => v1.spuCode === v2.spuCode);
         if (oldindex === -1) {
           addList[index].usable_num = addList[index].usable_stock;
           addList[index].allot_num = addList[index].usable_stock;

+ 33 - 16
src/views/stock/allot/components/goStock-audit.vue

@@ -1,5 +1,11 @@
 <template>
-  <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="90px">
+  <el-form
+    :model="ruleForm"
+    :rules="rules"
+    ref="ruleForm"
+    :size="'mini'"
+    label-width="90px"
+  >
     <el-row>
       <el-col :span="12"
         ><el-form-item label="物流公司" prop="post_name">
@@ -7,20 +13,28 @@
             :value="ruleForm.post_name"
             :placeholder="'请输入物流公司'"
             :names="''"
+            :size="'mini'"
             :disabled="!(status == '2' && powers.some((item) => item == '021'))"
-            :is-detail="!(status == '2' && powers.some((item) => item == '021'))"
+            :is-detail="
+              !(status == '2' && powers.some((item) => item == '021'))
+            "
             @searchChange="handleCompany"
           />
         </el-form-item>
         <el-form-item label="物流费用" prop="post_fee">
-          <el-input
-            type="number"
-            placeholder="请输入物流费用"
+          <digital-input
+            :values="ruleForm.post_fee"
+            :placeholder="'物流费用'"
+            :min="0"
             :disabled="!(status == '2' && powers.some((item) => item == '021'))"
-            v-model="ruleForm.post_fee"
-          >
-            <template slot="append">元</template>
-          </el-input>
+            :max="100000000000"
+            :position="'right'"
+            :precision="2"
+            :size="'mini'"
+            :controls="false"
+            :append="'元'"
+            @reschange="number_change($event, 'post_fee')"
+          />
         </el-form-item>
       </el-col>
 
@@ -29,6 +43,7 @@
           <el-input
             placeholder="请输入物流单号"
             maxlength="100"
+            :size="'mini'"
             :disabled="!(status == '2' && powers.some((item) => item == '021'))"
             v-model="ruleForm.post_code"
             clearable
@@ -83,16 +98,14 @@ export default {
       }
     };
     const validate_post_fee = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("物流费用不能为空!"));
+      const { required } = rule;
+      if (required && value === "") {
+        callback(new Error("不能为空!"));
       } else {
-        if (isnumber2(value)) {
-          callback();
-        } else {
-          callback(new Error("物流费用仅支持整数及两位小数!"));
-        }
+        callback();
       }
     };
+
     return {
       status: "",
       ruleForm: {
@@ -148,6 +161,10 @@ export default {
         }
       });
     },
+    async number_change(e, key) {
+      this.ruleForm[key] = e + "" || "0";
+      this.$refs.ruleForm.validateField(key);
+    },
     // 商品保存提交
     async submitForm() {
       await this.$refs.ruleForm.validate(async (valid) => {

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff