cz 1 سال پیش
والد
کامیت
8e380506e9

+ 1 - 2
src/views/product/material/index.vue

@@ -78,10 +78,9 @@
                   flex-direction: column;
                   justify-content: space-between;
                 ">
-              <div class="print-row">物料编码:{{ rowData.code }}</div>
 
               <div class="print-row">物料名称:{{ rowData.name }}</div>
-              <div class="print-row">物料型号:{{ rowData.spec }}</div>
+              <div class="print-row">规格型号:{{ rowData.spec }}</div>
 
             </div>
           </div>

+ 46 - 168
src/views/salesMange/salesMange/afterSales/index.vue

@@ -2,66 +2,32 @@
   <div class="tenant">
     <!-- <Banner /> -->
     <div class="content">
-      <byTable
-        :source="sourceList.data"
-        :pagination="sourceList.pagination"
-        :config="config"
-        :loading="loading"
-        highlight-current-row
-        :selectConfig="selectConfig"
-        :table-events="{
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
+               :selectConfig="selectConfig" :table-events="{
           //element talbe事件都能传
-        }"
-        :action-list="[
+        }" :action-list="[
           {
             text: '添加售后',
             disabled: false,
             action: () => clickAdd(),
           },
-        ]"
-        @get-list="getList"
-      >
+        ]" @get-list="getList">
       </byTable>
     </div>
 
-    <el-dialog
-      title="添加售后"
-      v-model="dialogVisible"
-      width="40%"
-      destroy-on-close
-      v-if="dialogVisible"
-    >
-      <byForm
-        :formConfig="formConfig"
-        :formOption="formOption"
-        v-model="formData.data"
-        :rules="rules"
-        ref="formDom"
-        v-loading="submitLoading"
-      >
+    <el-dialog title="添加售后" v-model="dialogVisible" width="40%" destroy-on-close v-if="dialogVisible">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
         <template #productSn>
           <div style="width: 100%; display: flex">
-            <el-input
-              v-model="formData.data.productSn"
-              placeholder="请输入产品Sn"
-            />
-            <el-button @click="handleQuery" style="margin-left: 10px"
-              >查询</el-button
-            >
+            <el-input v-model="formData.data.productSn" placeholder="请输入产品Sn" />
+            <el-button @click="handleQuery" style="margin-left: 10px">查询</el-button>
           </div>
         </template>
 
         <template #file>
           <div style="width: 100%">
-            <el-upload
-              v-model:fileList="formData.data.fileList"
-              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
-              :data="uploadData"
-              multiple
-              :before-upload="handleBeforeUpload"
-              :on-success="handleSuccess"
-              :on-preview="onPreviewFile"
-            >
+            <el-upload v-model:fileList="formData.data.fileList" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData"
+                       multiple :before-upload="handleBeforeUpload" :on-success="handleSuccess" :on-preview="onPreviewFile">
               <el-button type="primary" plain>选择</el-button>
             </el-upload>
           </div>
@@ -69,32 +35,16 @@
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button
-          type="primary"
-          @click="submitForm()"
-          size="large"
-          :loading="submitLoading"
-        >
+        <el-button type="primary" @click="submitForm()" size="large" :loading="submitLoading">
           确 定
         </el-button>
       </template>
     </el-dialog>
 
-    <el-dialog
-      title="售后跟进"
-      v-model="openFollow"
-      width="80%"
-      destroy-on-close
-      v-if="openFollow"
-    >
+    <el-dialog title="售后跟进" v-model="openFollow" width="80%" destroy-on-close v-if="openFollow">
       <div style="width: 100%; display: flex">
         <div style="width: 48%; height: 70vh; overflow: auto; margin-right: 2%">
-          <byForm
-            :formConfig="formConfigDetail"
-            :formOption="formOption"
-            v-model="formData.detailData"
-            ref="detailDom"
-          >
+          <byForm :formConfig="formConfigDetail" :formOption="formOption" v-model="formData.detailData" ref="detailDom">
             <template #title1>
               <div style="width: 100%">
                 <TitleInfo content="产品信息"></TitleInfo>
@@ -107,56 +57,31 @@
             </template>
             <template #file>
               <div style="width: 100%">
-                <el-upload
-                  v-model:fileList="formData.detailData.fileList"
-                  action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
-                  :data="uploadData"
-                  multiple
-                  :before-upload="handleBeforeUpload"
-                  :on-success="handleSuccess"
-                  :on-preview="onPreviewFile"
-                >
+                <el-upload v-model:fileList="formData.detailData.fileList" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+                           :data="uploadData" multiple :before-upload="handleBeforeUpload" :on-success="handleSuccess" :on-preview="onPreviewFile">
                   <el-button type="primary" plain disabled>选择</el-button>
                 </el-upload>
               </div>
             </template>
           </byForm>
         </div>
-        <div
-          style="width: 50%; height: 70vh; overflow: auto; padding-right: 20px"
-        >
-          <el-form
-            :model="formData.followData"
-            label-width="120px"
-            label-position="top"
-            ref="followDom"
-            :rules="followRules"
-            v-loading="submitLoading"
-          >
+        <div style="width: 50%; height: 70vh; overflow: auto; padding-right: 20px">
+          <el-form :model="formData.followData" label-width="120px" label-position="top" ref="followDom" :rules="followRules"
+                   v-loading="submitLoading">
             <div style="width: 100%">
-              <TitleInfo
-                content="配件问题"
-                style="margin: 20px 0 20px 0"
-              ></TitleInfo>
+              <TitleInfo content="配件问题" style="margin: 20px 0 20px 0"></TitleInfo>
               <el-collapse v-model="activeNames">
-                <el-collapse-item
-                  v-for="(item, index) in formData.followData.bomDetailList"
-                  :key="item.id"
-                  :name="item.id"
-                >
+                <el-collapse-item v-for="(item, index) in formData.followData.bomDetailList" :key="item.id" :name="item.id">
                   <template #title>
                     <div style="width: 100%; display: flex">
                       <div style="flex: 1">
-                        <el-icon
-                          color="red"
-                          v-if="
+                        <el-icon color="red" v-if="
                             submitData[item.productId].quantity &&
                             submitData[item.productId].remark &&
                             submitData[item.productId].fileList.length > 0
-                          "
-                          style="margin-right: 10px"
-                          ><WarnTriangleFilled
-                        /></el-icon>
+                          " style="margin-right: 10px">
+                          <WarnTriangleFilled />
+                        </el-icon>
                         {{ item.productName }}
                       </div>
                       <div style="margin-right: 10px">
@@ -166,38 +91,18 @@
                   </template>
                   <div>
                     <el-form-item label="售后数量">
-                      <el-input-number
-                        onmousewheel="return false;"
-                        v-model="submitData[item.productId].quantity"
-                        placeholder="请输入"
-                        style="width: 100%"
-                        :precision="0"
-                        :controls="false"
-                        :min="0"
-                        :disabled="isDetail"
-                      />
+                      <el-input-number onmousewheel="return false;" v-model="submitData[item.productId].quantity" placeholder="请输入"
+                                       style="width: 100%" :precision="0" :controls="false" :min="0" :disabled="isDetail" />
                     </el-form-item>
                     <el-form-item label="售后说明">
-                      <el-input
-                        v-model="submitData[item.productId].remark"
-                        type="textarea"
-                        :disabled="isDetail"
-                      />
+                      <el-input v-model="submitData[item.productId].remark" type="textarea" :disabled="isDetail" />
                     </el-form-item>
                     <el-form-item label="现场照片" style="margin-top: 20px">
                       <div>
-                        <el-upload
-                          v-model:fileList="submitData[item.productId].fileList"
-                          action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
-                          :data="uploadData"
-                          multiple
-                          :before-upload="handleBeforeUpload"
-                          :on-success="handleSuccess"
-                          :on-preview="onPreviewFile"
-                        >
-                          <el-button type="primary" plain :disabled="isDetail"
-                            >选择</el-button
-                          >
+                        <el-upload v-model:fileList="submitData[item.productId].fileList" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+                                   :data="uploadData" multiple :before-upload="handleBeforeUpload" :on-success="handleSuccess"
+                                   :on-preview="onPreviewFile">
+                          <el-button type="primary" plain :disabled="isDetail">选择</el-button>
                         </el-upload>
                       </div>
                     </el-form-item>
@@ -210,45 +115,19 @@
               <TitleInfo content="其他问题"></TitleInfo>
             </div>
             <el-form-item label=" " prop="afterSalesRemark">
-              <el-input
-                v-model="formData.followData.afterSalesRemark"
-                type="textarea"
-                placeholder="请输入"
-                :disabled="isDetail"
-              />
+              <el-input v-model="formData.followData.afterSalesRemark" type="textarea" placeholder="请输入" :disabled="isDetail" />
             </el-form-item>
             <div style="width: 100%">
-              <TitleInfo
-                content="售后金额"
-                style="margin-top: 20px"
-              ></TitleInfo>
+              <TitleInfo content="售后金额" style="margin-top: 20px"></TitleInfo>
             </div>
             <el-form-item label=" " prop="amount">
-              <el-input-number
-                onmousewheel="return false;"
-                v-model="formData.followData.amount"
-                placeholder="请输入"
-                style="width: 100%"
-                :precision="2"
-                :controls="false"
-                :min="0"
-                :disabled="isDetail"
-              />
+              <el-input-number onmousewheel="return false;" v-model="formData.followData.amount" placeholder="请输入" style="width: 100%" :precision="2"
+                               :controls="false" :min="0" :disabled="isDetail" />
             </el-form-item>
             <div style="width: 100%">
-              <TitleInfo
-                content="程序文件"
-                style="margin: 20px 0 20px 0"
-              ></TitleInfo>
-              <el-upload
-                v-model:fileList="formData.followData.fileListOne"
-                action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
-                :data="uploadData"
-                multiple
-                :before-upload="handleBeforeUpload"
-                :on-success="handleSuccess"
-                :on-preview="onPreviewFile"
-              >
+              <TitleInfo content="程序文件" style="margin: 20px 0 20px 0"></TitleInfo>
+              <el-upload v-model:fileList="formData.followData.fileListOne" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+                         :data="uploadData" multiple :before-upload="handleBeforeUpload" :on-success="handleSuccess" :on-preview="onPreviewFile">
                 <el-button type="primary" plain disabled>选择</el-button>
               </el-upload>
             </div>
@@ -258,14 +137,7 @@
 
       <template #footer>
         <el-button @click="openFollow = false" size="large">取 消</el-button>
-        <el-button
-          type="primary"
-          @click="submitFollow()"
-          size="large"
-          :loading="submitLoading"
-          v-if="!isDetail"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="submitFollow()" size="large" :loading="submitLoading" v-if="!isDetail">确 定</el-button>
       </template>
     </el-dialog>
   </div>
@@ -278,7 +150,6 @@ import byForm from "@/components/byForm/index";
 import useUserStore from "@/store/modules/user";
 import TitleInfo from "@/components/TitleInfo/index.vue";
 import { async } from "@antv/x6/lib/registry/marker/main";
-
 const { proxy } = getCurrentInstance();
 const uploadData = ref({});
 const loading = ref(false);
@@ -352,6 +223,7 @@ const config = computed(() => {
         prop: "productName",
       },
     },
+
     {
       attrs: {
         label: "规格型号",
@@ -360,6 +232,12 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "售后金额",
+        prop: "amount",
+      },
+    },
+    {
+      attrs: {
         label: "售后状态",
         prop: "status",
       },

+ 145 - 32
src/views/salesMange/salesMange/profitSettlement/index.vue

@@ -12,59 +12,82 @@
       <el-table :data="sourceList.data" v-loading="loading">
         <el-table-column label="合同编号" prop="salesContractCode" width="160" fixed />
         <el-table-column label="客户名称" prop="customerName" min-width="200" fixed />
-        <el-table-column label="收入总计" prop="totalIncome" width="140" fixed />
-        <el-table-column label="支出总计" prop="totalExpenditure" width="140" fixed />
-        <el-table-column label="毛利率" width="140" fixed>
+        <el-table-column label="合同金额" width="110" fixed>
           <template #default="{ row }">
-            <div>{{ parseFloat(row.grossProfitMargin).toFixed(2) }}%</div>
+            <div> {{ moneyFormat( row.contractAmount )}}</div>
           </template>
         </el-table-column>
-        <el-table-column label="毛利" prop="grossProfit" width="140" fixed />
-        <el-table-column label="合同金额" width="140">
+        <el-table-column label="是否已结清" width="110" fixed>
           <template #default="{ row }">
-            <div> {{ row.contractAmount }}</div>
+            <div>
+              <span style="padding: 4px" :class="[row.isSettled == 1 ? 'active' : '']">
+                {{
+                proxy.dictValueLabel(row.isSettled, isSettled)
+              }}</span>
+            </div>
           </template>
         </el-table-column>
-
-        <el-table-column label="物料成本" width="140">
+        <el-table-column label="收入总计" prop="totalIncome" width="110" fixed>
           <template #default="{ row }">
-            <div> {{ row.materialFee }}</div>
+            <div> {{ moneyFormat(row.totalIncome) }}</div>
           </template>
         </el-table-column>
-
-        <el-table-column label="拖车费" width="140">
+        <el-table-column label="支出总计" prop="totalExpenditure" width="110" fixed>
           <template #default="{ row }">
-            <div>{{ row.trailerFee }}</div>
+            <div> {{ moneyFormat(row.totalExpenditure) }}</div>
           </template>
         </el-table-column>
+        <el-table-column label="毛利率" width="110" fixed>
+          <template #default="{ row }">
+            <div>{{ parseFloat(row.grossProfitMargin).toFixed(2) }}%</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="毛利" prop="grossProfit" width="110" fixed />
 
-        <el-table-column label="验货红包" width="140">
+        <el-table-column label="合同到账金额" width="110">
+          <template #default="{ row }">
+            <div> {{ moneyFormat(row.contractClaimAmount) }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="物料成本" width="110">
+          <template #default="{ row }">
+            <div> {{ moneyFormat(row.materialFee) }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="售后成本" width="110">
           <template #default="{ row }">
             <div>
-              {{ row.inspectionRedPackFee }}
+              <span style="color: #409eff; cursor: pointer" @click="handleOpenRecords(row)"> {{ moneyFormat(row.afterSalesFee) }}</span>
             </div>
           </template>
         </el-table-column>
-        <el-table-column label="佣金" width="140">
+
+        <el-table-column label="拖车费" width="110">
           <template #default="{ row }">
-            <div>{{ row.commissionFee }}</div>
+            <div>{{ moneyFormat(row.trailerFee) }}</div>
           </template>
         </el-table-column>
-        <el-table-column label="售后成本" width="140">
+
+        <el-table-column label="验货红包" width="110">
           <template #default="{ row }">
             <div>
-              {{ row.afterSalesFee }}
+              {{ moneyFormat(row.inspectionRedPackFee) }}
             </div>
           </template>
         </el-table-column>
+        <el-table-column label="佣金" width="110">
+          <template #default="{ row }">
+            <div>{{ moneyFormat(row.commissionFee) }}</div>
+          </template>
+        </el-table-column>
 
-        <el-table-column label="其他" width="140">
+        <el-table-column label="其他" width="110">
           <template #default="{ row }">
-            <div>{{ row.otherFee }}</div>
+            <div>{{ moneyFormat(row.otherFee) }}</div>
           </template>
         </el-table-column>
 
-        <el-table-column label="操作" align="center" width="160" fixed="right">
+        <el-table-column label="操作" align="center" width="100" fixed="right">
           <template #default="{ row }">
             <div>
               <el-button type="primary" @click="changeBudget(row)" link>其他支出</el-button>
@@ -148,6 +171,15 @@
         <el-button @click="moreSearchQuery" type="primary" size="large">搜索</el-button>
       </template>
     </el-dialog>
+
+    <el-dialog title="售后记录" v-if="afterSalesRecorDialog" v-model="afterSalesRecorDialog" width="60%">
+      <byTable :source="afterSalesRecordData" :hidePagination="true" :hideSearch="true" :config="configOne" :pagination="pagination"
+               highlight-current-row :selectConfig="[]">
+      </byTable>
+      <template #footer>
+        <el-button @click="afterSalesRecorDialog = false" size="large">取 消</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -176,13 +208,24 @@ const sourceList = ref({
   },
 });
 const loading = ref(false);
+const isSettled = ref([
+  {
+    label: "已结清",
+    value: "1",
+  },
+  {
+    label: "未结清",
+    value: "0",
+  },
+]);
+
 const selectConfig = computed(() => {
   return [
-    // {
-    //   label: "业务员",
-    //   prop: "userId",
-    //   data: userList.value,
-    // },
+    {
+      label: "是否已结清",
+      prop: "isSettled",
+      data: isSettled.value,
+    },
   ];
 });
 const config = computed(() => {
@@ -233,6 +276,11 @@ const statConfig = computed(() => [
             color: "#FF6F67",
           },
           {
+            label: "售后成本",
+            num: proxy.moneyFormat(headerData.value.afterSalesFee, 2),
+            color: "#FF6F67",
+          },
+          {
             label: "拖车费",
             num: proxy.moneyFormat(headerData.value.trailerFee, 2),
             color: "#FF6F67",
@@ -248,11 +296,6 @@ const statConfig = computed(() => [
             color: "#FF6F67",
           },
           {
-            label: "售后成本",
-            num: proxy.moneyFormat(headerData.value.afterSalesFee, 2),
-            color: "#FF6F67",
-          },
-          {
             label: "其他",
             num: proxy.moneyFormat(headerData.value.otherFee, 2),
             color: "#FF6F67",
@@ -702,6 +745,71 @@ const moreSearchReset = () => {
   };
   moreSearchQuery();
 };
+const configOne = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "售后编码",
+        prop: "code",
+        width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "产品Sn",
+        prop: "productSn",
+        width: 140,
+      },
+    },
+
+    {
+      attrs: {
+        label: "产品名称",
+        prop: "productName",
+      },
+    },
+
+    {
+      attrs: {
+        label: "规格型号",
+        prop: "productSpec",
+        width: 130,
+      },
+    },
+    {
+      attrs: {
+        label: "售后金额",
+        prop: "amount",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "售后状态",
+        prop: "status",
+        width: 100,
+      },
+      render(status) {
+        return status == "0" ? "进行中" : "完成";
+      },
+    },
+  ];
+});
+const afterSalesRecordData = ref([]);
+
+const afterSalesRecorDialog = ref(false);
+const handleOpenRecords = (row) => {
+  afterSalesRecorDialog.value = true;
+  proxy
+    .post("/afterSalesRecord/page", {
+      pageNum: 1,
+      pageSize: 9999,
+      contractId: row.id,
+    })
+    .then((res) => {
+      afterSalesRecordData.value = res.rows;
+    });
+};
 </script>
 
 <style lang="scss" scoped>
@@ -711,4 +819,9 @@ const moreSearchReset = () => {
 ::v-deep(.el-input-number .el-input__inner) {
   text-align: left;
 }
+.active {
+  background: #a6dd82;
+  color: #fff;
+  border-radius: 4px;
+}
 </style>