Browse Source

feat:业务报备

snow 1 năm trước cách đây
mục cha
commit
976571cbed

+ 3 - 5
src/apis/service/sellOut/businessFiling/index.js

@@ -2,13 +2,9 @@
 import http from '@/apis/axios'
 const api = 'admin/' 
 export default {
-  cancel: (data) => http(api + 'filingCancel', data, 'post'),
-  goods_detail: (data, params) => http(api + 'goodinfo', data, 'post', params),
   addrall: (data, params) => http(api + 'addrall', data, 'post', params),
-  add: (data, params) => http(api + 'salecreate', data, 'post', params),
+  goods_detail: (data, params) => http(api + 'goodinfo', data, 'post', params),
   salegetprice: (data, params) => http(api + 'salegetprice', data, 'post', params),
-  addrall: (data, params) => http(api + 'addrall', data, 'post', params),
-  
   // 列表
   list: (data, params) => http('/bbc/fill/list', data, 'post', params),
   // 转单
@@ -17,4 +13,6 @@ export default {
   detail: (data, params) => http('bbc/fill/info', data, 'post', params),
   // 是否合规
   compliance: (data, params) => http('bbc/fill/compliance', data, 'post', params),
+  // 创建报备单
+  create: (data, params) => http('bbc/fill/create', data, 'post', params),
 }

+ 4 - 10
src/views/sellOut/businessFiling/components/complianceForm.vue

@@ -12,7 +12,7 @@
 
       <ElCol :span="12">
         <ElFormItem label="平台商品编号" prop="platCode">
-          <ElInput v-model="formData.platCode" />
+          <ElInput v-model="formData.platCode" placeholder="平台商品编号" />
         </ElFormItem>
       </ElCol>
         
@@ -48,8 +48,7 @@ export default {
   computed: {
      rules(){
         const { status }  = this.formData;
-        
-        return {
+        return { 
           status:[{required:true, message:"请选择是否合规", trigger: "change"}],
           platCode:[{required:status === "1", message:"请输入平台订单号", trigger: "change"}],
           remark:[{required:status === "2", message: "请输入备注", trigger:"change" }]
@@ -62,16 +61,11 @@ export default {
       try{
         await this.$refs.formRef.validate();
         const { status :is_compliance, platCode: plat_code, remark: compliance_remark } = this.formData;
-        const model = {is_compliance, plat_code, compliance_remark,id: this.id };
+        const model = {is_compliance, plat_code, compliance_remark, id: this.id };
         const response = await asyncRequest.compliance(model)
         if(response.code === 0){
           this.$emit("refresh")
-
-          this.formData = {
-            status: "1",
-            platCode: "",
-            remark:""
-          }
+          this.formData = { status: "1", platCode: "", remark:"" }
         }else{
           this.$message.warning(response.message)
         }

+ 30 - 119
src/views/sellOut/businessFiling/components/createBusinessForm.vue

@@ -259,6 +259,7 @@
               <search-good-online-modal
                 :once="true"
                 :sitem="addshowModel"
+                is_combind="0"
                 :active="true"
                 :show-model="showModel"
                 @resultList="resultList"
@@ -334,7 +335,7 @@ export default {
   },
   data() {
     return {
-        isCombindChild: true,
+      isCombindChild: true,
       ShowDataTableColumns: addColumns,
       AddrAddEditModalIndex: -1,
       AddrAddEditModalSitem: {},
@@ -445,7 +446,6 @@ export default {
   },
   methods: {
     manageridChange(e) {
-      console.log(e);
       const { id, label } = e;
       this.ruleForm.managerid = id ? [id] : [];
       this.ruleForm.manager = label || "";
@@ -473,6 +473,7 @@ export default {
 
           this.ruleForm = {
             managerid: [],
+            manager:"",
             order_type: "1",
             companyNo: this.currentCompany || "", //销售方编码
             customer_code: [], // 企业客户选择
@@ -525,7 +526,6 @@ export default {
         item.code = item.areaCode ? [item.areaCode] : [];
         item.names = item.label ? [item.label] : [];
       });
-      console.log(list);
       this.addrForm.order_addr.push(...list);
     },
     async resultList(e) {
@@ -533,7 +533,6 @@ export default {
       if (e.length === 1) {
         let ssitem = JSON.parse(JSON.stringify(e[0]));
         const result = await this.get_goods_detail(ssitem.skuCode);
-        console.log(result,"----")
         this.ruleForm.good_code = this.goods_sitem.skuCode;
       } else {
         this.goods_sitem = {};
@@ -547,7 +546,6 @@ export default {
       });
       if (code === 0) {
           const { is_combind_child } = data;
-          console.log((is_combind_child === false ? '是' : '不是') + "子商品")
           this.isCombindChild = is_combind_child === false;
         this.goods_sitem = data;
         this.goods_sitem.good_info_img = this.goods_sitem.good_info_img.split(
@@ -614,8 +612,10 @@ export default {
 
       if (!this.priceLoding) {
         const { isok, price, stock } = await this.set_salegetprice();
+
+        console.log("商品:" , price, stock)
         this.ruleForm.good_price = isok ? price : 0;
-        this.ruleForm.good_stock = isok ? stock : 0;
+        this.ruleForm.activity_stock = isok ? stock : 0;
       }
     },
     change_good_code() {
@@ -722,115 +722,31 @@ export default {
         }
       });
     },
-    // 删除收货地址操作
-    deleteRow(index, rows) {
-      rows.splice(index, 1);
-    },
-    async submitForm() {
-        if(this.ruleForm.good_code && this.isCombindChild){
-          this.$confirm("当前商品为其他组合商品的子商品,请留意",{
-              title:'提示',
-              type:'warning',
-              confirmButtonText:"我已知晓!",
-              cancelButtonText:"取消"
-          }).then(() => {
-              this.isCombindChild = false
-          })
-          return
-        }
-
 
+    async submitForm() {
       await this.$refs.ruleForm.validate(async valid => {
         if (valid) {
-          if (this.loading) {
-            return;
-          }
+          if (this.loading) { return; }
           this.loading = true;
-          const { sendtype, good_num, goodtype } = JSON.parse(
-            JSON.stringify(this.ruleForm)
-          );
-          const { order_addr } = JSON.parse(JSON.stringify(this.addrForm));
-
-          let key_0 = goodtype[0];
-          let key_1 = goodtype[1];
-          if (order_addr.length === 0 && sendtype === "1") {
-            this.$message.warning("至少填写一条地址信息!");
-            this.loading = false;
-            return;
-          }
-          let model = JSON.parse(JSON.stringify(this.ruleForm));
-          model.addrlist = [];
-          model.customer_code = model.customer_code.toString();
-          const { good_price, new_good_price } = model;
-          let a = accMul(good_price, "1"),
-            b = accMul(new_good_price, "1");
-          if (a !== b) {
-            model.good_price = model.new_good_price;
-          }
-          // if (model.new_good_price == model.good_price) {
-          // model.good_price = model.new_good_price;
-          // }
-          delete model["proof_type"];
-          delete model["proof_url"];
-          delete model["new_good_price"];
-          if (sendtype === "1") {
-            let addrT = 0,
-              isAEdit = false;
-
-            order_addr.forEach(v2 => {
-              if (v2.edit) {
-                isAEdit = true;
-              }
-              addrT += parseInt(v2.receipt_quantity);
-              let model2 = {
-                contactor: v2.contactor,
-                mobile: v2.mobile,
-                addr: v2.addr,
-                receipt_quantity: v2.receipt_quantity,
-                addr_code: v2.addr_code
-              };
-              model.addrlist.push(model2);
-            });
 
-            if (isAEdit) {
-              this.$message.warning("请保存地址信息!");
-              this.loading = false;
-              return;
-            }
-            if (good_num * 1 !== addrT) {
-              this.$message.warning("地址收货总数与销售总数量不一致!");
-              this.loading = false;
-              return;
-            }
+          const { companyNo, customer_code, platform_id, good_num,good_price, good_code: skuCode, managerid, manager ,remark: fill_remark } = this.ruleForm;
+          const model = { 
+            customerCode: Array.isArray(customer_code) ? customer_code[0] : customer_code, 
+            managerid: Array.isArray(managerid) ? managerid[0] : managerid,  
+            fill_remark, 
+            platform_id,
+            good_price, 
+            companyNo,
+            good_num, 
+            skuCode, 
+            manager 
           }
-          let priceres = await this.set_salegetprice();
-          if (!priceres.isok) {
-            this.loading = false;
-            return;
-          }
-          model.is_activity = key_0 === "is_activity_0" ? "0" : "1";
-          model.goodtype = key_0 === "is_activity_1" ? "1" : key_1;
-          model.act_code = key_0 === "is_activity_1" ? key_1 : "";
-
-          Object.keys(model).forEach(key => {
-            if (typeof model[key] === "string") {
-              model[key] = replaceTextWrapAndSpace(model[key]);
-            }
-          });
-
-          let res = await asyncRequest.add({
-            ...model,
-            managerid: Array.isArray(model.managerid) ? model.managerid[0] : model.managerid
-          });
 
+          let res = await asyncRequest.create(model);
           this.loading = false;
           if (res && res.code === 0) {
-            this.$notify.success({
-              title: "订单创建成功!",
-              message: ""
-            });
-
-            this.$emit("refresh");
+            this.$notify.success({ title: "订单创建成功!", message: "" });
+            this.$router.push("/sellOut/businessFiling")
           } else if (res && res.code >= 100 && res.code <= 104) {
             await this.logout();
           } else {
@@ -850,26 +766,21 @@ export default {
       const { good_num, good_code, goodtype } = this.ruleForm;
       let key_1 = goodtype[1];
       let key_0 = goodtype[0];
-      let model = {
-        skuCode: good_code,
-        sale_num: good_num,
-        is_activity: key_0 === "is_activity_0" ? "0" : "1",
+
+      let model = { 
+        skuCode: good_code, 
+        sale_num: good_num,  
+        is_activity: key_0 === "is_activity_0" ? "0" : "1", 
         act_code: key_0 === "is_activity_1" ? key_1 : ""
       };
+
       let { code, message, data } = await asyncRequest.salegetprice(model);
-      console.log(code, message, data);
+
       if (code === 0) {
         const { sale_price } = data;
         resModel.price = sale_price + "";
+        resModel.stock = data.stock;
 
-        let oldGood_type = goodtype.length === 2 ? goodtype[1] : "";
-
-        if (
-          key_0 === "is_activity_0" &&
-          (oldGood_type == 2 || oldGood_type == 3)
-        ) {
-          resModel.price = 0 + "";
-        }
       } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {

+ 9 - 25
src/views/sellOut/businessFiling/components/waitTransferred.vue

@@ -246,47 +246,31 @@ export default {
 
         const { addr_code } = this.editCacheData;
         const { data, code } = await asyncRequest.addrall({ code: addr_code[addr_code.length - 1] });
-
         if (Number(code) === 0) {
           this.editCacheData.addr_code_name = data.province.name + "/" + data.city.name + "/" + data.area.name;
         }
-
         this.$set(this.list, this.editIndex, this.editCacheData);
         this.editCacheData = { ...defaultAddressData };
         this.editIndex = -1;
       });
     },
 
+
     customerChange(evt) {
       const { code, label } = evt;
-
-      this.ruleForm = {
-        companyCode: code ? [code] : "",
-        companyName: label ? [label] : ""
-      };
+      this.ruleForm = { companyCode: code ? [code] : "", companyName: label ? [label] : "" };
     },
 
     handleRefresh(data) {
       const _data = data.list.map(
-        ({
-          addr,
-          addr_code,
-          contactor,
-          mobile,
-          receipt_quantity,
-          addr_code_name
-        }) => ({
-          addr,
-          addr_code,
-          contactor,
-          mobile,
-          receipt_quantity,
-          addr_code_name,
-          area_code: [addr_code[addr_code.length - 1]]
-        })
+        ({ addr, addr_code, contactor, mobile, receipt_quantity,  addr_code_name }) => 
+        ({ addr, addr_code, contactor, mobile, receipt_quantity,  addr_code_name, area_code: [addr_code[addr_code.length - 1]] })
       );
 
-      this.list = [...this.list, ..._data];
+      this.list = [
+        ...this.list, ..._data
+      ];
+
       this.showModal = false;
     },
 
@@ -337,7 +321,7 @@ export default {
 
       const currentNum = this.list.reduce((current, prev) => Number(current) + Number(prev.receipt_quantity), 0);
       if (currentNum > Number(this.waitNum)) {
-        this.$message.warning( `未转单数量为${this.waitNum},收货数量总和不能超过未转单数量!`);
+        this.$message.warning( `未转单数量为${this.waitNum},收货数量总和为${currentNum},收货数量总和不能超过未转单数量!`);
         return;
       }
 

+ 16 - 25
src/views/sellOut/businessFiling/config/columns.js

@@ -20,12 +20,18 @@ const columns = [
     _slot_: "is_compliance"
   },
   {
-    label: "销售数量",
-    prop: "todo"
+    prop: 'status',
+    label: '状态',
+    width: '125px',
+    _slot_: 'status'
+  },
+  {
+    prop: "transfer_num",
+    label: "销售数量"
   },
   {
     label: '商品主图',
-    prop: "todo"
+    _slot_: "good_img"
   },
   {
     prop: "origin_price",
@@ -35,10 +41,6 @@ const columns = [
     prop: "good_price",
     label: '销售价'
   },
-  // {
-  //   prop: 'todo',
-  //   label: '总服务费',
-  // },
   {
     label: '业务公司',
     _slot_: "company",
@@ -54,19 +56,13 @@ const columns = [
     _slot_: "customer",
     width: "180px"
   },
-  {
-    prop: 'status',
-    label: '状态',
-    width: '125px',
-    _slot_: 'status'
-  },
   {
     prop: 'plat_code',
     label: '平台商品编号',
     'min-width': '145px'
   },
   {
-    prop: 'todo',
+    prop: 'platform_name',
     label: '所属平台',
     width: '110px'
   },
@@ -80,7 +76,7 @@ const columns = [
     label: '操作',
     fixed: 'right',
     _noset_: true,
-    width: '110px',
+    width:  '110px',
     _slot_: 'operation'
   }
 ]
@@ -110,9 +106,10 @@ export const editColumns = [
     span: 6
   },
   {
-    prop: 'status_cn',
+    prop: 'status',
     label: '状态',
-    span: 6
+    span: 6,
+    _slot_:'status'
   },
   {
     prop: 'apply_name',
@@ -173,7 +170,7 @@ export const editColumns = [
     span: 6
   },
   {
-    prop: 'platform_id',
+    prop: 'platform_name',
     label: '所属平台',
     span: 6
   },
@@ -183,17 +180,11 @@ export const editColumns = [
     _slot_: 'is_compliance',
     span: 6
   },
-  {
-    prop: '',
-    _slot_: 'annex',
-    label: '附件',
-    span: 6
-  },
   {
     prop: 'fill_type',
     label: '报备单类型',
     _slot_: "fill_type",
-    span: 6
+    span: 12
   },
   {
     prop: 'fill_remark',

+ 35 - 7
src/views/sellOut/businessFiling/detail.vue

@@ -14,6 +14,12 @@
                 :sitem="sitem"
                 :columns="editColumns"
               >
+
+                <template #status="{ scope }">
+                  <el-tag size="mini">
+                    {{ (statusOptions.find(({value}) => value === String(sitem.status)) || {}).label || '--' }}
+                  </el-tag>
+                </template>
                 <template #is_compliance="{ scope }">
                  <el-tag size="mini">
                   {{sitem.is_compliance === "0" ? "未填写" : sitem.is_compliance === "1" ? "合规" : "不合规"}}
@@ -57,7 +63,9 @@
                 </template>
 
                 <template slot="fill_type">
-                 {{(fillTypeOptions.find( ({value}) => value === String(sitem.fill_type)) || {}).label || "--"}}
+                  <el-tag size="mini">
+                    {{(fillTypeOptions.find( ({value}) => value === String(sitem.fill_type)) || {}).label || "--"}}
+                  </el-tag>
                 </template>
               </show-data-table>
             </ElCollapseItem>
@@ -65,24 +73,37 @@
             <ElCollapseItem title="商品详情" name="1">
               <show-goods-data-table
                 :newTime="newTime"
-                v-if="newTime !== ''"
+                v-if="newTime !== '' && sitem"
                 :type="sitem.fill_type"
-                :skuCode="sitem.skuCode"
+                :skucode="sitem.skuCode"
                 :spucode="sitem.spuCode"
-                :iscgd="false"
+                :iscgd="String(sitem.fill_type) === '3'"
                 :border="true"
               />
             </ElCollapseItem>
             
-            <ElCollapseItem title="是否合规设置" name="2" v-if="String(sitem.is_compliance) === '0'">
+            <ElCollapseItem title="是否合规设置" name="2" v-if="String(sitem.is_compliance) === '0' && powers.includes('095')">
               <ComplianceForm :id="id" @refresh="initialData" />
             </ElCollapseItem>
 
-            <ElCollapseItem title="待转单" name="3" v-if="String(sitem.status) === '1' || String(sitem.status) === '2'">
+            <ElCollapseItem title="待转单" name="3" v-if="(String(sitem.status) === '1' || String(sitem.status) === '2') && (ppowers.includes('1') || ppowers.includes('2'))">
               <WaitTransferred :id="id" :waitNum="sitem.wait_num" @refresh="initialData" />
             </ElCollapseItem>
           </ElCollapse>
         </ElTabPane>
+
+        <ElTabPane label="审批记录">
+          <process-time-line
+            v-if="newTime !== ''"
+            :newTime="newTime"
+            :type="'YWBBD'"
+            :orderCode="id"
+          />
+        </ElTabPane>
+
+        <ElTabPane label="流程图">
+          <flow-chart process_id="32" type="YWBBD" :orderCode="id" />
+        </ElTabPane>
       </template>
     </ElTabs>
   </div>
@@ -93,7 +114,7 @@ import CreateBusinessForm from './components/createBusinessForm'
 import WaitTransferred from "./components/waitTransferred.vue"
 import ComplianceForm from "./components/complianceForm.vue"
 import asyncRequest from "@/apis/service/sellOut/businessFiling"
-import { editColumns, coveColumns } from "./config/columns"
+import { editColumns, coveColumns,statusOptions } from "./config/columns"
 
 export default {
   components: {
@@ -108,6 +129,7 @@ export default {
       sitem: {},
       editColumns,
       coveColumns,
+      statusOptions,
       fillTypeOptions: [
         { value: "1", label: "库存" },
         { value: "2", label: "非库存" },
@@ -130,6 +152,12 @@ export default {
       const tran = btnList.find(item => item.menu_route == "businessFilingDetail") || {};
       const { action } = tran ?? {};
       return action ?? [];
+    },
+    ppowers() {
+      const tran =
+        this.$store.getters.roleProcess.find((i) => i.process_type === "YWBBD") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
     }
   },
   methods:{

+ 14 - 7
src/views/sellOut/businessFiling/index.vue

@@ -77,15 +77,11 @@
           <el-row>
             <el-col :span="3" class="fr" style="width: 66px; margin-top: 10px">
               <el-button
-                v-if="powers.includes('003')"
-                :size="searchSize"
-                type="success"
-                style="float: right"
-                @click="
-                  routeGoto('/sellOut/businessFilingDetail', { id: 'add', type: 'add' })
-                "
+                v-if="powers.includes('003')"  :size="searchSize" type="success" style="float: right"
+                @click="routeGoto('/sellOut/businessFilingDetail', { id: 'add', type: 'add' })"
               >添加</el-button>
             </el-col>
+
             <el-col :span="4" style="margin-top: 15px">
               <search-customer
                 size="mini"
@@ -127,6 +123,16 @@
           {{scope.row.is_compliance === "0" ? "未填写" : scope.row.is_compliance === "1" ? "合规" : "不合规"}}
         </el-tag>
       </template>
+
+      <template #good_img="{ scope }">
+        <img
+          v-viewer
+          style="width: 23px; height: 23px; margin: 0 5px 0 0"
+          class="fl"
+          :src="scope.row.good_img"
+          alt
+        />
+      </template>
       <template #cat_info="{ scope }">
         {{ scope.row.cat.search }}
       </template>
@@ -191,6 +197,7 @@ import urlConfig from "@/apis/url-config";
 import resToken from "@/mixins/resToken";
 import { mapGetters } from "vuex";
 
+
 export default {
   name: "purchaseOrder",
   mixins: [mixinPage, resToken, companyHelper],

+ 1 - 0
src/views/sellOut/zixunOrder/components/editForm.vue

@@ -689,6 +689,7 @@ export default {
       options: [
         { value: "0", label: "非项目" },
         { value: "1", label: "项目" },
+        { value: "2", label: "业务报备" }
       ],
       statusOptions: [
         { value: "1", label: "竞品" },