Browse Source

月销售表

cz 1 year ago
parent
commit
6b572be681

+ 5 - 1
src/components/byTable/index.vue

@@ -418,11 +418,15 @@ export default defineComponent({
     };
     const searchFn = (val) => {
       if (props.loading) return;
+      let str = "";
+      if (props.pagination.keyword) {
+        str = props.pagination.keywordt.rim();
+      }
       proxy.$emit(
         "getList",
         Object.assign(props.filterParams, {
           ...props.pagination,
-          [props.searchKey]: props.pagination.keyword.trim(),
+          [props.searchKey]: str,
         })
       );
     };

+ 63 - 34
src/views/EHSD/saleContract/dailyReport/index.vue

@@ -26,36 +26,30 @@
       </el-form>
     </div>
     <div style="background:#fff;padding:15px;margin-top:10px">
-      <el-table :data="sourceList.data" :height="tableHeight" style="width: 100%" v-loading="loading">
-        <el-table-column prop="name" label="组别" min-width="110" fixed="left">
-          <template #default="{ row, $index }">
-            <div>
-              随机啊啊啊啊
-            </div>
-          </template>
-        </el-table-column>
-        <el-table-column prop="name" label="业务员" width="80" fixed="left" />
+      <el-table :data="sourceList.data" :height="tableHeight" style="width: 100%" v-loading="loading" border>
+        <el-table-column prop="groupName" label="组别" min-width="110" fixed="left" />
+        <el-table-column prop="saleUserName" label="业务员" width="80" fixed="left" />
 
         <template v-if="dayList && dayList.length>0">
           <el-table-column v-for="col in dayList" :key="col" :label="col" align="center" :class-name="today==col?'isToday':''">
             <el-table-column prop="address" label="系统" width="100" align="right" :class-name="today==col?'isToday':''">
               <template #default="{ row, $index }">
-                <div style="width: 100%" :class="today==col?'isToday':''">
-                  <!-- {{col}} -->999,999.00
+                <div style="width: 100%" :class="today==col?'isToday':''" v-if="row[col] && row[col].sumContractAmount">
+                  {{moneyFormat(row[col].sumContractAmount,2)}}
                 </div>
               </template>
             </el-table-column>
             <el-table-column prop="address" label="聚水潭" width="100" align="right" :class-name="today==col?'isToday':''">
               <template #default="{ row, $index }">
-                <div style="width: 100%" :class="today==col?'isToday':''">
-                  {{col}}
+                <div style="width: 100%" :class="today==col?'isToday':''" v-if="row[col] && row[col].sumJstAmount">
+                  {{moneyFormat(row[col].sumJstAmount,2)}}
                 </div>
               </template>
             </el-table-column>
           </el-table-column>
         </template>
 
-        <el-table-column width="90" align="right" fixed="right">
+        <el-table-column width="95" align="right" fixed="right">
           <template #header>
             <div>
               系统
@@ -63,8 +57,13 @@
               月累计
             </div>
           </template>
+          <template #default="{ row, $index }">
+            <div style="width: 100%">
+              {{moneyFormat(row.sumContractAmount,2)}}
+            </div>
+          </template>
         </el-table-column>
-        <el-table-column width="90" align="right" fixed="right">
+        <el-table-column width="95" align="right" fixed="right">
           <template #header>
             <div>
               聚水潭
@@ -72,8 +71,13 @@
               月累计
             </div>
           </template>
+          <template #default="{ row, $index }">
+            <div style="width: 100%">
+              {{moneyFormat(row.sumJstAmount,2)}}
+            </div>
+          </template>
         </el-table-column>
-        <el-table-column width="90" align="right" fixed="right">
+        <el-table-column width="95" align="right" fixed="right">
           <template #header>
             <div>
               合计
@@ -81,10 +85,27 @@
               月累计
             </div>
           </template>
+          <template #default="{ row, $index }">
+            <div style="width: 100%">
+              {{moneyFormat(row.sumAmount,2)}}
+            </div>
+          </template>
         </el-table-column>
-        <el-table-column prop="address" label="月目标" width="90" align="right" fixed="right" />
-        <el-table-column prop="address" label="月达成率" width="90" align="right" fixed="right" />
-        <el-table-column prop="address" label="排名" width="60" align="right" fixed="right" />
+        <el-table-column label="月目标" width="90" align="right" fixed="right">
+          <template #default="{ row, $index }">
+            <div style="width: 100%">
+              {{moneyFormat(row.targetAmount,2)}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="月达成率" width="90" align="right" fixed="right">
+          <template #default="{ row, $index }">
+            <div style="width: 100%">
+              {{moneyFormat(row.finishRate,2)}} %
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="ranking" label="排名" width="60" align="center" fixed="right" />
       </el-table>
     </div>
 
@@ -116,7 +137,6 @@ const weekEnd = ref(moment().endOf("week").format("yyyy-MM-DD") + " 23:59:59");
 const sourceList = ref({
   data: [],
   pagination: {
-    total: 0,
     pageNum: 1,
     pageSize: 10,
     beginTime: "",
@@ -128,17 +148,19 @@ const loading = ref(false);
 const getList = (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/contract/page", sourceList.value.pagination).then((res) => {
-    sourceList.value.data = res.rows;
-    sourceList.value.pagination.total = res.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
+  proxy
+    .post("/deptPerf/monthlyReporting", sourceList.value.pagination)
+    .then((res) => {
+      sourceList.value.data = res;
+      setTimeout(() => {
+        loading.value = false;
+      }, 500);
+    });
 };
 
 const dayList = ref([]);
 const onQuery = () => {
+  loading.value = true;
   if (
     sourceList.value.pagination.beginTime &&
     sourceList.value.pagination.endTime
@@ -177,13 +199,17 @@ const onReset = () => {
 };
 onReset();
 
-const nowYearMonth = ref(moment().format("YYYY-MM-DD"));
-// const disabledFn=  (date)=>{
-//   let now =moment(date)
-//   if(moment(date) > moment(beginTime.value) || ){
-
-//   }
-// }
+// const nowYearMonth = ref(moment().format("YYYY-MM"));
+const disabledFn = (date) => {
+  if (
+    moment(date).isBefore(beginTime.value) ||
+    moment(date).isAfter(endTime.value)
+  ) {
+    return true;
+  } else {
+    return false;
+  }
+};
 
 const aa = () => {
   let eles = document.querySelectorAll(".isToday");
@@ -206,6 +232,9 @@ const aa = () => {
 :deep(.el-table .el-table__cell) {
   padding: 0 !important;
 }
+:deep(.el-table .cell) {
+  padding: 0 6px !important;
+}
 .query {
   background: #20b2aa;
   color: #fff;

+ 12 - 2
src/views/iot/base/equipment/index.vue

@@ -132,7 +132,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: "100",
+        width: "120",
         align: "center",
       },
       // 渲染 el-button,一般用在最后一列。
@@ -140,6 +140,17 @@ const config = computed(() => {
         return [
           {
             attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+          {
+            attrs: {
               label: "删除",
               type: "danger",
               text: true,
@@ -288,7 +299,6 @@ const getDtl = (row) => {
   modalType.value = "edit";
   proxy.post("/tdaDevice/detail", { id: row.id }).then((res) => {
     formData.data = res;
-    console.log(formData);
     dialogVisible.value = true;
   });
 };

+ 28 - 32
src/views/purchaseManage/purchasePayment/invoice/index.vue

@@ -73,7 +73,7 @@ const config = computed(() => {
       attrs: {
         label: "供应商",
         prop: "supplyName",
-        width: 200,
+        width: 250,
       },
     },
     {
@@ -208,7 +208,6 @@ getList();
 const modalType = ref("add");
 const dialogVisible = ref(false);
 const loadingDialog = ref(false);
-const fileList = ref([]);
 const uploadData = ref({});
 const submit = ref(null);
 const formOption = reactive({
@@ -273,9 +272,9 @@ const formData = reactive({
 });
 const openModal = (val) => {
   modalType.value = val;
-  fileList.value = [];
   formData.data = {
     invoiceDetailsList: [],
+    fileList: [],
   };
   loadingDialog.value = false;
   dialogVisible.value = true;
@@ -317,14 +316,6 @@ const onPreviewFile = (file) => {
 };
 const submitForm = () => {
   submit.value.handleSubmit(() => {
-    // if (fileList.value && fileList.value.length > 0) {
-    //   formData.data.fileList = fileList.value.map((item) => {
-    //     return {
-    //       id: item.raw.id,
-    //       fileName: item.raw.fileName,
-    //     };
-    //   });
-    // }
     if (
       !(
         formData.data.invoiceDetailsList &&
@@ -360,40 +351,45 @@ const submitForm = () => {
   });
 };
 const update = (row) => {
-  fileList.value = [];
   modalType.value = "edit";
   loadingDialog.value = true;
+  dialogVisible.value = true;
   proxy.post("/invoice/detail", { id: row.id }).then((res) => {
+    if (res.invoiceDetailsVoList && res.invoiceDetailsVoList.length > 0) {
+      res.invoiceDetailsList = res.invoiceDetailsVoList.map((item) => {
+        return {
+          code: item.purchaseCode,
+          purchaseId: item.purchaseId,
+          amount: item.purchaseAmount,
+          sumInvoiceMoney: item.sumMoney,
+          money: item.money,
+        };
+      });
+    }
+    if (res.type) {
+      res.type = res.type + "";
+    }
+    res.fileList = [];
+    delete res.invoiceDetailsVoList;
+    formData.data = res;
+    loadingDialog.value = false;
+    loadingDialog.value = false;
     proxy
       .post("/fileInfo/getList", { businessIdList: [row.id] })
-      .then((res) => {
-        if (res[row.id] && res[row.id].length > 0) {
-          fileList.value = res[row.id].map((item) => {
+      .then((fileObj) => {
+        if (fileObj[row.id] && fileObj[row.id].length > 0) {
+          formData.data.fileList = fileObj[row.id].map((item) => {
             return {
-              raw: item,
+              ...item,
               name: item.fileName,
               url: item.fileUrl,
             };
           });
+        } else {
+          formData.data.fileList = [];
         }
       });
-    res.invoiceDetailsList = res.invoiceDetailsVoList.map((item) => {
-      return {
-        code: item.purchaseCode,
-        purchaseId: item.purchaseId,
-        amount: item.purchaseAmount,
-        sumInvoiceMoney: item.sumMoney,
-        money: item.money,
-      };
-    });
-    if (res.type) {
-      res.type = res.type + "";
-    }
-    formData.data = res;
-    delete formData.data.invoiceDetailsVoList;
-    loadingDialog.value = false;
   });
-  dialogVisible.value = true;
 };
 </script>