Browse Source

代码暂存

zhangqi 11 months ago
parent
commit
dd5a48487f

+ 7 - 3
src/DRP/HDrpManagement/customerGoals/detail/index.vue

@@ -4,11 +4,15 @@
     :delParam="{id:'20221118103402',content:{sa_salestargetbillids:[router.currentRoute.value.query.id]}}" >
       <template #operation>
         <edit :data="mainData" @onSuccess="mianData"></edit>
-        <tableImport :bindData="{ownerid:router.currentRoute.value.query.id,ownertable:'sa_salestargetbill',usetype:'default'}" :failedData="failedData" :modeParam="{id:20231020111203,content:{}}" @uploadSuccess="importSuccess">
-        </tableImport>
+        
       </template>
       <template #tab0>
-        <target ref="targetdata" :data="mainData"></target>
+        <target ref="targetdata" :data="mainData">
+          <template #tableImport>
+            <tableImport type="icon" :bindData="{ownerid:router.currentRoute.value.query.id,ownertable:'sa_salestargetbill',usetype:'default'}" :failedData="failedData" :modeParam="{id:20231020111203,content:{}}" @uploadSuccess="importSuccess">
+            </tableImport>
+          </template>
+        </target>
       </template>
       <template #tab1>
         <targetStatistics :data="mainData"></targetStatistics>

+ 77 - 0
src/DRP/HDrpManagement/customerGoals/detail/tabs/target copy.vue

@@ -0,0 +1,77 @@
+<template>
+  <div>
+    <a-table 
+    class="ant-table-small"
+    size="small"
+    :columns="columns" 
+    :data-source="data"
+    :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)"
+    bordered>
+      <template #bodyCell="{ column,record }">
+        <span style="font-weight: 300;">{{ record[column.dataIndex] }}</span>
+        <template v-if="column.dataIndex == 'operation'">
+          <set-target v-if="record.type !== '区域汇总'" :data="record" @onSuccess="targetData"></set-target>
+        </template>
+      </template>
+    </a-table>
+  </div>
+</template>
+
+<script setup>
+import { ref,onMounted,defineExpose,defineProps } from 'vue';
+import Api from '@/api/api'
+import utils from '@/utils/utils'
+import setTarget from '../modules/setTarget.vue'
+import { useRouter } from "vue-router";
+const router = useRouter()
+
+const props = defineProps(['data'])
+
+const columns = ref([
+  { title: '企业名称', dataIndex: 'enterprisename'},
+  { title: '年度', dataIndex: 'y1l'},
+  { title: '一季度', dataIndex: 's1l'},
+  { title: '一月', dataIndex: 'm1l'},
+  { title: '二月', dataIndex: 'm2l'},
+  { title: '三月', dataIndex: 'm3l'},
+  { title: '二季度', dataIndex: 's2l'},
+  { title: '四月', dataIndex: 'm4l'},
+  { title: '五月', dataIndex: 'm5l'},
+  { title: '六月', dataIndex: 'm6l'},
+  { title: '三季度', dataIndex: 's3l'},
+  { title: '七月', dataIndex: 'm7l'},
+  { title: '八月', dataIndex: 'm8l'},
+  { title: '九月', dataIndex: 'm9l'},
+  { title: '四季度', dataIndex: 's4l'},
+  { title: '十月', dataIndex: 'm10l'},
+  { title: '十一月', dataIndex: 'm11l'},
+  { title: '十二月', dataIndex: 'm12l'},
+  { title: '操作', dataIndex: 'operation'},
+]);
+const data = ref([])
+const targetData = async (year) => {
+  const res = await Api.requested({
+    "id": "20231018142103",
+    "content": {
+       "sa_salestargetbillid":router.currentRoute.value.query.id,
+       "where":{
+        year:year
+       }
+    }
+  })
+  data.value = res.data
+}
+onMounted(()=>{
+  // targetData()
+})
+defineExpose({
+  targetData
+})
+</script>
+
+<style scoped>
+.ant-table-small :deep(.table-striped) td {
+  background-color: #f8f9fd;
+  
+}
+</style>

+ 25 - 48
src/DRP/HDrpManagement/customerGoals/detail/tabs/target.vue

@@ -1,68 +1,45 @@
 <template>
   <div>
-    <a-table 
-    class="ant-table-small"
-    size="small"
-    :columns="columns" 
-    :data-source="data"
-    :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)"
-    bordered>
-      <template #bodyCell="{ column,record }">
-        <span style="font-weight: 300;">{{ record[column.dataIndex] }}</span>
-        <template v-if="column.dataIndex == 'operation'">
-          <set-target v-if="record.type !== '区域汇总'" :data="record" @onSuccess="targetData"></set-target>
-        </template>
+    <normalTable 
+      ref="prodlist"
+      :columns="utils.TBLayout('targetDetail')"
+      tableName="targetDetail"
+      :noQuery="true"
+      rowKey="sa_orderitemsid"
+      :param="param"
+      size="small"
+      :hideBorder="true">
+      <template #more>
+        <slot name="tableImport"></slot>
       </template>
-    </a-table>
+    </normalTable>
   </div>
 </template>
 
 <script setup>
 import { ref,onMounted,defineExpose,defineProps } from 'vue';
-import Api from '@/api/api'
 import utils from '@/utils/utils'
+import normalTable from '@/template/normalTable/index.vue'
 import setTarget from '../modules/setTarget.vue'
 import { useRouter } from "vue-router";
 const router = useRouter()
-
 const props = defineProps(['data'])
 
-const columns = ref([
-  { title: '企业名称', dataIndex: 'enterprisename'},
-  { title: '年度', dataIndex: 'y1l'},
-  { title: '一季度', dataIndex: 's1l'},
-  { title: '一月', dataIndex: 'm1l'},
-  { title: '二月', dataIndex: 'm2l'},
-  { title: '三月', dataIndex: 'm3l'},
-  { title: '二季度', dataIndex: 's2l'},
-  { title: '四月', dataIndex: 'm4l'},
-  { title: '五月', dataIndex: 'm5l'},
-  { title: '六月', dataIndex: 'm6l'},
-  { title: '三季度', dataIndex: 's3l'},
-  { title: '七月', dataIndex: 'm7l'},
-  { title: '八月', dataIndex: 'm8l'},
-  { title: '九月', dataIndex: 'm9l'},
-  { title: '四季度', dataIndex: 's4l'},
-  { title: '十月', dataIndex: 'm10l'},
-  { title: '十一月', dataIndex: 'm11l'},
-  { title: '十二月', dataIndex: 'm12l'},
-  { title: '操作', dataIndex: 'operation'},
-]);
-const data = ref([])
-const targetData = async (year) => {
-  const res = await Api.requested({
-    "id": "20231018142103",
-    "content": {
-       "sa_salestargetbillid":router.currentRoute.value.query.id,
-       "where":{
-        year:year
-       }
+const prodlist = ref(null)
+const param = ref({
+  "id": "20231018142103",
+  "content": {
+    "sa_salestargetbillid":router.currentRoute.value.query.id,
+    "where":{
+      year:''
     }
-  })
-  data.value = res.data
+  }
+})
+const targetData = async (year) => {
+  param.value.content.where.year = year
+  prodlist.value.listData()
 }
 onMounted(()=>{
-  // targetData()
 })
 defineExpose({
   targetData

+ 6 - 3
src/DRP/HDrpManagement/performanceGoals/detail/index.vue

@@ -5,11 +5,14 @@
       <template #operation>
         <edit :data="mainData" @onSuccess="mianData"></edit>
 
-        <tableImport :bindData="{ownerid:router.currentRoute.value.query.id,ownertable:'sa_salestargetbill',usetype:'default'}" :failedData="failedData" :modeParam="{id:20220913093102,content:{}}" @uploadSuccess="importSuccess">
-        </tableImport>
+        
       </template>
       <template #tab0>
-        <target ref="targetdata" :data="mainData"></target>
+        <target ref="targetdata" :data="mainData">
+          <template #tableImport>
+            <tableImport type="icon" :bindData="{ownerid:router.currentRoute.value.query.id,ownertable:'sa_salestargetbill',usetype:'default'}" :failedData="failedData" :modeParam="{id:20220913093102,content:{}}" @uploadSuccess="importSuccess"></tableImport>
+          </template>
+        </target>
       </template>
       <template #tab1>
         <targetStatistics :data="mainData"></targetStatistics>

+ 76 - 0
src/DRP/HDrpManagement/performanceGoals/detail/tabs/target copy.vue

@@ -0,0 +1,76 @@
+<template>
+  <div>
+    <a-table 
+    class="ant-table-small"
+    size="small"
+    :columns="columns" 
+    :data-source="data"
+    :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)"
+    bordered>
+      <template #bodyCell="{ column,record }">
+        <span style="font-weight: 300;">{{ record[column.dataIndex] }}</span>
+        <template v-if="column.dataIndex == 'operation'">
+          <set-target v-if="record.type !== '区域汇总'" :data="record" @onSuccess="targetData"></set-target>
+        </template>
+      </template>
+    </a-table>
+  </div>
+</template>
+
+<script setup>
+import { ref,onMounted,defineExpose,defineProps } from 'vue';
+import Api from '@/api/api'
+import setTarget from '../modules/setTarget.vue'
+import { useRouter } from "vue-router";
+const router = useRouter()
+const props = defineProps(['data'])
+
+const columns = ref([
+  { title: '营销区域', dataIndex: 'areaname'},
+  { title: '年度', dataIndex: 'y1l'},
+  { title: '一季度', dataIndex: 's1l'},
+  { title: '一月', dataIndex: 'm1l'},
+  { title: '二月', dataIndex: 'm2l'},
+  { title: '三月', dataIndex: 'm3l'},
+  { title: '二季度', dataIndex: 's2l'},
+  { title: '四月', dataIndex: 'm4l'},
+  { title: '五月', dataIndex: 'm5l'},
+  { title: '六月', dataIndex: 'm6l'},
+  { title: '三季度', dataIndex: 's3l'},
+  { title: '七月', dataIndex: 'm7l'},
+  { title: '八月', dataIndex: 'm8l'},
+  { title: '九月', dataIndex: 'm9l'},
+  { title: '四季度', dataIndex: 's4l'},
+  { title: '十月', dataIndex: 'm10l'},
+  { title: '十一月', dataIndex: 'm11l'},
+  { title: '十二月', dataIndex: 'm12l'},
+  { title: '操作', dataIndex: 'operation'},
+]);
+const data = ref([])
+const targetData = async (year) => {
+  console.log(props.data.year)
+  const res = await Api.requested({
+    "id": "20220901141802",
+    "content": {
+       "sa_salestargetbillid":router.currentRoute.value.query.id,
+       "where":{
+          year:year
+       }
+    }
+  })
+  data.value = res.data
+}
+onMounted(()=>{
+  // targetData()
+})
+defineExpose({
+  targetData
+})
+</script>
+
+<style scoped>
+.ant-table-small :deep(.table-striped) td {
+  background-color: #f8f9fd;
+  
+}
+</style>

+ 25 - 48
src/DRP/HDrpManagement/performanceGoals/detail/tabs/target.vue

@@ -1,68 +1,45 @@
 <template>
   <div>
-    <a-table 
-    class="ant-table-small"
-    size="small"
-    :columns="columns" 
-    :data-source="data"
-    :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)"
-    bordered>
-      <template #bodyCell="{ column,record }">
-        <span style="font-weight: 300;">{{ record[column.dataIndex] }}</span>
-        <template v-if="column.dataIndex == 'operation'">
-          <set-target v-if="record.type !== '区域汇总'" :data="record" @onSuccess="targetData"></set-target>
-        </template>
+    <normalTable 
+      ref="prodlist"
+      :columns="utils.TBLayout('targetDetail')"
+      tableName="targetDetail"
+      :noQuery="true"
+      rowKey="sa_orderitemsid"
+      :param="param"
+      size="small"
+      :hideBorder="true">
+      <template #more>
+        <slot name="tableImport"></slot>
       </template>
-    </a-table>
+    </normalTable>
   </div>
 </template>
 
 <script setup>
 import { ref,onMounted,defineExpose,defineProps } from 'vue';
-import Api from '@/api/api'
 import utils from '@/utils/utils'
+import normalTable from '@/template/normalTable/index.vue'
 import setTarget from '../modules/setTarget.vue'
 import { useRouter } from "vue-router";
 const router = useRouter()
 const props = defineProps(['data'])
 
-const columns = ref([
-  { title: '营销区域', dataIndex: 'areaname'},
-  { title: '年度', dataIndex: 'y1l'},
-  { title: '一季度', dataIndex: 's1l'},
-  { title: '一月', dataIndex: 'm1l'},
-  { title: '二月', dataIndex: 'm2l'},
-  { title: '三月', dataIndex: 'm3l'},
-  { title: '二季度', dataIndex: 's2l'},
-  { title: '四月', dataIndex: 'm4l'},
-  { title: '五月', dataIndex: 'm5l'},
-  { title: '六月', dataIndex: 'm6l'},
-  { title: '三季度', dataIndex: 's3l'},
-  { title: '七月', dataIndex: 'm7l'},
-  { title: '八月', dataIndex: 'm8l'},
-  { title: '九月', dataIndex: 'm9l'},
-  { title: '四季度', dataIndex: 's4l'},
-  { title: '十月', dataIndex: 'm10l'},
-  { title: '十一月', dataIndex: 'm11l'},
-  { title: '十二月', dataIndex: 'm12l'},
-  { title: '操作', dataIndex: 'operation'},
-]);
-const data = ref([])
-const targetData = async (year) => {
-  console.log(props.data.year)
-  const res = await Api.requested({
-    "id": "20220901141802",
-    "content": {
-       "sa_salestargetbillid":router.currentRoute.value.query.id,
-       "where":{
-          year:year
-       }
+const prodlist = ref(null)
+const param = ref({
+  "id": "20220901141802",
+  "content": {
+    "sa_salestargetbillid":router.currentRoute.value.query.id,
+    "where":{
+      year:''
     }
-  })
-  data.value = res.data
+  }
+})
+const targetData = async (year) => {
+  param.value.content.where.year = year
+  prodlist.value.listData()
 }
 onMounted(()=>{
-  // targetData()
 })
 defineExpose({
   targetData

+ 7 - 1
src/DRP/HDrpManagement/productManage/detail/index.vue

@@ -3,8 +3,10 @@
     <detail-template :headData="mainAreaData" :title="productData.itemname" :tabs="['基础信息','营销分类','商品主图','等级价格']" ownertable="plm_item" :delParam="{id:'20220923152202',content:{itemids:[router.currentRoute.value.query.id]}}" :disable="utils.isDisabled(productData.status,['审核','上架'])">
       <template #titleRight>
         <a-space style="margin-left:10px" :size="5" v-if="utils.isDisabled(productData.status,['审核','新建'])">
+          
           <a-tag v-if="productData.delistingstatus" color="blue">{{productData.delistingstatus}}</a-tag>
-          <a-select v-model:value="productData.delistingstatus" style="width: 120px">
+          <TagFilled v-if="!showSelect"  @click="showSelect = true"/>
+          <a-select v-else v-model:value="productData.delistingstatus" style="width: 120px">
             <a-select-option v-for="item in delistingOptions" :key="item.index" :value="item.value" @click="changeDelisting(item.value)">{{item.remarks}}</a-select-option>
           </a-select>
         </a-space>
@@ -52,6 +54,8 @@ import info from './tabs/info.vue'
 import saleClass from './tabs/class.vue'
 import gradePrice from './tabs/gradePrice.vue'
 import { useRouter } from "vue-router";
+import { TagFilled } from '@ant-design/icons-vue';
+
 import { onActivated, onMounted,ref ,computed, provide} from "vue";
 import { message } from 'ant-design-vue';
 import { storeToRefs } from 'pinia'
@@ -67,6 +71,7 @@ const checkSite = computed(()=>{
     return edit
   }
 })
+const showSelect = ref(false)
 const infoRf  = ref()
 const mainAreaData = ref([])
 const productData = ref({})
@@ -131,6 +136,7 @@ const changeDelisting = async (value)=>{
   })
   utils.message(res,'修改成功',()=>{
     mianData()
+    showSelect.value = false
   })
 }
 onMounted (()=>{

+ 8 - 6
src/DRP/SDrpManagement/order/detail/index.vue

@@ -575,7 +575,7 @@ const mianData = async () => {
     },
   };
   changeDataStructure(res.data);
-  isPromotion ? getPackagetype() : "";
+  isPromotion.value ? getPackagetype() : "";
 };
 const changeDataStructure = (data) => {
   mainAreaData.value = utils.FormLayout("detailsHead", data);
@@ -669,7 +669,7 @@ const showQtyModal = (val)=>{
 }
 const hideModal = ()=>{
   qtyModal.value = false
-  promotionQty.value = null
+  // promotionQty.value = null
   selectProd.value.visible = false
 }
 const promotionToBillBody = ()=>{
@@ -689,12 +689,11 @@ const addProductToBody = async (val) => {
     },
   };
   base.addRepeatProd(param,()=>{
-    if (isPromotion) {
+    if (isPromotion.value) {
       message.error('该套餐已存在,请勿重复添加!')
       return false
     }
   }).then((res) => {
-    console.log(res)
     const allowAdd = (e) => {
       if (e.iscustomsize == 1) {
         if (!e.length || !e.width) {
@@ -709,7 +708,7 @@ const addProductToBody = async (val) => {
           return {
             sa_orderitemsid: 0,
             itemid: e.itemid,
-            qty:isPromotion ?e.qty * promotionQty.value : e.qty,
+            qty:isPromotion.value ? e.orderminqty * promotionQty.value : e.qty,
             length: e.length ? e.length : 0,
             width: e.width ? e.width : 0,
             customcolors: e.customcolors ? e.customcolors : 0,
@@ -723,19 +722,22 @@ const addProductToBody = async (val) => {
           sa_orderitemsid: 0,
           itemid: e.itemid,
           sa_promotion_itemsid: e.sa_promotion_itemsid ?  e.sa_promotion_itemsid : 0 ,
-          qty: isPromotion ? e.qty * promotionQty.value : e.qty,
+          qty: isPromotion.value ? e.orderminqty * promotionQty.value : e.qty,
           length: 0,
           width: 0,
         };
       }
     };
+
     let data = val.map((e) => {
       return allowAdd(e);
     });
+    console.log(data,promotionQty.value)
     data.some((e) => e == undefined)
       ? ""
       : updateProd(data, "添加成功", () => {
           prodlist.value.tableRecord = [];
+          promotionQty.value = null
         });
   });
 };

+ 1 - 1
src/template/selectProduct/index.vue

@@ -169,7 +169,7 @@
     }
 
     // 开启列表数据静态过滤
-    props.needQuestSearch ? fn() :''
+    fn?.props.needQuestSearch?.fn()
   }
   const onSelect = async (record, selected, selectedRows, nativeEvent)=>{
     if (!selected) {