Browse Source

提交代码

Lijy 4 months ago
parent
commit
df5a6bfce4

+ 3 - 2
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/contacts/contactsInfo.vue

@@ -2,6 +2,7 @@
   <div class="flex flex-col h-full">
     <div class="bg-white info flex-1 overflow-y-auto cellnormall">
       <van-cell title="联系人姓名" :value="info.name" />
+      <van-cell title="客户" :value="info.customName" />
       <van-cell title="电话" :value="info.phone" />
       <van-cell title="邮箱" :value="info.email" />
       <van-cell title="职务" :value="info.position" />
@@ -96,8 +97,8 @@ function jumpEdit() {
   const formJson = fixedData.formJson[routingInformation.key] || []
   const formList = resetListData(formJson?.list)
   const filedObj = getListFieldKey(formList, props.info)
-  const formVal = { ...filedObj, id: props.info.id }
-
+  let formVal = { ...filedObj, id: props.info.id }
+  formVal.isFrequent = String(formVal.isFrequent ? '1' : '0')
   router.navigateTo({
     pathName: 'addEditor',
     success: () => {

+ 17 - 5
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/contract/addEditor.vue

@@ -59,6 +59,7 @@ import useRouterStore from "@store/useRouterStore.js";
 import FoldingPanel from '@components/common/foldingPanel.vue';
 import dayjs from 'dayjs';
 import commonUtil from "@utility/commonUtil"
+import { number } from 'echarts';
 
 const router = useRouterStore()
 const { toastText, toastSuccess, toastFail, toastLoading } = useToast()
@@ -90,9 +91,10 @@ function onSubmit() {
     if (!res.data) {
       return
     }
-
-    for(let i in paymentPlanList.value) {
-      const row = paymentPlanList.value[i]
+    const determineArray = paymentPlanList.value.filter(item => item.isPayed || (item.payDate || item.amount))
+    let totalNum = 0
+    for(let i in determineArray) {
+      const row = determineArray[i]
       if(!row.payDate) {
         toastText('回款日期不能为空')
         return
@@ -101,13 +103,23 @@ function onSubmit() {
         toastText('回款金额不能为空和0')
         return
       }
+      totalNum += Number(determineArray[i].amount)
       if(formVal.value.id) {
-        paymentPlanList.value[i].contractId = formVal.value.id
+        determineArray[i].contractId = formVal.value.id
       }
     }
 
+    if(totalNum > 0 && !res.data.amounts) {
+      toastText('请输入合同金额')
+      return
+    }
+    if(totalNum > res.data.amounts) {
+      toastText('回款金额不能大于合同金额')
+      return
+    }
+
     toastLoading('保存中', 0)
-    requests.post(props.formValue?.id ? CONTRACT_EDITING : CONTRACT_ADDITION_EDITING, { ...commonUtil.getFromValue({ ...props.formValue, ...res.data, paymentListStr: JSON.stringify(paymentPlanList.value) }) }).then(() => {
+    requests.post(props.formValue?.id ? CONTRACT_EDITING : CONTRACT_ADDITION_EDITING, { ...commonUtil.getFromValue({ ...props.formValue, ...res.data, paymentListStr: JSON.stringify(determineArray || []) }) }).then(() => {
       toastSuccess('保存成功')
       setTimeout(() => {
         router.navigateBack({

+ 5 - 3
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/tasks/detail.vue

@@ -113,14 +113,16 @@ watch(() => props.info, (newValue) => {
 
 function showPickerConfirm({ selectedValues }) {
   const dates = selectedValues.join('-')
-  if(showDateType.value = 'showStartDelayData') {
+  if(showDateType.value == 'showStartDelayData') {
     showStartDelayData.value = dates
+    showEndtDelayData.value = ''
   }
 
-  if(showDateType.value = 'showEndtDelayData') {
+  if(showDateType.value == 'showEndtDelayData') {
     showEndtDelayData.value = dates
   }
-
+  console.log(showStartDelayData.value)
+  console.log(showEndtDelayData.value)
   showDatePicker.value = false
 }
 

+ 9 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/analysis/index.vue

@@ -6,6 +6,8 @@ import Divider from './components/Divider.vue';
 import Echarts from '@/components/ReEcharts/index.vue';
 import { EChartsOption, use } from 'echarts';
 import { dayjs } from 'element-plus';
+import { useStore } from "../../store/index"
+const { userInfo } = useStore()
 import {
   getSummaryData,
   getBulletinData,
@@ -16,7 +18,9 @@ import {
   SummaryData
 } from './api';
 
-const permissionOptions = [
+const dataAnalysisFlag = userInfo?.moduleList?.filter((item: any) => item.path == '/analysis') || []
+
+const permissionOptions = dataAnalysisFlag.length > 0 ? [
   {
     label: '仅本人',
     value: 0
@@ -33,7 +37,10 @@ const permissionOptions = [
     label: '本部门及下属部门',
     value: 3
   }
-];
+] : [{
+    label: '仅本人',
+    value: 0
+  },]
 const dateOptions = [
   {
     label: '本月',

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/component/deteleTables.vue

@@ -125,7 +125,7 @@ function getTableList() {
             deteleBusinessTable.value = data.map((item: any) => {
                 return {
                     ...item,
-                    expectedTransactionDate: formatDate(new Date(item.expectedTransactionDate))
+                    expectedTransactionDate: item.expectedTransactionDate ? formatDate(new Date(item.expectedTransactionDate)) : null
                 }
             })
             businessTotalTable.value = total

+ 3 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/deteleTables.vue

@@ -34,7 +34,7 @@
                             <TextTranslation translationTypes="userName" :translationValue="scope.row.creatorName"></TextTranslation>
                         </template>
                     </el-table-column>
-                    <el-table-column prop="newCreateTime" label="创建时间" width="180"></el-table-column>
+                    <el-table-column prop="createTime" label="创建时间" width="180"></el-table-column>
                     <el-table-column label="操作" fixed="right" width="120">
                         <template #default="scope">
                             <el-button link type="primary" size="large"
@@ -133,7 +133,8 @@ function getTableList() {
             deteleBusinessTable.value = data.map((item: any) => {
                 return {
                     ...item,
-                    expectedTransactionDate: formatDate(new Date(item.expectedTransactionDate))
+                    expectedTransactionDate: formatDate(new Date(item.expectedTransactionDate)),
+                    createTime: item.createTime ? formatDate(new Date(item.createTime)) : null
                 }
             })
             businessTotalTable.value = total

+ 8 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/header/header.vue

@@ -295,7 +295,14 @@ const toDetail = (row: any) => {
 
 onMounted(() => {
   getNewsDrawerTableData()
-  routerList.value = routers;
+  const isThereAnyDataAnalysisAvailable = routers.filter((item: any) => item.path == '/analysis') || []
+  routerList.value = isThereAnyDataAnalysisAvailable.length > 0 ? routers : [
+    { name: '首页', id: 99999, path: '/analysis', isMenu: true, useState: false, orderitem: 1, checked: false, icon: null, functionList: [], children: [], parentId: null },
+    ...routers
+  ];
+  setTimeout(() => {
+    console.log(routerList.value)
+  }, 3000)
   activeRouter.value = routerList.value.find((item) => item.path === router.currentRoute.value.path);
 
   window.addEventListener('resize', updateVisibleItems);

+ 11 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/order/component/deteleTables.vue

@@ -24,6 +24,9 @@
                             <template v-if="['customSignerName', 'companySignerName', 'inchargerName', 'creatorName'].includes(item.prop)">
                                 <TextTranslation translationTypes="userName" :translationValue="scope.row[item.prop]"></TextTranslation>
                             </template>
+                            <template v-else-if="item.prop === 'receivedStatus'">
+                                <div>{{ selectData.RemittanceStatus[scope.row.receivedStatus].name }}</div>
+                            </template>
                             <span v-else>{{ scope.row[item.prop] }}</span>
                         </template>
                     </el-table-column>
@@ -78,6 +81,14 @@ const props = defineProps<{
     visibles: boolean
 }>()
 
+const selectData = reactive({ // 下拉数据
+  Personnel: [] as personnelInterface[],
+  Customer: [] as any[], // 客户名称
+  OrderType: [] as any[], // 订单类型
+  RemittanceStatus: [{ id: 0, name: '未回款' }, { id: 1, name: '已回款' }, { id: 2, name: '已完全回款' }] as any[], // 回款状态
+  AllProduct: [] as any[] // 所有产品
+})
+
 watch(() => props.visibles, (newVal) => {
     deteleBusinessDialogVisible.value = newVal
     if (newVal) {

+ 5 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/deteleTables.vue

@@ -23,7 +23,11 @@
                     <el-table-column prop="unitName" label="单位" width="180"></el-table-column>
                     <el-table-column prop="price" label="标准价格(元)" width="180"></el-table-column>
                     <el-table-column prop="inventory" label="库存" width="180"></el-table-column>
-                    <el-table-column prop="status" label="状态" width="180"></el-table-column>
+                    <el-table-column prop="status" label="状态" width="180">
+                        <template #default="scope">
+                            {{ scope.row.status == 1 ? '上架' : '下架' }}
+                        </template>
+                    </el-table-column>
                     <el-table-column prop="inchargerName" label="负责人" width="190">
                         <template #default="scope">
                           <TextTranslation translationTypes="userName" :translationValue="scope.row.inchargerName"></TextTranslation>

+ 50 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/index.vue

@@ -154,6 +154,31 @@
         </div>
       </div>
     </div>
+    <el-dialog v-model="restartPopUpWindowVisable" title="重启任务" width="500">
+      <div class="mt-8">
+        <el-form :model="restartFrom">
+          <el-form-item label="重启时间" label-width="7em" prop="showStartDelayData">
+            <el-date-picker
+              v-model="restartFrom.timesList"
+              type="daterange"
+              start-placeholder="开始时间"
+              end-placeholder="结束时间"
+              value-format="YYYY-MM-DD"
+              style="width: 300px"
+            />
+          </el-form-item>
+          <div class="text-[#ff4e4e] ml-8">重启任务的时间不能在今天之前</div>
+        </el-form>
+      </div>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="restartPopUpWindowVisable = false">取消</el-button>
+          <el-button type="primary" @click="restartTaksTime">
+            确定
+          </el-button>
+        </div>
+      </template>
+    </el-dialog>
     <TaskModal :visible="taskModalVisible" :title="isEdit ? '编辑任务' : '新建任务'" :save-loading="taskLoading"
       :edit-form="taskForm" :show-log="isEdit" @close="closeTaskModal" @submit="submitForm" />
     <ImportModal :visible="importVisible" :save-loading="importLoading" @close="closeImportModal"
@@ -188,6 +213,9 @@ const len = computed(() => {
   return tableRef.value?.getSelectionRows().length
 })
 const taskLoading = ref<saveLoadingType>("1");
+const restartPopUpWindowVisable = ref(false);
+const restartFrom = ref<any>({});
+
 function closeTaskModal() {
   taskModalVisible.value = false;
   taskForm.value = null;
@@ -388,17 +416,36 @@ function finishRow(item: any) {
     globalPopup?.showError(err.msg)
   })
 }
-function restart(item: any) {
+
+function restartTaksTime() {
+  const { id, timesList } = restartFrom.value
+  const date = dayjs().format("YYYY-MM-DD")
+  if(timesList[0] < date) {
+    globalPopup?.showInfo("开始时间不能在今天之前")
+    return
+  }
   post(UPDATE_TASK_STATUS, {
-    id: item.id,
-    status: 0
+    id, status: 0,
+    startDate: timesList[0],
+    endDate: timesList[1]
   }).then(() => {
     search()
     globalPopup?.showSuccess("操作成功")
+    restartPopUpWindowVisable.value = false
   }).catch(err => {
     globalPopup?.showError(err.msg)
   })
 }
+
+function restart(item: any) {
+  const starDate = item.startDate ? item.startDate : dayjs().format("YYYY-MM-DD")
+  const endDate = item.endDate ? item.endDate : dayjs().format("YYYY-MM-DD")
+  restartFrom.value = {
+    ...item,
+    timesList: [starDate, endDate]
+  }
+  restartPopUpWindowVisable.value = true
+}
 function deleteRow(item: any) {
   confirmAction("确定删除吗?").then(() => {
     post(DELETE_TASKS, {

+ 3 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/index.vue

@@ -38,13 +38,14 @@
             <el-option v-for="item in roleList" :key="item.id" :label="item.rolename" :value="item.id" />
           </el-select>
         </div>
-        <el-dropdown>
+        <el-button type="primary" v-if="userInfo.userNameNeedTranslate == 1" @click="transitionOperation('exportUser', '')" v-permission="['teamExport']">导出人员</el-button>
+        <el-dropdown v-if="userInfo.userNameNeedTranslate != 1">
           <el-button type="primary">
             更多操作<el-icon class="el-icon--right"><arrow-down /></el-icon>
           </el-button>
           <template #dropdown>
             <el-dropdown-menu>
-              <el-dropdown-item @click="addPersone(false)" v-permission="['teamAdd']" v-if="userInfo.userNameNeedTranslate != 1">添加人员</el-dropdown-item>
+              <el-dropdown-item @click="addPersone(false)" v-permission="['teamAdd']">添加人员</el-dropdown-item>
               <el-dropdown-item @click="transitionOperation('exportUser', '')" v-permission="['teamExport']">导出人员</el-dropdown-item>
               <el-dropdown-item @click="transitionOperation('importUser', '')" v-permission="['teamImport']">批量导入</el-dropdown-item>
             </el-dropdown-menu>

+ 7 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/thread/deteleTables.vue

@@ -55,6 +55,7 @@ import { ref, reactive, onMounted, watchEffect, watch, inject } from 'vue'
 import { DETERDETELE, DEYELWCLUE, ROLLBACK } from './constant';
 import { ElTable } from 'element-plus';
 import { confirmAction } from '@/utils/tools';
+import { formatDate } from '@/utils/times';
 
 const emits = defineEmits(['showDeteleClue']);
 const globalPopup = inject<GlobalPopup>('globalPopup')
@@ -138,7 +139,12 @@ function getTableList() {
     post(DEYELWCLUE, { ...tableForm }).then((res) => {
         if (res.code == 'ok') {
             const { data, total } = res.data
-            deteleClueTable.value = data
+            deteleClueTable.value = (data || []).map((item: any) => {
+                return {
+                    ...item,
+                    createTime: item.createTime ? formatDate(new Date(item.createTime)) : null
+                }
+            })
             clueTotalTable.value = total
         }
     }).finally(() => {