Преглед изворни кода

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

Min пре 1 година
родитељ
комит
122a71ce67

+ 6 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/system/dictionary/api.ts

@@ -0,0 +1,6 @@
+export const MOD = '/dictionary'
+export const GETLISTBYCODE = '/sys-dict/getListByCode'
+export const GETTYPE = '/sys-dict/data_type'
+export const GETLIS = '/sys-dict/list'
+export const UNDATELIST = '/sys-dict/addOrUpdate'
+export const DELETELIST = '/sys-dict/delete'

+ 221 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/system/dictionary/index.vue

@@ -1,10 +1,228 @@
 <template>
-<div>
-  系统字典
-</div>
+  <div class="h-full flex">
+    <div class="p-5 w-60 pr-0">
+      <div class="bg-white w-full h-full shadow-md rounded-md flex flex-col const-left">
+        <el-table ref="dictionaryTableRef" :data="dictionaryTableData" border highlight-current-row
+          @current-change="dictionaryHandleCurrentChange" style="width: 100%;height: 100%;">
+          <el-table-column prop="name" label="字典编码" align="center" />
+        </el-table>
+      </div>
+    </div>
+    <div class="flex-1 p-5 overflow-auto">
+      <div class="bg-white w-full h-full shadow-md rounded-md flex flex-col">
+        <div class="tableHeader">
+          <div>字典编码-{{ currentRow?.name }}</div>
+          <el-button type="primary" @click="showDialogFormVisible()" :disabled="!currentRow.id">新增参数</el-button>
+        </div>
+        <div class="flex-1 p-3">
+          <el-table ref="dictionaryTableRef" :data="tableData" v-loading="AllLoading.tableDataLoading" border
+            style="width: 100%;height: 100%;">
+            <el-table-column type="selection" width="55" />
+            <el-table-column prop="name" label="字典名称" align="center" />
+            <el-table-column prop="seq" label="排序" align="center" />
+            <el-table-column label="操作" width="100px">
+              <template #default="{ row, $index }">
+                <dv class="operation">
+                  <el-icon @click="deteleItem(row)">
+                    <Delete color="red" />
+                  </el-icon>
+                </dv>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+    </div>
+
+    <!-- 弹窗 -->
+    <el-dialog title="新增参数" v-model="AllVisible.dialogFormVisible" width="500" align-center
+      :before-close="handleClose">
+      <div>
+        <el-form ref="formRef" :model="form" :rules="rules" label-width="100px">
+          <el-form-item label="字典名称" prop="name">
+            <el-input v-model="form.name" placeholder="请输入字典名称"></el-input>
+          </el-form-item>
+          <el-form-item label="排序" prop="seq">
+            <el-input-number v-model="form.seq" :step="2" placeholder="请输入排序" controls-position="right" style="width: 100%;" />
+          </el-form-item>
+        </el-form>
+      </div>
+      <template #footer>
+        <div slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="submitForm(formRef, false)" v-loading="AllLoading.dialogFormLoading">保
+            存</el-button>
+          <el-button type="primary" @click="submitForm(formRef, true)"
+            v-loading="AllLoading.dialogFormLoading">保存并新增</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
 </template>
+
 <script lang="ts" setup>
+import { ref, reactive, onMounted, inject } from 'vue';
+import { Delete } from '@element-plus/icons-vue'
+import { FormInstance, FormRules, ElMessageBox, ElTable } from 'element-plus'
+import { GETLISTBYCODE, GETTYPE, UNDATELIST, DELETELIST } from './api'
+import { post } from "@/utils/request";
+import { getFromValue, resetFromValue } from '@/utils/tools'
+
+type dictionaryTab = {
+  id: string | number
+  name: string
+}
+
+interface RuleForm {
+  name: string,
+  seq: string | number,
+  id: string | number,
+  code: string
+}
+
+const globalPopup = inject<GlobalPopup>('globalPopup')
+const dictionaryTableRef = ref<InstanceType<typeof ElTable>>()
+const currentRow: any = ref({})
+const dictionaryTableData = ref<dictionaryTab[]>([])
+const tableData = ref<any[]>([])
+const formRef = ref<FormInstance>()
+const form = reactive<RuleForm>({
+  id: '',
+  code: '',
+  name: '',
+  seq: ''
+})
+const rules = reactive<FormRules<RuleForm>>({
+  name: [{ required: true, message: '请输入字典名称', trigger: 'change' }],
+  seq: [{ required: true, message: '请输入排序', trigger: 'change' }]
+})
+const AllLoading = reactive({
+  tableDataLoading: false,
+  dialogFormLoading: false
+})
+const AllVisible = reactive({
+  dialogFormVisible: false
+})
+
+function deteleItem(data: any) {
+  ElMessageBox.confirm(
+    `确定删除【${data.name}】字典吗?`, '',
+    {
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      type: 'warning',
+    }
+  )
+    .then(() => {
+      post(DELETELIST, { id: data.id, code: data.code }).then(res => {
+        if (res.code != 'ok') {
+          globalPopup?.showError(res.msg)
+          return
+        }
+        globalPopup?.showSuccess('删除成功')
+        getTableList()
+      })
+    })
+}
+
+function showDialogFormVisible() {
+  let newForm = resetFromValue(form)
+  newForm.code = currentRow.value.id
+  Object.assign(form, newForm)
+  AllVisible.dialogFormVisible = true
+  console.log(form)
+}
+
+async function submitForm(formEl: FormInstance | undefined, flag: boolean) {
+  if (!formEl) return
+  await formEl.validate((valid) => {
+    if (valid) {
+      updateList(getFromValue(form), flag)
+    }
+  })
+}
+
+function updateList(data: any, flag: boolean) {
+  AllLoading.dialogFormLoading = true
+  post(UNDATELIST, { ...data }).then((_res) => {
+    let newForm = resetFromValue(form)
+    newForm.code = currentRow.value.id
+    Object.assign(form, newForm)
+    globalPopup?.showSuccess ('保存成功')
+    getTableList()
+    AllLoading.dialogFormLoading = false
+    AllVisible.dialogFormVisible = flag
+  }).catch((_err) => {
+    AllLoading.dialogFormLoading = false
+  })
+}
+
+function getDataType() {
+  post(GETTYPE, {}).then((res) => {
+    dictionaryTableData.value = res.data
+    dictionarySetCurrent(dictionaryTableData.value[0])
+  })
+}
 
+function getTableList() {
+  const { id } = currentRow.value
+  post(GETLISTBYCODE, { code: id }).then((res) => {
+    tableData.value = res.data
+  })
+}
+
+function handleClose(done: any) {
+  done()
+}
+
+function dictionaryHandleCurrentChange(val: any) {
+  currentRow.value = val;
+  getTableList()
+}
+
+function dictionarySetCurrent(row?: dictionaryTab) {
+  dictionaryTableRef.value!.setCurrentRow(row)
+}
+
+onMounted(() => {
+  getDataType()
+});
 </script>
+
 <style lang="scss" scoped>
+$borderColor : #F4F4F4;
+$titleBack : #FBFBFB;
+$themeColor : #075985;
+
+.const-left {
+  .const-leftTile {
+    text-align: center;
+    background: $titleBack;
+    padding: 0.85rem 0;
+  }
+
+  .const-leftItem {
+    width: 100%;
+    text-align: center;
+    padding: 0.85rem 0;
+    cursor: pointer;
+  }
+
+  .ons {
+    background: $themeColor;
+    color: #fff;
+  }
+
+  .border-bottom {
+    border-bottom: 1px solid $borderColor;
+  }
+}
+
+.tableHeader {
+  display: flex;
+  width: 100%;
+  justify-content: space-between;
+  align-items: center;
+  padding: 10px;
+  background-color: #F5F7FA;
+}
 </style>

+ 4 - 5
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/system/role/index.vue

@@ -88,12 +88,11 @@
 
 <script lang="ts" setup>
 import { ref, onMounted, reactive, inject, computed } from 'vue';
-import { Search, CirclePlusFilled, Edit, CirclePlus, Delete } from '@element-plus/icons-vue'
 import { post } from "@/utils/request";
-import { GETROLELIST, MOD, DETELEROLE, EDITROLE, GETAUTORITY, SAVEPERM } from "./api.ts";
-import { FormInstance, FormRules, ElMessageBox } from 'element-plus'
+import { GETROLELIST, DETELEROLE, EDITROLE, GETAUTORITY, SAVEPERM } from "./api.ts";
+import { FormInstance, ElMessageBox } from 'element-plus'
 import { useStore } from '@/store/index'
-import { getFromValue, updateDepTreeData, resetFromValue } from '@/utils/tools'
+import { getFromValue, resetFromValue } from '@/utils/tools'
 
 interface roleRuleForm {
   id: string
@@ -101,7 +100,7 @@ interface roleRuleForm {
   description: string
 }
 
-const { getFunctionList, getUserInfoVal } = useStore()
+const { getUserInfoVal } = useStore()
 const globalPopup = inject<GlobalPopup>('globalPopup')
 
 const companyId = reactive(getUserInfoVal('companyId') || '')

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

@@ -449,4 +449,7 @@ onMounted(() => {
     }
   }
 }
+.operation {
+  cursor: pointer;
+}
 </style>

+ 35 - 9
fhKeeper/formulahousekeeper/customerBuler-crm/src/styles/global.scss

@@ -1,17 +1,43 @@
-$darkBlue: #3475C5;
-$ashen: #FEFEFE;
-$backColor: #EEF3F6;
+$darkBlue: #3475c5;
+$ashen: #fefefe;
+$backColor: #eef3f6;
 $black: #000;
 $fontBlack: #333;
 $fontGray: #999;
-$modena: #6F4AFE;
+$modena: #6f4afe;
 
-.text-gray{
-    color : $fontGray
+.text-gray {
+  color: $fontGray;
 }
 .text-black {
-    color : $fontBlack
+  color: $fontBlack;
 }
 .back-dark {
-    background-color : $darkBlue
-}
+  background-color: $darkBlue;
+}
+
+// 设置滚动条样式
+.scroll-bar::-webkit-scrollbar {
+  width: 4px;
+  height: 10px;
+}
+
+.scroll-bar::-webkit-scrollbar-thumb {
+  background: linear-gradient(to bottom right, #075985 0%, #075985 100%);
+  border-radius: 5px;
+}
+
+.scroll-bar::-webkit-scrollbar-track {
+  background-color: none;
+  border: 1px solid none;
+}
+
+.scroll-bar::-webkit-scrollbar-button {
+  background-color: #075985;
+  border-radius: 2px;
+  height: 4px;
+}
+
+.scroll-bar::-webkit-scrollbar-button:hover {
+  background-color: #999999;
+}

+ 31 - 6
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -4678,15 +4678,22 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, companyId));
         List<Map<String,Object>> reportList=reportMapper.getReportList(startDate,endDate,planId,stateKey,departmentId,companyId);
         List<List<String>> dataList=new ArrayList<>();
-        String[] title={"员工","工号","所属部门","排除工单号/任务变更通知号","钢印号","工作时长","产品名称","工序名称","进度","质检类型","质检人","工作日期","填报日期"};
+//        String[] title={"员工","工号","所属部门","排除工单号/任务变更通知号","钢印号","工作时长","产品名称","工序名称","进度","质检类型","质检人","工作日期","填报日期"};
+        String[] title={"所属部门","工号","员工","排除工单号/任务变更通知号","钢印号","产品名称","工序名称","进度","工作件数", "工作时长","单价","工价","汇总",
+                "工作日期","填报日期","质检类型","质检人"};
         List<String> titleList=Arrays.asList(title);
         dataList.add(titleList);
+
+        int sumCostIndex = 12;
+        List<String> sumLine = null;
+        String lastJobNum = null;
         for (Map<String, Object> map : reportList) {
             List<String> item=new ArrayList<>();
-            item.add(String.valueOf(map.get("userName")));
-            item.add(String.valueOf(map.get("jobNumber")));
             String departmentName = convertDepartmentIdToCascade(Integer.valueOf(String.valueOf(map.get("departmentId"))), departmentList);
             item.add(departmentName);
+            String curJobBNum = String.valueOf(map.get("jobNumber"));
+            item.add(curJobBNum);
+            item.add(String.valueOf(map.get("userName")));
             Integer planType = Integer.valueOf(String.valueOf(map.get("planType")));
             if(planType==0){
                 item.add(map.get("productSchedulingNum")==null?"":String.valueOf(map.get("productSchedulingNum")));
@@ -4694,15 +4701,33 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 item.add(map.get("taskChangeNoticeNum")==null?"":String.valueOf(map.get("taskChangeNoticeNum")));
             }
             item.add(map.get("steelNumArray")==null?"":String.valueOf(map.get("steelNumArray")));
-            item.add(String.valueOf(map.get("workingTime")));
             item.add(String.valueOf(map.get("productName")));
             item.add(String.valueOf(map.get("procedureName")));
             item.add(String.valueOf(map.get("progress"))+"%");
-            item.add(String.valueOf(map.get("checkType")));
-            item.add(map.get("checkerName")==null?"":String.valueOf(map.get("checkerName")));
+            item.add(String.valueOf(map.get("finishNum")));
+            item.add(String.valueOf(map.get("workingTime")));
+            item.add(String.valueOf(map.get("unitPrice")));
+            String cost = String.valueOf(map.get("cost"));
+            item.add(cost);
             item.add(String.valueOf(map.get("createDate")));
             item.add(String.valueOf(map.get("reportTime")));
+            item.add(String.valueOf(map.get("checkType")));
+            item.add(map.get("checkerName")==null?"":String.valueOf(map.get("checkerName")));
             dataList.add(item);
+            if (lastJobNum == null || !lastJobNum.equals(curJobBNum)) {
+                //换新的人了
+                sumLine = item;
+                sumLine.add(sumCostIndex, cost);
+                lastJobNum = curJobBNum;
+            } else {
+                //当前这行的该列设置为空
+                item.add(sumCostIndex, "");
+                //更新第一行的数据
+                BigDecimal sumCost = new BigDecimal(sumLine.get(sumCostIndex));
+                sumCost = sumCost.add(new BigDecimal(cost));
+                sumLine.remove(sumCostIndex);
+                sumLine.add(sumCostIndex, sumCost.toString());
+            }
         }
         Company company = companyMapper.selectById(companyId);
         String fileName=("日报统计导出_")+company.getCompanyName()+System.currentTimeMillis();

+ 2 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ReportMapper.xml

@@ -425,9 +425,9 @@
     </select>
     <select id="getReportList" resultType="java.util.Map">
         select p.plan_type as planType,u.name as userName,u.job_number as jobNumber,d.department_id as departmentId,p.product_scheduling_num as productSchedulingNum,
-        p.task_change_notice_num as taskChangeNoticeNum,r.steel_num_array as steelNumArray,r.working_time as workingTime,p.product_name as productName,
+        p.task_change_notice_num as taskChangeNoticeNum,r.steel_num_array as steelNumArray,r.working_time as workingTime,p.product_name as productName,r.finish_num as finishNum,
         pp.name as procedureName,r.progress as progress,(CASE r.check_type WHEN 0 THEN '自检' WHEN 1 THEN '互检' ELSE '专检' END ) as checkType ,uu.name as checkerName,
-        date_format(r.create_date,'%Y-%m-%d') as createDate,date_format(r.create_time,'%Y-%m-%d %T') as reportTime  from report r
+        date_format(r.create_date,'%Y-%m-%d') as createDate,date_format(r.create_time,'%Y-%m-%d %T') as reportTime, pp.unit_price as unitPrice,r.cost  from report r
         left join plan p on p.id=r.plan_id
         left join department d on d.department_id=p.station_id
         left join user u on r.creator_id=u.id