Bläddra i källkod

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

Min 11 månader sedan
förälder
incheckning
e0dd402d7e

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/components/relatedProducts/relatedProducts.vue

@@ -33,7 +33,7 @@
             <el-table-column prop="quantity" label="数量" width="180">
                 <template #default="scope">
                     <el-input-number @change="inputNumberChange('quantity', productTable[scope.$index])"
-                        v-model="productTable[scope.$index].quantity" class="mx-4" :min="0" :max="100000000"
+                        v-model="productTable[scope.$index].quantity" class="mx-4" :min="0" :max="scope.row.inventory"
                         controls-position="right" v-if="productTableIndex == scope.$index" />
                     <span v-else>{{ productTable[scope.$index].quantity }}</span>
                 </template>

+ 4 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/detail/index.vue

@@ -44,8 +44,11 @@
       </div>
       <div class="bg-[#075985] rounded-md text itemPing pl-2 pr-2 flex items-center aloneText"
         v-if="currentStage != -1">
-        <el-link :underline="false" v-if="(currentStage + 1) != stageList.length"
+        <!-- <el-link :underline="false" v-if="(currentStage + 1) != stageList.length"
           @click="advancementStage(false)">推进至下个阶段【{{ stageList[currentStage +
+            1]?.name }}】</el-link> -->
+        <el-link :underline="false" v-if="(currentStage + 1) != stageList.length"
+          @click="advancementStageNext(false)">推进至下个阶段【{{ stageList[currentStage +
             1]?.name }}】</el-link>
         <el-link :underline="false" v-else class="ml-4 mr-4" @click="advancementStage(true)">赢单</el-link>
       </div>

+ 4 - 4
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/index.vue

@@ -52,9 +52,9 @@
             @click="editNewBusiness(false)">新建商机</el-button>
           <el-button type="primary" @click="showVisible('batchTransferVisible')"
             :disabled="batchTableData.length <= 0">批量转移</el-button>
-          <el-button type="primary" @click="batchDeteleItem()" :disabled="batchTableData.length <= 0">批量删除</el-button>
+          <el-button type="primary" v-permission="['businessDelete']" @click="batchDeteleItem()" :disabled="batchTableData.length <= 0">批量删除</el-button>
           <el-button type="primary" @click="showVisible('stageSetVisible')">阶段设置</el-button>
-          <el-button type="primary" @click="showVisible('deteleBusinessVisible')">回收站</el-button>
+          <el-button type="primary" v-permission="['businessRecycle']" @click="showVisible('deteleBusinessVisible')">回收站</el-button>
           <el-button v-permission="['businessImport']" type="primary"
             @click="showVisible('importVisible')">导入</el-button>
           <el-button v-permission="['businessExport']" type="primary" @click="exportBusinessTableList()"
@@ -72,14 +72,14 @@
                 <template v-else>{{ scope.row[item.prop] }}</template>
               </template>
             </el-table-column>
-            <el-table-column label="操作" fixed="right" width="200">
+            <el-table-column label="操作" fixed="right" width="200" v-permission="['businessAddAnEdit', 'tasksAdd', 'businessDelete']">
               <template #default="scope">
                 <el-button link type="primary" size="large" @click="editNewBusiness(scope.row)"
                   v-permission="['businessAddAnEdit']">编辑</el-button>
                 <el-button link type="primary" size="large" @click="newTask(scope.row)"
                   v-permission="['tasksAdd']">新建任务</el-button>
                 <el-button link type="danger" size="large" @click="businessDeteleItem(scope.row.id, scope.row.name)"
-                  v-permission="['businessAddAnEdit']">删除</el-button>
+                  v-permission="['businessDelete']">删除</el-button>
               </template>
             </el-table-column>
           </el-table>

+ 3 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/component/information.vue

@@ -159,14 +159,14 @@ function closeVisible(type: keyof typeof allVisible) {
 }
 
 const formItems = reactive([
-    { label: '联系人', key: 'contactsName', value: '', labelClass: 'w-20 text-right text-gray-500', width: '48%' },
-    { label: '客户', key: 'productName', value: '', labelClass: 'w-22 text-right text-gray-500', width: '48%' },
+    { label: '联系人', key: 'name', value: '', labelClass: 'w-20 text-right text-gray-500', width: '48%' },
+    { label: '客户', key: 'customName', value: '', labelClass: 'w-22 text-right text-gray-500', width: '48%' },
     { label: '电话', key: 'phone', value: '', labelClass: 'w-22 text-right text-gray-500', width: '48%' },
     { label: '邮箱', key: 'email', value: '', labelClass: 'w-22 text-right text-gray-500', width: '48%' },
     { label: '职务', key: 'position', value: '', labelClass: 'w-22 text-right text-gray-500', width: '48%' },
     { label: '性别', key: 'sexValue', value: '', labelClass: 'w-22 text-right text-gray-500', width: '48%' },
     { label: '地址', key: 'address', value: '', labelClass: 'w-22 text-right text-gray-500', width: '48%' },
-    { label: '负责人', key: 'inchargerName', value: '', labelClass: 'w-22 text-right text-gray-500', width: '48%' },
+    { label: '负责人', key: 'ownerName', value: '', labelClass: 'w-22 text-right text-gray-500', width: '48%' },
     { label: '创建人', key: 'creatorName', value: '', labelClass: 'w-22 text-right text-gray-500', width: '48%' },
     { label: '创建时间', key: 'createTime', value: '', labelClass: 'w-22 text-right text-gray-500', width: '48%' },
     { label: '备注', key: 'remark', value: '', labelClass: 'w-22 text-right text-gray-500', width: '100%' },

+ 4 - 4
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/index.vue

@@ -27,8 +27,8 @@
           <!-- 操作按钮 -->
           <!-- <el-button v-for="(button, index) in actionButtons" :key="index" type="primary">{{ button.text }}</el-button> -->
           <el-button type="primary" v-permission="['contactsAdd']" @click="editContacts(false)">新建联系人</el-button>
-          <el-button type="primary" @click="batchDeteleItem" :disabled="batchTableData.length <= 0">批量删除</el-button>
-          <el-button type="primary" @click="showVisible('deteleContactsVisible')">回收站</el-button>
+          <el-button type="primary" v-permission="['contactsDelete']" @click="batchDeteleItem" :disabled="batchTableData.length <= 0">批量删除</el-button>
+          <el-button type="primary" v-permission="['contactsRecycle']" @click="showVisible('deteleContactsVisible')">回收站</el-button>
           <el-button type="primary" v-permission="['contactsImport']" @click="showVisible('importVisible')">导入</el-button>
           <el-button type="primary" v-permission="['contactsExport']" @click="exportCustomerTableList()" :loading="allLoading.exoprtLoading">导出</el-button>
         </div>
@@ -49,11 +49,11 @@
                 </template>
               </template>
             </el-table-column>
-            <el-table-column :label="'操作'" :width="'200px'" fixed="right" v-permission="['contactsEdit', 'tasksAdd']">
+            <el-table-column :label="'操作'" :width="'200px'" fixed="right" v-permission="['contactsEdit', 'tasksAdd', 'contactsDelete']">
               <template #default="scope">
                 <el-button link type="primary" size="large" v-permission="['contactsEdit']" @click="editContacts(scope.row)">编辑</el-button>
                 <el-button link type="primary" size="large" v-permission="['tasksAdd']" @click="newTask(scope.row)">新建任务</el-button>
-                <el-button link type="danger" size="large" v-permission="['contactsEdit']"
+                <el-button link type="danger" size="large" v-permission="['contactsDelete']"
                   @click="contactsDeteleItem(scope.row.id, scope.row.customName)">删除</el-button>
               </template>
             </el-table-column>

+ 8 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedOrders.vue

@@ -97,15 +97,20 @@ function saveOrder(flag: boolean) {
                 productTableListData[i].num = productTableListData[i].quantity
         }
         const produt = productTableListData ? JSON.stringify(productTableListData) : []
-        allLoading.editSaveLading = true
-        post(URL_OEDERUPDATE, {
+        const formVal = {
             ...orderTemplateValue.value,
             ...res,
             orderEndDate: res.orderEndDate ? formatDate(res.orderEndDate) : '',
             orderStartDate: res.orderStartDate ? formatDate(res.orderStartDate) : '',
             placeTime: res.placeTime ? formatDate(res.placeTime) : '',
             orderProductDetailString: produt
-        }).then((_res) => {
+        }
+        if((formVal.price || 0) < (formVal.receivedPayment || 0)) {
+            globalPopup?.showError('已回款金额不能大于订单金额')
+            return
+        }
+        allLoading.editSaveLading = true
+        post(URL_OEDERUPDATE, formVal).then((_res) => {
             allVisible.editOrderVisible = flag
             globalPopup?.showSuccess('操作成功')
             if (flag) {

+ 4 - 4
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/index.vue

@@ -56,8 +56,8 @@
           <el-button type="primary" v-permission="['customerAdd']" @click="editCustomer(false)">新建客户</el-button>
           <el-button type="primary" @click="showVisible('batchTransferVisible')"
             :disabled="batchTableData.length <= 0">批量转移</el-button>
-          <el-button type="primary" @click="batchDeteleItem()" :disabled="batchTableData.length <= 0">批量删除</el-button>
-          <el-button type="primary" @click="showVisible('deteleCustomerVisible')">回收站</el-button>
+          <el-button type="primary" v-permission="['customerDelete']" @click="batchDeteleItem()" :disabled="batchTableData.length <= 0">批量删除</el-button>
+          <el-button type="primary" v-permission="['customerRecycle']" @click="showVisible('deteleCustomerVisible')">回收站</el-button>
           <el-button type="primary" v-permission="['customerImport']" @click="showVisible('importVisible')">导入</el-button>
           <el-button type="primary" v-permission="['customerExport']" @click="exportCustomerTableList()"
             :loading="allLoading.exoprtLoading">导出</el-button>
@@ -82,11 +82,11 @@
             <el-table-column prop="inchargerName" label="负责人" width="190"></el-table-column>
             <el-table-column prop="creatorName" label="创建人" width="180"></el-table-column>
             <el-table-column prop="newCreateTime" label="创建时间" width="180"></el-table-column>
-            <el-table-column label="操作" fixed="right" width="200" v-permission="['customerEdit', 'tasksAdd', 'customerEdit']">
+            <el-table-column label="操作" fixed="right" width="200" v-permission="['customerEdit', 'tasksAdd', 'customerDelete']">
               <template #default="scope">
                 <el-button link type="primary" size="large" v-permission="['customerEdit']" @click="editCustomer(scope.row)">编辑</el-button>
                 <el-button link type="primary" size="large" v-permission="['tasksAdd']" @click="newTask(scope.row)">新建任务</el-button>
-                <el-button link type="danger" size="large" v-permission="['customerEdit']"
+                <el-button link type="danger" size="large" v-permission="['customerDelete']"
                   @click="customerDeteleItem(scope.row.id, scope.row.customName)">删除</el-button>
               </template>
             </el-table-column>

+ 8 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/order/component/information.vue

@@ -97,15 +97,20 @@ const productTableListValue = ref([])
 
 function editOrderSave() {
     orderTemplateRef.value?.getData().then((res: any) => {
-        allLoading.editOrderSaveLoading = true
-        post(URL_OEDERUPDATE, {
+        const formVal = {
             ...orderTemplateValue.value,
             ...res,
             orderEndDate: res.orderEndDate ? formatDate(res.orderEndDate) : '',
             orderStartDate: res.orderStartDate ? formatDate(res.orderStartDate) : '',
             placeTime: res.placeTime ? formatDate(res.placeTime) : '',
             orderProductDetailString: JSON.stringify(productTableListValue.value || [])
-        }).then((_res) => {
+        }
+        if((formVal.price || 0) < (formVal.receivedPayment || 0)) {
+            globalPopup?.showError('已回款金额不能大于订单金额')
+            return
+        }
+        allLoading.editOrderSaveLoading = true
+        post(URL_OEDERUPDATE, formVal).then((_res) => {
             closeVisible('editOrderVisible')
             globalPopup?.showSuccess('操作成功')
             emits('refreshData', 'getDetail')

+ 11 - 5
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/order/component/products.vue

@@ -88,18 +88,24 @@ function saveOrder() {
     const items: any = infoValue.value
     for (var i in productTableListData) {
         productTableListData[i].sealPrice = productTableListData[i].sellingPrice,
-            productTableListData[i].discount = productTableListData[i].discount,
-            productTableListData[i].num = productTableListData[i].quantity
+        productTableListData[i].discount = productTableListData[i].discount,
+        productTableListData[i].num = productTableListData[i].quantity
     }
     const produt = productTableListData ? JSON.stringify(productTableListData) : []
-    allLoading.editSaveLading = true
-    post(URL_OEDERUPDATE, {
+    const formVal = {
         ...items,
         orderEndDate: items.orderEndDate ? items.orderEndDate : '',
         orderStartDate: items.orderStartDate ? items.orderStartDate : '',
         placeTime: items.placeTime ? formatDate(items.placeTime) : '',
         orderProductDetailString: produt
-    }).then(() => {
+    }
+    if((formVal.price || 0) < (formVal.receivedPayment || 0)) {
+      globalPopup?.showError('已回款金额不能大于订单金额')
+      return
+    }
+    allLoading.editSaveLading = true
+    console.log(formVal, '<==== 将要传的值')
+    post(URL_OEDERUPDATE, formVal).then(() => {
         globalPopup?.showSuccess('操作成功')
         allLoading.editSaveLading = false
         closeVisible('editOrderVisible')

+ 5 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/order/component/rebate.vue

@@ -71,6 +71,7 @@ const operationRecordtable = ref([])
 const mony = ref('')
 const monyItem = ref<any>({})
 const info = ref<any>({})
+const theRebate = ref<number>(0)
 
 function deteItem(item: any) {
     confirmAction(`确定删除该回款记录吗?`).then(() => {
@@ -84,11 +85,13 @@ function deteItem(item: any) {
 }
 
 function editRebate(item: any) {
+    console.log(theRebate.value)
     if (!item) {
         allText.rebateText = '新增回款'
         mony.value = ''
         monyItem.value = {}
     } else {
+        theRebate.value = theRebate.value + Number(item.money)
         monyItem.value = item
         mony.value = item.money
         allText.rebateText = '编辑回款'
@@ -102,7 +105,7 @@ function saveRebate() {
         globalPopup?.showWarning(Number(mony.value as string) < 0 ? '请不要输入负数' : '请输入金额')
         return
     }
-    if(Number(mony.value as string) > info.value.unReceivedPayment) {
+    if(Number(mony.value as string) > theRebate.value) {
         globalPopup?.showWarning('回款金额超过了未回款金额')
         return
     }
@@ -123,6 +126,7 @@ watchEffect(() => {
     const { data, information } = props
     operationRecordtable.value = data || []
     info.value = information
+    theRebate.value = Number(information.unReceivedPayment || 0)
 });
 // 生命周期钩子
 onMounted(() => {

+ 13 - 8
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/order/index.vue

@@ -38,8 +38,8 @@
           <!-- 操作按钮 -->
           <el-button type="primary" v-permission="['orderAdd']" @click="editOrder(false)">新建订单</el-button>
           <el-button type="primary" :disabled="batchTableData.length <= 0">批量转移</el-button>
-          <el-button type="primary" @click="batchDeteleItem()" :disabled="batchTableData.length <= 0">批量删除</el-button>
-          <el-button type="primary" @click="showVisible('deteleOrderVisible')">回收站</el-button>
+          <el-button type="primary" v-permission="['orderDelete']" @click="batchDeteleItem()" :disabled="batchTableData.length <= 0">批量删除</el-button>
+          <el-button type="primary" v-permission="['orderRecycle']" @click="showVisible('deteleOrderVisible')">回收站</el-button>
           <el-button type="primary" v-permission="['orderImport']" @click="showVisible('importVisible')">导入</el-button>
           <el-button type="primary" v-permission="['orderExport']" @click="exportOrderTableList()" :loading="allLoading.exoprtLoading">导出</el-button>
         </div>
@@ -62,7 +62,7 @@
               <template #default="scope">
                 <el-button link type="primary" size="large" @click="editOrder(scope.row)">编辑</el-button>
                 <el-button link type="primary" size="large" v-permission="['tasksEdit']" @click="newTask(scope.row)">新建任务</el-button>
-                <el-button link type="danger" size="large"
+                <el-button link type="danger" size="large" v-permission="['orderDelete']"
                   @click="orderDeteleItem(scope.row.id, scope.row.orderName)">删除</el-button>
               </template>
             </el-table-column>
@@ -196,7 +196,7 @@ const filterItems = ref<FilterItem[]>([
   { label: '订单编号', key: 'orderCode', type: 'input' },
   { label: '订单名称', key: 'orderName', type: 'input' },
   { label: '客户名称', key: 'customId', type: 'select', options: selectData.Customer },
-  { label: '商机名称', key: 'businessOpportunityId', type: 'input' },
+  { label: '商机名称', key: 'businessName', type: 'input' },
   { label: '订单类型', key: 'ordertype', type: 'select', options: selectData.OrderType },
   { label: '回款状态', key: 'receivedStatus', type: 'select', options: selectData.RemittanceStatus },
   { label: '负责人', key: 'inchargerId', type: 'select', options: selectData.Personnel },
@@ -291,15 +291,20 @@ function saveOrder(flag: boolean) {
         productTableListData[i].num = productTableListData[i].quantity
     }
     const produt = productTableListData ? JSON.stringify(productTableListData) : []
-    allLoading.editSaveLading = true
-    post(URL_OEDERUPDATE, {
+    const formVal = {
       ...orderTemplateValue.value,
       ...res,
       orderEndDate: res.orderEndDate ? formatDate(res.orderEndDate) : '',
       orderStartDate: res.orderStartDate ? formatDate(res.orderStartDate) : '',
       placeTime: res.placeTime ? formatDate(res.placeTime) : '',
       orderProductDetailString: produt
-    }).then((_res) => {
+    }
+    if((formVal.price || 0) < (formVal.receivedPayment || 0)) {
+      globalPopup?.showError('已回款金额不能大于订单金额')
+      return
+    }
+    allLoading.editSaveLading = true
+    post(URL_OEDERUPDATE, formVal).then((_res) => {
       allVisible.editOrderVisible = flag
       globalPopup?.showSuccess('保存成功')
       if (flag) {
@@ -430,7 +435,7 @@ function setFilterItems() {
     { label: '订单编号', key: 'orderCode', type: 'input' },
     { label: '订单名称', key: 'orderName', type: 'input' },
     { label: '客户名称', key: 'customId', type: 'select', options: selectData.Customer },
-    { label: '商机名称', key: 'businessOpportunityId', type: 'input' },
+    { label: '商机名称', key: 'businessName', type: 'input' },
     { label: '订单类型', key: 'ordertype', type: 'select', options: selectData.OrderType },
     { label: '回款状态', key: 'receivedStatus', type: 'select', options: selectData.RemittanceStatus },
     { label: '负责人', key: 'inchargerId', type: 'select', options: selectData.Personnel },

+ 4 - 4
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/index.vue

@@ -45,8 +45,8 @@
       <div class="bg-white w-full h-full p-3 shadow-md rounded-md flex flex-col">
         <div class="flex justify-end pb-3">
           <el-button type="primary" v-permission="['productAdd']" @click="editProduct(false)">新建产品</el-button>
-          <el-button type="primary" @click="batchDelete()">批量删除</el-button>
-          <el-button type="primary" @click="showDeteleProduct(true)">回收站</el-button>
+          <el-button type="primary" v-permission="['productDelete']" @click="batchDelete()">批量删除</el-button>
+          <el-button type="primary" v-permission="['productRecycle']" @click="showDeteleProduct(true)">回收站</el-button>
           <el-button type="primary" v-permission="['productImport']" @click="dialogVisible.importVisible = true">导入</el-button>
           <el-button type="primary" v-permission="['productExport']" @click="exportProductTableList()" :loading="allLoading.exoprtLoading">导出</el-button>
         </div>
@@ -75,10 +75,10 @@
             <el-table-column prop="inchargerName" label="负责人" width="190"></el-table-column>
             <el-table-column prop="creatorName" label="创建人" width="180"></el-table-column>
             <el-table-column prop="createTime" label="创建时间" width="180"></el-table-column>
-            <el-table-column label="操作" fixed="right" width="200" v-permission="['productEdit']">
+            <el-table-column label="操作" fixed="right" width="200" v-permission="['productEdit', 'productDelete']">
               <template #default="scope">
                 <el-button link type="primary" size="large" @click.stop="editProduct(scope.row)">编辑</el-button>
-                <el-button link type="danger" size="large" @click.stop="deteleRow([scope.row])">删除</el-button>
+                <el-button link type="danger" v-permission="['productDelete']" size="large" @click.stop="deteleRow([scope.row])">删除</el-button>
               </template>
             </el-table-column>
           </el-table>

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

@@ -53,7 +53,7 @@
       <div class="bg-white w-full h-full p-3 shadow-md rounded-md flex flex-col">
         <div class="ml-auto p-3">
           <el-button type="primary" v-permission="['tasksAdd']" @click="createTasks()">创建任务</el-Button>
-          <el-button type="primary" :disabled="len == 0" :loading="btnLoading" @click="deleteTasks()">批量删除</el-Button>
+          <el-button type="primary" v-permission="['tasksDelete']" :disabled="len == 0" :loading="btnLoading" @click="deleteTasks()">批量删除</el-Button>
           <el-button type="primary" v-permission="['tasksImport']" @click="openImportModal()">导入</el-Button>
           <!-- <el-button type="primary" :loading="btnLoading" @click="exportTasks()">导出</el-Button> -->
           <el-button type="primary" v-permission="['tasksExport']" :loading="btnLoading" @click="newExportTasks()">导出</el-Button>
@@ -133,7 +133,7 @@
                   完成
                 </el-button>
 
-                <el-button link type="danger" @click.prevent="deleteRow(scope.row)">
+                <el-button link type="danger" v-permission="['tasksDelete']" @click.prevent="deleteRow(scope.row)">
                   删除
                 </el-button>
               </template>

+ 4 - 4
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/thread/index.vue

@@ -54,8 +54,8 @@
         <div class="flex justify-end pb-3">
           <el-button type="primary" v-permission="['threadAdd']" @click="editClue(false)">新建线索</el-button>
           <el-button type="primary" :disabled="batchTableData.length <= 0" @click="batchTransfer()">批量转移</el-button>
-          <el-button type="primary" :disabled="batchTableData.length <= 0" @click="batchDeletes()">批量删除</el-button>
-          <el-button type="primary" @click="showDeteleClue(true)">回收站</el-button>
+          <el-button type="primary" v-permission="['threadDelete']" :disabled="batchTableData.length <= 0" @click="batchDeletes()">批量删除</el-button>
+          <el-button type="primary" v-permission="['threadRecycle']" @click="showDeteleClue(true)">回收站</el-button>
           <el-button type="primary" v-permission="['threadImport']" @click="dialogVisible.importVisible = true">导入</el-button>
           <el-button type="primary" v-permission="['threadExport']" @click="exportTheadTableList()" :loading="allLoading.exoprtLoading">导出</el-button>
         </div>
@@ -76,13 +76,13 @@
             <el-table-column prop="inchargerName" label="负责人" width="190"></el-table-column>
             <el-table-column prop="createName" label="创建人" width="180"></el-table-column>
             <el-table-column prop="createTime" label="创建时间" width="180"></el-table-column>
-            <el-table-column label="操作" fixed="right" width="200">
+            <el-table-column label="操作" fixed="right" width="200" v-permission="['threadEdit', 'tasksAdd', 'threadDelete']">
               <template #default="scope">
                 <el-button link type="primary" size="large" @click="editClue(scope.row)" v-permission="['threadEdit']">编辑</el-button>
                 <!-- <el-button link type="primary" size="large"
                   @click="dialogVisible.taskModalVisible = true">新建任务</el-button> -->
                 <el-button link type="primary" size="large" @click="newTask(scope.row)" v-permission="['tasksAdd']">新建任务</el-button>
-                <el-button link type="danger" size="large" @click.prevent="deleteRow(scope.row)" v-permission="['threadEdit']">删除</el-button>
+                <el-button link type="danger" size="large" @click.prevent="deleteRow(scope.row)" v-permission="['threadDelete']">删除</el-button>
               </template>
             </el-table-column>
           </el-table>

+ 260 - 213
fhKeeper/formulahousekeeper/timesheet/src/views/centerManage/centerManage.vue

@@ -1,180 +1,222 @@
 <template>
-    <section >
+    <section>
+        <el-select v-model="value" filterable placeholder="请选择" :filter-method="aabbcc()">
+            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+            </el-option>
+        </el-select>
         <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
             <el-form :inline="true">
                 <el-form-item :label="user.timeType.customDegreeName + $t('guan-li')">
-                    <el-input placeholder="请输入关键名称" v-model.trim="searchNameVal" clearable class="input-with-select" style="margin-left: 50px" @keyup.enter.native="searchName()">
+                    <el-input placeholder="请输入关键名称" v-model.trim="searchNameVal" clearable class="input-with-select"
+                        style="margin-left: 50px" @keyup.enter.native="searchName()">
                         <el-button slot="append" @click="searchName()">搜索</el-button>
                     </el-input>
                 </el-form-item>
-                
+
                 <!-- <el-link type="primary" :underline="false" @click="intoCenterRatio" class="tanjia">批量导入{{user.timeType.customDegreeName}}</el-link>
                 <el-link icon="el-icon-circle-plus-outline" type="primary" :underline="false" class="tanjia" @click="addNewSubProject()">添加{{user.timeType.customDegreeName}}</el-link>
                 <el-link type="primary" :underline="false" @click="batchDelete" class="tanjia">批量删除{{user.timeType.customDegreeName}}</el-link> -->
-                <el-link type="primary" :underline="false" @click="batchDelete" class="tanjia">{{ $t('Batchdelete') }}</el-link>
-                <el-link type="primary" :underline="false" @click="outoCenterRatio" class="tanjia">{{ $t('Exportdata') }}</el-link>
-                <el-link type="primary" :underline="false" @click="intoCenterRatio" class="tanjia">{{ $t('bulkimport') }}</el-link>
-                <el-link icon="el-icon-circle-plus-outline" type="primary" :underline="false" class="tanjia" @click="addNewSubProject()">{{ $t('add') }}</el-link>
+                <el-link type="primary" :underline="false" @click="batchDelete" class="tanjia">{{ $t('Batchdelete')
+                }}</el-link>
+                <el-link type="primary" :underline="false" @click="outoCenterRatio" class="tanjia">{{ $t('Exportdata')
+                }}</el-link>
+                <el-link type="primary" :underline="false" @click="intoCenterRatio" class="tanjia">{{ $t('bulkimport')
+                }}</el-link>
+                <el-link icon="el-icon-circle-plus-outline" type="primary" :underline="false" class="tanjia"
+                    @click="addNewSubProject()">{{ $t('add') }}</el-link>
 
             </el-form>
         </el-col>
-        <el-table :data="subProjectList" highlight-current-row v-loading="listLoading" :height="heightDoms" style="width: 100%;" @selection-change="selectionChange">
+        <el-table :data="subProjectList" highlight-current-row v-loading="listLoading" :height="heightDoms"
+            style="width: 100%;" @selection-change="selectionChange">
             <el-table-column type="selection"></el-table-column>
             <el-table-column prop="id" width="200" :label="$t('headerTop.serialNumber')" align="center">
-                <template slot-scope="scope" >
-                    {{scope.$index + 1}}
+                <template slot-scope="scope">
+                    {{ scope.$index + 1 }}
                 </template>
             </el-table-column>
             <el-table-column prop="name" :label="$t('names')" width="160" show-overflow-tooltip></el-table-column>
             <el-table-column prop="projectNum" :label="$t('numberofrelatedprojects')" width="160">
-                <template slot-scope="scope">{{scope.row.projectNum +  $t('ge')}}</template>
+                <template slot-scope="scope">{{ scope.row.projectNum + $t('ge') }}</template>
             </el-table-column>
-            <el-table-column prop="projects" :label="$t('relatedprojects')" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="projects" :label="$t('relatedprojects')" min-width="180"
+                show-overflow-tooltip></el-table-column>
             <el-table-column prop="rmark" :label="$t('bei-zhu')" min-width="180" show-overflow-tooltip></el-table-column>
             <el-table-column :label="$t('operation')" width="170">
-                <template slot-scope="scope" >
-                    <el-button size="small" type="primary" @click="addNewSubProject(scope.row)">{{ $t('bian-ji') }}</el-button>
-                    <el-button size="small" type="danger" @click="deleteSubPro(scope.row)">{{ $t('btn.delete') }}</el-button>
+                <template slot-scope="scope">
+                    <el-button size="small" type="primary" @click="addNewSubProject(scope.row)">{{ $t('bian-ji')
+                    }}</el-button>
+                    <el-button size="small" type="danger" @click="deleteSubPro(scope.row)">{{ $t('btn.delete')
+                    }}</el-button>
                 </template>
             </el-table-column>
         </el-table>
-        <el-dialog :title="$t('addedormodifiedthemaintenancedata')" v-if="addSubProject" :visible.sync="addSubProject" :close-on-click-modal="false" customClass="customWidth" width="600px">
+        <el-dialog :title="$t('addedormodifiedthemaintenancedata')" v-if="addSubProject" :visible.sync="addSubProject"
+            :close-on-click-modal="false" customClass="customWidth" width="600px">
             <el-form ref="form2" :model="addfm" :rules="ruless" label-width="100px">
                 <el-form-item :label="$t('names')" prop="name">
                     <el-input v-model="addfm.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
                 </el-form-item>
                 <el-form-item :label="$t('bei-zhu')">
-                    <el-input type="textarea" :rows="4" :placeholder="$t('peaseenterthe')" v-model="addfm.rmark" clearable  maxlength="150" show-word-limit> </el-input>
+                    <el-input type="textarea" :rows="4" :placeholder="$t('peaseenterthe')" v-model="addfm.rmark" clearable
+                        maxlength="150" show-word-limit> </el-input>
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
                 <el-button @click.native="addSubProject = false">{{ $t('btn.cancel') }}</el-button>
-                <el-button type="primary" @click="submitInsertSubProject" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
+                <el-button type="primary" @click="submitInsertSubProject" :loading="addLoading">{{ $t('btn.submit')
+                }}</el-button>
             </div>
         </el-dialog>
         <!-- 导入结果说明 -->
-        <el-dialog :title="$t('importtheresults')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
+        <el-dialog :title="$t('importtheresults')" v-if="showImportResult" :visible.sync="showImportResult"
+            customClass="customWidth" width="500px">
             <div>
-                <span>{{importResultMsg}}</span>
-                
+                <span>{{ importResultMsg }}</span>
+
             </div>
             <span slot="footer" class="dialog-footer">
-                <el-button type="primary" @click="showImportResult=false">{{ $t('btn.determine') }}</el-button>
-            </span> 
+                <el-button type="primary" @click="showImportResult = false">{{ $t('btn.determine') }}</el-button>
+            </span>
         </el-dialog>
         <!-- <span>{{ $t('importTemplate') }}</span> -->
-        <el-dialog :title="$t('dao-ru') + user.timeType.customDegreeName + $t('shu-ju')" v-if="intoCenterDialog" :visible.sync="intoCenterDialog" customClass="customWidth" width="500px">
+        <el-dialog :title="$t('dao-ru') + user.timeType.customDegreeName + $t('shu-ju')" v-if="intoCenterDialog"
+            :visible.sync="intoCenterDialog" customClass="customWidth" width="500px">
             <p>1. {{ $t('other.download') }}
-            <el-link type="primary" style="margin-left:5px;" :underline="false" href="./upload/研究中心导入模板.xlsx" :download="user.timeType.customDegreeName+ $t('importTemplate') +'.xlsx'">{{user.timeType.customDegreeName + $t('importTemplate')}}.xlsx</el-link>
+                <el-link type="primary" style="margin-left:5px;" :underline="false" href="./upload/研究中心导入模板.xlsx"
+                    :download="user.timeType.customDegreeName + $t('importTemplate') + '.xlsx'">{{
+                        user.timeType.customDegreeName
+                        + $t('importTemplate') }}.xlsx</el-link>
             </p>
             <!-- <p>2. 填写excel模板,请确保模板中的项目和人员已添加到系统中。</p> -->
             <p style="display: flex;justify-content: center;padding:1em 0">
-                <el-upload ref="upload"  action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
-                <el-button type="primary" :underline="false" :loading="importingData">{{ $t('other.startImporting') }}</el-button>
-            </el-upload>
+                <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
+                    <el-button type="primary" :underline="false" :loading="importingData">{{ $t('other.startImporting')
+                    }}</el-button>
+                </el-upload>
             </p>
         </el-dialog>
     </section>
 </template>
 <script>
-    export default {
-        data() {
-            return {
-                user: JSON.parse(sessionStorage.getItem("user")),
-                listLoading: false,
-                addfm: {
-                    name: '',
-                    rmark: ''
-                },
-                addSubProject: false,
-                ruless: {
-                    name: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
-                },
-                heightDoms: document.documentElement.clientHeight - 140,
-                intoCenterDialog:false,
-                importingData: false,
-                importResultMsg:null,
-                showImportResult:false,
-                selectionArr: [],
-                subProjectList: [],//子项目列表
-                subProjectListArr: [], // 备用列表
-                searchNameVal: ''
-            };
-        },
-        methods: {
-            searchName() {
-                var val = this.searchNameVal
-                let arr = []
-                if(val) {
-                    arr =  this.subProjectListArr.filter((num)=>{
-                        if(num.name.indexOf(val) != '-1') {
-                            return num
-                        }
-                    })
-                    this.subProjectList = arr
-                } else {
-                    this.subProjectList = this.subProjectListArr
-                }
-                
+export default {
+    data() {
+        return {
+            user: JSON.parse(sessionStorage.getItem("user")),
+            listLoading: false,
+            addfm: {
+                name: '',
+                rmark: ''
             },
-            // 批量删除
-            selectionChange(selection){
-                this.selectionArr = selection
-                console.log(this.selectionArr);
+            addSubProject: false,
+            ruless: {
+                name: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
             },
-            batchDelete(){
-                if(this.selectionArr.length == 0){
-                    this.$message(this.$t('pleaseselectheonesyouwanttodelete') + this.user.timeType.customDegreeName + this.$t('shu-ju'))
-                    return
-                }else{
-                    let nametext = ''
-                    for(let i in this.selectionArr){
-                        nametext += this.selectionArr[i].name + '、'
+            heightDoms: document.documentElement.clientHeight - 140,
+            intoCenterDialog: false,
+            importingData: false,
+            importResultMsg: null,
+            showImportResult: false,
+            selectionArr: [],
+            subProjectList: [],//子项目列表
+            subProjectListArr: [], // 备用列表
+            searchNameVal: '',
+            options: [{
+                value: '选项1',
+                label: '黄金糕'
+            }, {
+                value: '选项2',
+                label: '双皮奶'
+            }, {
+                value: '选项3',
+                label: '蚵仔煎'
+            }, {
+                value: '选项4',
+                label: '龙须面'
+            }, {
+                value: '选项5',
+                label: '北京烤鸭'
+            }],
+            value: ''
+        };
+    },
+    methods: {
+        aabbcc() {
+            console.log(12345)
+        },  
+        searchName() {
+            var val = this.searchNameVal
+            let arr = []
+            if (val) {
+                arr = this.subProjectListArr.filter((num) => {
+                    if (num.name.indexOf(val) != '-1') {
+                        return num
                     }
-                    nametext = nametext.substring(0,nametext.length - 1)
-                    this.$confirm(this.$t('makesuretodeleteinbatches') + this.user.timeType.customDegreeName + this.$t('shu-ju') +':' + nametext + '\u3000' + $t('ma'),this.$t('btn.delete'),{
-                        confirmButtonText: this.$t('btn.determine'),
-                        cancelButtonText: this.$t('btn.cancel'),
-                        type: 'warning'
-                    }).then(()=>{
-                        let batchIds = ''
-                        for(let m in this.selectionArr){
-                            batchIds += this.selectionArr[m].id + ','
-                        }
-                        batchIds = batchIds.substring(0,batchIds.length - 1)
-                        this.http.post('/report-extra-degree/batchDelete',{
-                            batchIds
-                        },res => {
-                            if(res.code == 'ok'){
-                                this.$message({
-                                    message: this.$t('message.successfullyDeleted'),
-                                    type: 'success'
-                                })
-                                this.getSub()
-                            }else {
-                                this.$message({
-                                    message: res.msg,
-                                    type: 'error'
-                                })
-                            }
-                        },err => {
+                })
+                this.subProjectList = arr
+            } else {
+                this.subProjectList = this.subProjectListArr
+            }
+
+        },
+        // 批量删除
+        selectionChange(selection) {
+            this.selectionArr = selection
+            console.log(this.selectionArr);
+        },
+        batchDelete() {
+            if (this.selectionArr.length == 0) {
+                this.$message(this.$t('pleaseselectheonesyouwanttodelete') + this.user.timeType.customDegreeName + this.$t('shu-ju'))
+                return
+            } else {
+                let nametext = ''
+                for (let i in this.selectionArr) {
+                    nametext += this.selectionArr[i].name + '、'
+                }
+                nametext = nametext.substring(0, nametext.length - 1)
+                this.$confirm(this.$t('makesuretodeleteinbatches') + this.user.timeType.customDegreeName + this.$t('shu-ju') + ':' + nametext + '\u3000' + $t('ma'), this.$t('btn.delete'), {
+                    confirmButtonText: this.$t('btn.determine'),
+                    cancelButtonText: this.$t('btn.cancel'),
+                    type: 'warning'
+                }).then(() => {
+                    let batchIds = ''
+                    for (let m in this.selectionArr) {
+                        batchIds += this.selectionArr[m].id + ','
+                    }
+                    batchIds = batchIds.substring(0, batchIds.length - 1)
+                    this.http.post('/report-extra-degree/batchDelete', {
+                        batchIds
+                    }, res => {
+                        if (res.code == 'ok') {
                             this.$message({
-                                message: err,
+                                message: this.$t('message.successfullyDeleted'),
+                                type: 'success'
+                            })
+                            this.getSub()
+                        } else {
+                            this.$message({
+                                message: res.msg,
                                 type: 'error'
                             })
+                        }
+                    }, err => {
+                        this.$message({
+                            message: err,
+                            type: 'error'
                         })
                     })
-                }
-            },
+                })
+            }
+        },
 
 
-            intoCenterRatio(){
-                this.intoCenterDialog=true;
-            },
-            outoCenterRatio(){
-                this.http.post('/report-extra-degree/exportData',{},
+        intoCenterRatio() {
+            this.intoCenterDialog = true;
+        },
+        outoCenterRatio() {
+            this.http.post('/report-extra-degree/exportData', {},
                 res => {
-                    if(res.code == 'ok'){
+                    if (res.code == 'ok') {
                         let filePath = res.data;
                         let fileName = filePath.split('/upload/')[1]
                         const a = document.createElement('a'); // 创建a标签
@@ -182,43 +224,43 @@
                         a.setAttribute('href', filePath);// href链接
                         a.click(); //自执行点击事件
                         a.remove();
-                    }else{
+                    } else {
                         this.$message({
                             message: res.msg,
                             type: 'error'
                         })
                     }
-                },err => {
+                }, err => {
                     this.$message({
                         message: err,
                         type: 'error'
                     })
                 })
-            },
-            batchImportData(item) {
-                //首先判断文件类型
-                let str = item.file.name.split(".");
-                let format = str[str.length - 1];
-                if (format != "xls" && format != "xlsx") {
-                    this.$message({
-                        message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
-                        type: "error"
-                    });
-                } else {
-                    this.importingData = true;
-                    let formData = new FormData();
-                    formData.append("file", item.file);  
-                    this.http.uploadFile('/report-extra-degree/importData', formData,
+        },
+        batchImportData(item) {
+            //首先判断文件类型
+            let str = item.file.name.split(".");
+            let format = str[str.length - 1];
+            if (format != "xls" && format != "xlsx") {
+                this.$message({
+                    message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
+                    type: "error"
+                });
+            } else {
+                this.importingData = true;
+                let formData = new FormData();
+                formData.append("file", item.file);
+                this.http.uploadFile('/report-extra-degree/importData', formData,
                     res => {
                         this.$refs.upload.clearFiles();
                         this.importingData = false;
                         this.showImportResult = true;
                         if (res.code == "ok") {
                             //换成弹出框,以免有人等了半天回来啥也没看到
-                            this.importResultMsg = this.$t('importedupdatedsuccessfully')+res.data+this.$t('customersdata')+"。"+(res.msg?res.msg:"");
+                            this.importResultMsg = this.$t('importedupdatedsuccessfully') + res.data + this.$t('customersdata') + "。" + (res.msg ? res.msg : "");
                             this.getSub();
                         } else {
-                            this.importResultMsg = this.$t('export.Importfailure') + ":"+res.msg;
+                            this.importResultMsg = this.$t('export.Importfailure') + ":" + res.msg;
                         }
                     },
                     error => {
@@ -229,11 +271,11 @@
                             type: "error"
                         });
                     });
-                }
-            },
-            getSub() {
-                this.listLoading = true;
-                this.http.post('/report-extra-degree/getAll ',{withProjects:1},
+            }
+        },
+        getSub() {
+            this.listLoading = true;
+            this.http.post('/report-extra-degree/getAll ', { withProjects: 1 },
                 res => {
                     this.listLoading = false;
                     if (res.code == "ok") {
@@ -253,70 +295,70 @@
                         message: error,
                         type: "error"
                     });
-                    }
-                );
-            },
-            addNewSubProject(subProject) {
-                // console.log(1234)
-                // if (subProject == null) {
-                //     this.addForm = {projectId: this.currentProject.id, level:1}
-                // } 
-                // else {
-                //     this.addForm = subProject;
-                // }
-                if(subProject) {
-                    this.addfm.name = subProject.name
-                    this.addfm.id = subProject.id
-                    this.addfm.rmark = subProject.rmark
-                } else {
-                    this.addfm = {name: '',rmark: ''}
                 }
-                this.addSubProject = true;
-            },
-            deleteSubPro(subProject) {
-                this.$confirm(this.$t('makesuretodeletethisone') + subProject.name + this.$t('shu-ju'),this.$t('btn.delete'), {
-                    confirmButtonText: this.$t('btn.determine'),
-                    cancelButtonText: this.$t('btn.cancel'),
-                    type: "warning"
-                })
+            );
+        },
+        addNewSubProject(subProject) {
+            // console.log(1234)
+            // if (subProject == null) {
+            //     this.addForm = {projectId: this.currentProject.id, level:1}
+            // } 
+            // else {
+            //     this.addForm = subProject;
+            // }
+            if (subProject) {
+                this.addfm.name = subProject.name
+                this.addfm.id = subProject.id
+                this.addfm.rmark = subProject.rmark
+            } else {
+                this.addfm = { name: '', rmark: '' }
+            }
+            this.addSubProject = true;
+        },
+        deleteSubPro(subProject) {
+            this.$confirm(this.$t('makesuretodeletethisone') + subProject.name + this.$t('shu-ju'), this.$t('btn.delete'), {
+                confirmButtonText: this.$t('btn.determine'),
+                cancelButtonText: this.$t('btn.cancel'),
+                type: "warning"
+            })
                 .then(() => {
                     this.listLoading = true;
-                    this.http.post('/report-extra-degree/delete',{ 
-                        id: subProject.id 
+                    this.http.post('/report-extra-degree/delete', {
+                        id: subProject.id
                     },
-                    res => {
-                        this.listLoading = false;
-                        if (res.code == "ok") {
-                            this.$message({
-                                message: this.$t('message.successfullyDeleted'),
-                                type: "success"
-                            });
-                            this.getSub();
-                        } else {
-                            
+                        res => {
+                            this.listLoading = false;
+                            if (res.code == "ok") {
+                                this.$message({
+                                    message: this.$t('message.successfullyDeleted'),
+                                    type: "success"
+                                });
+                                this.getSub();
+                            } else {
+
                                 this.$message({
                                     message: res.msg,
                                     type: "error"
                                 });
-                            
-                        }
-                    },
-                    error => {
-                        this.listLoading = false;
-                        this.$message({
-                            message: error,
-                            type: "error"
-                        });
+
+                            }
+                        },
+                        error => {
+                            this.listLoading = false;
+                            this.$message({
+                                message: error,
+                                type: "error"
+                            });
                         }
                     );
                 })
-                .catch(() => {});
-            },
-            submitInsertSubProject() {
-                this.$refs.form2.validate(valid => {
-                    if (valid) {
-                        var slp = this.addfm
-                        this.http.post('/report-extra-degree/addOrMod',slp,
+                .catch(() => { });
+        },
+        submitInsertSubProject() {
+            this.$refs.form2.validate(valid => {
+                if (valid) {
+                    var slp = this.addfm
+                    this.http.post('/report-extra-degree/addOrMod', slp,
                         res => {
                             this.listLoading = false;
                             if (res.code == "ok") {
@@ -324,7 +366,7 @@
                                     message: this.$t('other.successful'),
                                     type: "success"
                                 });
-                                this.addfm = {name: '',rmark: ''}
+                                this.addfm = { name: '', rmark: '' }
                                 this.addSubProject = false
                                 this.getSub()
                             } else {
@@ -340,50 +382,55 @@
                                 message: error,
                                 type: "error"
                             });
-                            }
-                        );
-                    }
-                })
-            },
-        },
-        created() {
-            this.getSub()
+                        }
+                    );
+                }
+            })
         },
-        mounted() {
+    },
+    created() {
+        this.getSub()
+    },
+    mounted() {
 
-        }
-    };
+    }
+};
 </script>
 
 <style lang="scss" scoped>
 .addNode {
-  cursor:pointer;
+    cursor: pointer;
 }
+
 .addNode:hover {
-  color:#20a0ff;
+    color: #20a0ff;
 }
 
 .panel {
-    padding:30px 15px ;box-shadow: 0 2px 4px rgba(3, 3, 3, 0.12), 0 0 6px rgba(0, 0, 0, .04);
-    
+    padding: 30px 15px;
+    box-shadow: 0 2px 4px rgba(3, 3, 3, 0.12), 0 0 6px rgba(0, 0, 0, .04);
+
 }
+
 .sample {
-    margin-top:30px;
+    margin-top: 30px;
     color: #999;
 }
+
 .tip {
-    margin-left:10px; color:gray;
-    
+    margin-left: 10px;
+    color: gray;
+
 }
+
 .tanjia {
     float: right;
     box-sizing: border-box;
     margin: 10px 28px;
 }
-
 </style>
 <style>
-.el-tooltip__popper{
+.el-tooltip__popper {
     max-width: 600px;
 }
 </style>