ly 10 месяцев назад
Родитель
Сommit
c13326cce2

+ 10 - 1
src/api/business/entrust/currentWorkOrder.js

@@ -163,4 +163,13 @@ export function saveExamine(data) {
     method: 'post',
     data: data
   })
-}
+}
+// 添加委托
+export function stopWorkOrderApi(data) {
+  request.defaults.baseURL = '/ezhizao-yzbh-entrust'
+  return request({
+    url: '/business/workOrderCurrent/stopWorkOrder',
+    method: 'post',
+    data: data
+  })
+}

+ 2 - 1
src/directive/index.js

@@ -1,5 +1,5 @@
 import hasRole from './permission/hasRole'
-import {hasPermi,hasNoPermi} from './permission/hasPermi'
+import {hasPermi,hasNoPermi,hasPermiView} from './permission/hasPermi'
 //import {hasNoPermi} from './permission/Permi'
 import copyText from './common/copyText'
 
@@ -8,4 +8,5 @@ export default function directive(app){
   app.directive('hasPermi', hasPermi)
   app.directive('hasNoPermi', hasNoPermi)
   app.directive('copyText', copyText)
+  app.directive('hasPermiView',hasPermiView)
 }

+ 23 - 0
src/directive/permission/hasPermi.js

@@ -48,4 +48,27 @@ export const hasNoPermi =  {
       throw new Error(`请设置操作权限标签值`)
     }
   }
+}
+export const hasPermiView =  {
+  mounted(el, binding, vnode) {
+    const { value } = binding
+    const all_permission = "*:*:*";
+    const permissions = useUserStore().permissions
+    // debugger
+
+    if (value && value instanceof Array && value.length > 0) {
+      const permissionFlag = value
+
+      const hasPermissions = permissions.some(permission => {
+        return all_permission === permission || permissionFlag.includes(permission)
+      })
+      if(!hasPermissions){
+        el.disabled = true;
+        el.style["color"] = "#c7c7c7";
+      }
+
+    } else {
+      throw new Error(`请设置操作权限标签值`)
+    }
+  }
 }

+ 17 - 1
src/views/business/collect/count/index.vue

@@ -72,9 +72,16 @@
             </el-table-column>
             <el-table-column label="合同编号" align="center" prop="contractNo">
             </el-table-column>
+          <el-table-column label="开始月" align="center" prop="inputStartMonth">
+          </el-table-column>
+          <el-table-column label="结束月" align="center" prop="inputEndMonth">
+          </el-table-column>
             <el-table-column label="到账日期" align="center" prop="receiptDate">
             </el-table-column>
             <el-table-column label="确认所属时间" align="center" prop="actuallyDate">
+              <template #default="scope">
+                {{ actuallyDateFormat(scope.row.actuallyDate) }}
+              </template>
             </el-table-column>
             <el-table-column label="提收款金额" align="center" prop="withdrawalAmount">
             </el-table-column>
@@ -407,6 +414,15 @@
     function handleExport() {
         exportStatistics(queryParams.value);
     }
-
+const actuallyDateFormat = (actuallyDate) => {
+  let str = "";
+  actuallyDate.split(",").forEach((s)=>{
+    if(s !== "0000-00-00"){
+      str+=s+",";
+    }
+  })
+  str = str.substring(0,str.length-1);
+  return str;
+}
     getList();
 </script>

+ 10 - 5
src/views/business/crm/order/form.vue

@@ -217,7 +217,7 @@
                         <el-col :span="4" style="padding-top: 18px">
                           <el-form-item label="服务月数">
                             <el-input-number v-if="editStatus" v-model="item.serviceNum" :step="1" step-strictly
-                                             :min="0" :disabled="item.disabled" :controls="false" @change="
+                                             :min="0" :disabled="item.monthDisabled" :controls="false" @change="
                                 (arg) =>
                                   inputChangeHandler(
                                     'loop',
@@ -232,7 +232,7 @@
                         <el-col :span="4" style="padding-top: 18px">
                           <el-form-item label="赠送月数">
                             <el-input-number v-if="editStatus" v-model="item.freeNum" :step="1" step-strictly :min="0"
-                                             :disabled="item.disabled"     :controls="false" @change="
+                                             :disabled="item.monthDisabled"     :controls="false" @change="
                                 (arg) =>
                                   inputChangeHandler(
                                     'loop',
@@ -262,8 +262,7 @@
                         <el-col :span="4" style="padding-top: 18px">
                           <el-form-item label="服务区间"
                                         v-if="item.timeVo != null && item.timeVo != undefined &&  type !== 'alterOrder'">
-                            <div>{{ item.timeVo.startTime.substr(0,item.timeVo.startTime.length - 3) }} ~ {{
-                                item.timeVo.endTime.substr(0,item.timeVo.endTime.length - 3) }}</div>
+                            <div>{{timeVoFormat(item.timeVo)}}</div>
                           </el-form-item>
                         </el-col>
                         <el-col :span="4" style="padding-top: 18px" v-if="item.taskTypeId ==4">
@@ -1722,7 +1721,13 @@ function showHistoryList() {
 function historyChoiceHandle(row) {
   open(row.id);
 }
-
+const timeVoFormat = (timeVo)=>{
+  if(null !== timeVo.startTime) {
+    return proxy.moment(timeVo.startTime).format("yyyy-MM") + " ~ " + proxy.moment(timeVo.endTime).format("yyyy-MM")
+  }else{
+    return ""
+  }
+}
 /** 暴露给父组件的方法 */
 defineExpose({
   open,

+ 1 - 1
src/views/business/crm/order/index.vue

@@ -112,7 +112,7 @@
       <el-table-column label="操作" fixed="right" align="center" width="130" class-name="small-padding fixed-width">
         <template #default="scope">
           <el-button link type="primary" size="small" @click="handleUpdate(scope.row)"
-            v-hasPermi="['business:archive:order:edit']">查看</el-button>
+            v-hasPermi="['business:archive:order:orderview']">查看</el-button>
           <el-button link type="danger" size="small" @click="handleDelete(scope.row)"
             v-hasPermi="['business:archive:order:remove']">删除</el-button>
         </template>

+ 16 - 2
src/views/business/entrust/workOrder/currentMonth/index.vue

@@ -21,6 +21,7 @@
         </template>
       </el-dropdown>
       <el-button style="margin-left: 5px;" type="primary" size="small" icon="Plus" @click="exportZero">导入委托</el-button>
+      <el-button v-hasPermi="['business:entrust:workOrder:base:edit']" style="margin-left: 5px;" type="danger" size="small" icon="remove" @click="stopWorkOrder">停用</el-button>
     </div>
     <!-- 搜索区 -->
     <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
@@ -168,7 +169,7 @@
     exportCurrentWorkOrder,
     delEntrust,
     transNext,
-    addEntrust, exportStore,saveExamine
+    addEntrust, exportStore,saveExamine,stopWorkOrderApi
   } from "@/api/business/entrust/currentWorkOrder";
   import SetEntrustDialog from "../setEntrustDialog";
   import useUserStore from "@/store/modules/user";
@@ -409,6 +410,19 @@
       getList();
     });
   }
-
   checkCurrentMonthHandle();
+  const stopWorkOrder = ()=>{
+    loading.value = true;
+    proxy.$modal.confirm("是否确认停用工单?").then(() => {
+      loading.value = false;
+      stopWorkOrderApi(selections.value).then((res)=>{
+        proxy.$modal.msgSuccess("停用成功");
+        getList();
+      })
+    }).catch((e) => {
+
+    }).finally(() => {
+      loading.value = false; // 确保在请求完成时也关闭加载状态
+    })
+  }
 </script>

+ 12 - 8
src/views/business/financial/collection/form.vue

@@ -10,14 +10,15 @@
             付款信息</span>
 
           <el-button v-if="editStatus" type="primary" size="small" icon="Finished" @click="submitForm">保存</el-button>
-          <el-button v-show="form.status == 1 " type="warning" size="small" icon="Finished" @click="returnZero"
-            v-hasPermi="['business:collection:return']">退回</el-button>
-          <el-button v-show="!editStatus && form.verifyDate == null " type="warning" size="small" icon="Edit"
-            v-hasPermi="['business:collection:edit']" @click="editStatus = true">修改</el-button>
+          <el-button v-show="form.status == 1 && auth.hasPermi('business:collection:return')" type="warning" size="small" icon="Finished" @click="returnZero"
+           >退回</el-button>
+          <el-button v-show="(!editStatus && form.verifyDate == null)&& auth.hasPermi('business:collection:edit') " type="warning" size="small" icon="Edit"
+            @click="editStatus = true">修改</el-button>
           <el-button v-if="form.id && editStatus" type="info" size="small" icon="Close"
             @click="editStatus = false">取消修改</el-button>
-          <el-button v-show="form.id && !editStatus && form.verifyDate == null"
-            v-hasPermi="['business:collection:verify']" type="primary" size="small" icon="Check"
+          <el-button v-show="(form.id && !editStatus && form.verifyDate == null)
+          && auth.hasPermi('business:collection:verify')"
+           type="primary" size="small" icon="Check"
             @click="verifyHandler">收款审核</el-button>
 
           <div class="screen-btn" @click="handleScreen">
@@ -122,7 +123,8 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="合同编号:" prop="remark">
-                <el-link :underline="false" type="primary" @click="handleContract(form)">{{ form.contractNo }}</el-link>
+                <el-link v-if="auth.hasPermi('business:archive:order:cwview')" :underline="false" type="primary" @click="handleContract(form)">{{ form.contractNo }}</el-link>
+                <span v-else>{{form.contractNo}}</span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
@@ -401,6 +403,7 @@
 </template>
 <script setup>
   import { uploadFile } from "@/api/tool/file";
+  import auth from "@/plugins/auth";
   // import {
   //   getOrder,
   //   initTaskTypes,
@@ -515,6 +518,7 @@
     editStatus.value = true;
     getCollection(id).then((res) => {
       form.value = res.data;
+      form.value.actuallyDate = null;
       console.log("form23", form.value);
       editStatus.value = false;
     });
@@ -652,7 +656,7 @@
       return;
     }
     if (form.value.actuallyDate == null || form.value.actuallyDate === "") {
-      proxy.$modal.msgError("请输入实际付款时间");
+      proxy.$modal.msgError("请选择确认所属时间");
       return;
     }
     if (

+ 3 - 1
src/views/business/financial/contract/form.vue

@@ -126,7 +126,8 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="合同编号:" prop="remark">
-                <el-link :underline="false" type="primary" @click="handleContract(form)">{{ form.contractNo }}</el-link>
+                <el-link v-if="auth.hasPermi('business:archive:order:cwview')" :underline="false" type="primary" @click="handleContract(form)">{{ form.contractNo }}</el-link>
+                <span v-else>{{form.contractNo}}</span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
@@ -344,6 +345,7 @@
   import contractForm from "@/views/business/crm/order/form.vue";
   import match from "@/utils/match";
   import useUserStore from "@/store/modules/user";
+  import auth from "@/plugins/auth";
   const { proxy } = getCurrentInstance();
   const baseUrl = import.meta.env.VITE_APP_BASE_API;
 

+ 3 - 2
src/views/business/financial/payment/form.vue

@@ -141,8 +141,8 @@
                 <span v-else style="width: 100%">
                   <!-- <el-button class="text-overflow" type="primary" link @click="(showContractDialog(currentContract.contractId))">{{ currentContract.formNo }}</el-button> -->
                   <!-- {{ form.contractNo }} -->
-                  <el-link :underline="false" type="primary" @click="handleContract(form)">{{ form.contractNo
-                    }}</el-link>
+                  <el-link v-if="auth.hasPermi('business:archive:order:cwview')" :underline="false" type="primary" @click="handleContract(form)">{{ form.contractNo }}</el-link>
+                <span v-else>{{form.contractNo}}</span>
                 </span>
               </el-form-item>
             </el-col>
@@ -416,6 +416,7 @@
   import companyForm from "@/views/business/crm/company/formView.vue";
   import contractForm from "@/views/business/crm/order/formView.vue";
   import useUserStore from "@/store/modules/user";
+  import auth from "@/plugins/auth";
   const { proxy } = getCurrentInstance();
   const baseUrl = import.meta.env.VITE_APP_BASE_API;
 

+ 3 - 2
src/views/business/invoice/form.vue

@@ -89,8 +89,8 @@
                                     </template>
                                 </el-input>
                                 <span v-else style="width: 100%">
-                                    <el-link :underline="false" type="primary" @click="handleContract(form)">{{
-                                        form.contractNo }}</el-link>
+                                    <el-link v-if="auth.hasPermi('business:archive:order:cwview')" :underline="false" type="primary" @click="handleContract(form)">{{ form.contractNo }}</el-link>
+                                  <span v-else>{{form.contractNo}}</span>
                                 </span>
                             </el-form-item>
                         </el-col>
@@ -385,6 +385,7 @@
     import dragUpload from "@/components/dragUpload"
     import useUserStore from "@/store/modules/user";
     import { uploadFile } from "@/api/tool/file";
+    import auth from "@/plugins/auth";
 
     const { proxy } = getCurrentInstance()
     const baseUrl = import.meta.env.VITE_APP_BASE_API;

+ 3 - 1
src/views/business/production/onceWork/index.vue

@@ -193,7 +193,7 @@
       </el-table-column>
       <el-table-column label="合同" align="center" min-width="50" >
         <template #default="scope">
-          <el-button link type="primary" size="small" @click="viewContract(scope.row)">查看</el-button>
+          <el-button v-hasPermiView="['business:archive:order:view']" link type="primary" size="small" @click="viewContract(scope.row)">查看</el-button>
         </template>
       </el-table-column>
       <el-table-column label="执行人" align="center" width="100" :show-overflow-tooltip="true">
@@ -429,7 +429,9 @@
 
   /** 导出按钮操作 */
   function handleExport() {
+    queryParams.value.orderByColumn = 't2.name'
     exportOnceWork(queryParams.value);
+    queryParams.value.orderByColumn = 'create_time'
   }
 
   function getStatusStyle(row) {