瀏覽代碼

提交代码

Lijy 1 月之前
父節點
當前提交
b5b4e953ef

+ 3 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/project/qrCodeManagement.vue

@@ -104,7 +104,7 @@ export default {
         });
         var filePath = res.data;
         const a = document.createElement('a'); // 创建a标签
-        a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
+        a.setAttribute('download', '二维码' + '.zip');// download属性
         a.setAttribute('href', filePath);// href链接
         a.click(); //自执行点击事件
         a.remove();
@@ -133,18 +133,18 @@ export default {
     },
     geTableData() {
       const filteredParams = {};
+      console.log(this.filterValForm, '<==== this.filterValForm')
       for (const key in this.filterValForm) {
         const val = this.filterValForm[key];
         if (val !== '' && val !== null && val !== undefined) {
           filteredParams[key] = val;
         }
       }
-
       this.tableLoading = true
       this.postData('/erpOrderInfo/getInfoPage', {
         pageIndex: this.pageIndex,
         pageSize: this.pageSize,
-        ...this.filteredParams
+        ...filteredParams
       }).then(res => {
         console.log('res', res)
         console.log(res.data.data, '<======= 数据')

+ 144 - 7
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -75,9 +75,19 @@
                 @click="copyProject(index)" style="border: 1px solid #20a0ff;padding:5px;"
                  icon="plus" type="default" ><span style="color:#666;padding: 0 5px;">复制项目</span></van-tag> -->
 
-                    <van-tag v-if="(index > 0 || form.domains.length > 1) && item.canEdit" color="#fff"
-                        @click="delPro(index)" style="border: 1px solid #ff0000;padding:5px;margin-left:10px;" icon="plus"
-                        type="default"><span style="color:#666;padding: 0 5px;">删除</span></van-tag>
+                <!-- 扫码填报 -->
+                <van-tag v-if="item.canEdit && user.companyId == 7536" color="#fff"
+                    @click="scanCodeToFillIn(index)" style="border: 1px solid #409eff;padding:5px;margin-left:10px;" icon="plus"
+                    type="default"><span style="color:#409eff;padding: 0 5px;">扫码填报</span>
+                </van-tag>
+                <!-- <van-tag v-if="item.canEdit && user.companyId == 7536" color="#fff"
+                    @click="determineQrcode(index)" style="border: 1px solid #409eff;padding:5px;margin-left:10px;" icon="plus"
+                    type="default"><span style="color:#409eff;padding: 0 5px;">扫码填报</span>
+                </van-tag> -->
+
+                <van-tag v-if="(index > 0 || form.domains.length > 1) && item.canEdit" color="#fff"
+                    @click="delPro(index)" style="border: 1px solid #ff0000;padding:5px;margin-left:10px;" icon="plus"
+                    type="default"><span style="color:#666;padding: 0 5px;">删除</span></van-tag>
                 </div>
                 <!-- <van-icon v-if="index>0&&canEdit" class="form_del" name="delete" @click="delPro(index)" /> -->
                 <van-cell-group :title="(user.companyId == 781 ? '任务' : '项目') + (index + 1)">
@@ -154,6 +164,26 @@
                         <van-picker show-toolbar :columns="item.stages" value-key="stagesName" @confirm="choseStage"
                             @cancel="item.showPickerStage = false; $forceUpdate();" />
                     </van-popup>
+                    <template v-if="item.projectId">
+                        <!-- 工单号 -->
+                        <van-field readonly name="stage" :disabled="!item.canEdit"
+                        v-if="user.timeType.reportExtraField4Name"
+                        clickable :value="item.extraField4" :label="user.timeType.reportExtraField4Name" placeholder="请选择"
+                        @click="clickPickExtraField4(index, item)" />
+                        <van-popup v-model="item.showPickerExtraField4" position="bottom" :close-on-click-overlay="false">
+                            <van-picker show-toolbar :columns="(item.reportExtraField4List || [])" value-key="stagesName" @confirm="choseExtraField4"
+                            @cancel="item.showPickerExtraField4 = false; $forceUpdate();" />
+                        </van-popup>
+                        <!-- 行号 -->
+                        <van-field readonly name="stage" :disabled="!item.canEdit"
+                        v-if="user.timeType.reportExtraField5Name"
+                        clickable :value="item.extraField5" :label="user.timeType.reportExtraField5Name" :placeholder="`请选择`"
+                        @click="clickPickExtraField5(index, item)" />
+                        <van-popup v-model="item.showPickerExtraField5" position="bottom" :close-on-click-overlay="false">
+                            <van-picker v-if="item.showPickerExtraField5" show-toolbar :columns="(item.reportExtraField5List || [])" value-key="stagesName" @confirm="choseExtraField5" @cancel="item.showPickerExtraField5 = false; $forceUpdate();" />
+                        </van-popup>
+                    </template>
+                    
                     <!-- 预算来源 -->
                     <van-field readonly name="basecostId" :disabled="!item.canEdit"
                         v-if="user.company.packageProject == 1 && reportBasecostList && reportBasecostList.length > 0"
@@ -574,14 +604,21 @@
                 </div>
             </div>
         </van-popup>
+
+        <!-- 扫码 -->
+        <div class="qrcodeClass" v-if="showQrcode">
+            <Qrcode @closeQrcode="closeQrcode" @determineQrcode="determineQrcode" />
+        </div>
     </div>
 </template>
 <script>
 import timetoolVue from '../timetool/timetool.vue';
+import Qrcode from '../../components/qrcode.vue'
 // Vue.prototype.$wx = wx
 // import { Recorder } from '../../assets/record/recorder'
 // var recorder = null
 export default {
+    components: { Qrcode },
     data() {
         return {
             roleList: [{ value: 1, label: 'CRC&LM' }, { value: 2, label: 'PM' }],
@@ -589,6 +626,7 @@ export default {
             yuzhongCompId: 3385,
             dailyIndex: 0,
 
+            showQrcode: false,
             integrationProjectList: [],
             cardRefLoading: false,
             today: '',
@@ -643,7 +681,9 @@ export default {
                     state: 2,
                     multiWorktime: 0,
                     worktimeList: {},
-                    degreeId: ''
+                    degreeId: '',
+                    extraField4: '',
+                    extraField5: '',
                     // pics:["https://worktime.ttkuaiban.com/upload/bc4df504fa724e6cab69872e2c1cfb35.png",
                     // "https://worktime.ttkuaiban.com/upload/bc4df504fa724e6cab69872e2c1cfb35.png",
                     // "https://worktime.ttkuaiban.com/upload/bc4df504fa724e6cab69872e2c1cfb35.png",]
@@ -735,7 +775,40 @@ export default {
     },
 
     methods: {
-
+        scanCodeToFillIn(index) {
+            this.clickIndex = index
+            this.showQrcode = true
+        },
+        closeQrcode() {
+            this.showQrcode = false
+        },
+        determineQrcode(val) {
+            this.clickIndex = val
+            // const { line, orderId, projectId, projectName, trueProjectId } = JSON.parse(`{"id":1,"line":1,"orderId":"MO-2021-08-0004","projectId":"HH-EQ-2101003","projectName":"行走轴样机","status":4,"trueProjectId":"64218"}`)
+            // const { line, orderId, projectId, projectName, trueProjectId } = JSON.parse(localStorage.getItem('scanTheCode') || `{}`)
+            const { line, orderId, projectId, projectName, trueProjectId } = JSON.parse(val || '{}')
+            if(!trueProjectId) {
+                this.$toast.fail(`请扫描正确的二维码`);
+                return
+            }
+            if(!this.form.domains[this.clickIndex].canEdit) {
+                this.$toast.fail(`待审核的日报扫码无效`);
+                return
+            }
+            this.form.domains[this.clickIndex] = {
+                ...this.form.domains[this.clickIndex],
+                extraField4: orderId,
+                extraField5: line,
+                projectName: projectName,
+                projectId: trueProjectId,
+            };
+            const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
+            const item = { id: trueProjectId, projectName: projectName, projectCode: projectId }
+            this.fZr(item, this.scanCodeIndex, true)
+            if(reportExtraField4Name || reportExtraField5Name) {
+                this.getInfoByProjectId(item.projectCode, this.clickIndex, false)
+            }
+        },
         //选中角色
         choseRole(value, index) {
             if (value) {
@@ -1028,7 +1101,7 @@ export default {
                 }).catch(err => { this.$toast.clear(); });
         },
 
-        fZr(item, index) {
+        fZr(item, index, flag = false) {
 
             var domainItem = this.form.domains[this.clickIndex];
             domainItem.projectId = item.id;
@@ -1082,6 +1155,26 @@ export default {
             if (this.user.companyId == this.yuzhongCompId) {
                 this.updateResponse(domainItem);
             }
+            // 工单号,行号
+            const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
+            if((reportExtraField4Name || reportExtraField5Name) && !flag) {
+                this.getInfoByProjectId(item.projectCode)
+            }
+        },
+        getInfoByProjectId(projectCode, index = null, flag = true) {
+            const { projectId } = this.form.domains[this.clickIndex];
+            this.$axios.post("/erpOrderInfo/getInfoByProjectId", { projectId: projectCode })
+                .then(res => {
+                    if (res.code == "ok") {
+                        if(flag) {
+                            this.form.domains[index == null ? this.clickIndex : index].extraField4 = ''
+                            this.form.domains[index == null ? this.clickIndex : index].extraField5 = ''
+                        }
+                        this.form.domains[index == null ? this.clickIndex : index].reportExtraField4List = res.data.orderIds || []
+                        this.form.domains[index == null ? this.clickIndex : index].reportExtraField5List = res.data.lines || []
+                    }
+                    this.$forceUpdate();
+                }).catch(err => { this.$toast.clear(); });
         },
         //获取项目下的任务分组
         getTaskGroups(domainItem, index) {
@@ -1793,6 +1886,8 @@ export default {
                                     extraField2Name: list[i].extraField2Name,
                                     extraField3: list[i].extraField3,
                                     extraField3Name: list[i].extraField3Name,
+                                    extraField4: list[i].extraField4,
+                                    extraField5: list[i].extraField5,
                                     workContentList: list[i].workContentList,
                                     filteredRespList: filteredRespList,
                                     sapServiceId: list[i].sapServiceId,
@@ -1817,6 +1912,11 @@ export default {
                                     this.canCancel = true;
                                     this.canCancelInDialog = true
                                 }
+                                const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
+                                if(reportExtraField4Name || reportExtraField5Name) {
+                                    const { projectCode } = this.proads.find(item => item.id == list[i].projectId)
+                                    this.getInfoByProjectId(projectCode, i, false)
+                                }
                             }
                             this.form.domains = array;
                             // console.log('执行One')
@@ -1974,6 +2074,18 @@ export default {
             item.showPickerStage = true;
             this.$forceUpdate();
         },
+        clickPickExtraField4(i, item) {
+            if (!item.canEdit) return;
+            this.clickIndex = i;
+            item.showPickerExtraField4 = true;
+            this.$forceUpdate();
+        },
+        clickPickExtraField5(i, item) {
+            if (!item.canEdit) return;
+            this.clickIndex = i;
+            item.showPickerExtraField5 = true;
+            this.$forceUpdate();
+        },
         selectDeptPopup(i, item) {
             this.clickIndex = i;
             this.showSelectDeptPopup = true;
@@ -2127,7 +2239,20 @@ export default {
             this.form.domains[this.clickIndex].showPickerStage = false;
             this.getTaskList(this.form.domains[this.clickIndex]);
             this.$forceUpdate();
-
+        },
+        choseExtraField4(value) {
+            if (value) {
+                this.form.domains[this.clickIndex].extraField4 = value
+            }
+            this.form.domains[this.clickIndex].showPickerExtraField4 = false;
+            this.$forceUpdate();
+        },
+        choseExtraField5(value) {
+            if (value) {
+                this.form.domains[this.clickIndex].extraField5 = value
+            }
+            this.form.domains[this.clickIndex].showPickerExtraField5 = false;
+            this.$forceUpdate();
         },
         choseCostId(value, index) {
             if (value) {
@@ -2499,6 +2624,7 @@ export default {
                     return;
                 }
             }
+            const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
             //填字段
             for (var i in this.form.domains) {
                 // 检查任务/里程碑是否为必填
@@ -2738,6 +2864,11 @@ export default {
                         return;
                     }
                 }
+
+                if(reportExtraField4Name || reportExtraField5Name) {
+                    formData.append('extraField4', this.form.domains[i].extraField4 || '');
+                    formData.append('extraField5', this.form.domains[i].extraField5 || '');
+                }
             }
             if (!this.flgLg) {
                 return
@@ -2911,6 +3042,12 @@ export default {
             this.getReportDeptList()
         }
 
+        if(this.$route.query.scanTheCode == 1) {
+            setTimeout(() => {
+                this.scanCodeToFillIn(0)
+                // this.determineQrcode(0)
+            }, 1000)
+        }
     },
     beforeDestroy() {
         localStorage.removeItem('formVal')

+ 77 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -100,6 +100,27 @@
                             <van-picker show-toolbar :columns="item.stages" value-key="stagesName" @confirm="choseStage" 
                                 @cancel="item.showPickerStage = false;$forceUpdate();" />
                         </van-popup>
+
+                        <template v-if="item.projectId">
+                            <!-- 工单号 -->
+                            <van-field readonly name="stage" :disabled="item.state<=1"
+                            v-if="user.timeType.reportExtraField4Name"
+                            clickable :value="item.extraField4" :label="user.timeType.reportExtraField4Name" placeholder="请选择"
+                            @click="clickPickExtraField4(index, item)" />
+                            <van-popup v-model="item.showPickerExtraField4" position="bottom" :close-on-click-overlay="false">
+                                <van-picker show-toolbar :columns="(item.reportExtraField4List || [])" value-key="stagesName" @confirm="choseExtraField4"
+                                @cancel="item.showPickerExtraField4 = false; $forceUpdate();" />
+                            </van-popup>
+                            <!-- 行号 -->
+                            <van-field readonly name="stage" :disabled="item.state<=1"
+                            v-if="user.timeType.reportExtraField5Name"
+                            clickable :value="item.extraField5" :label="user.timeType.reportExtraField5Name" :placeholder="`请选择`"
+                            @click="clickPickExtraField5(index, item)" />
+                            <van-popup v-model="item.showPickerExtraField5" position="bottom" :close-on-click-overlay="false">
+                                <van-picker v-if="item.showPickerExtraField5" show-toolbar :columns="(item.reportExtraField5List || [])" value-key="stagesName" @confirm="choseExtraField5" @cancel="item.showPickerExtraField5 = false; $forceUpdate();" />
+                            </van-popup>
+                        </template>
+
                         <!-- 预算来源 -->
                         <van-field  readonly  name="basecostId" v-if="user.company.packageProject==1&&reportBasecostList &&reportBasecostList.length>0" 
                             :value="item.basecostName" label="预算来源" placeholder="请选择预算来源" :disabled="item.state<=1"
@@ -543,7 +564,9 @@
                                 state: 2,
                                 multiWorktime:0,
                                 worktimeList:[{}],
-                                degreeId: ''
+                                degreeId: '',
+                                extraField4: '',
+                                extraField5: '',
                             }],
                         },
                 rules: {
@@ -1090,6 +1113,26 @@
                         this.getProjectAuditorList(domainItem, index);
                     }
                 }
+
+                // 工单号,行号
+                const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
+                if(reportExtraField4Name || reportExtraField5Name) {
+                    this.getInfoByProjectId(item.projectCode)
+                }
+            },
+            getInfoByProjectId(projectCode, index = null, flag = true) {
+                this.$axios.post("/erpOrderInfo/getInfoByProjectId", { projectId: projectCode })
+                    .then(res => {
+                        if (res.code == "ok") {
+                            if(flag) {
+                                this.currentForm.domains[index == null ? this.proIdx : index].extraField4 = ''
+                                this.currentForm.domains[index == null ? this.proIdx : index].extraField5 = ''
+                            }
+                            this.currentForm.domains[index == null ? this.proIdx : index].reportExtraField4List = res.data.orderIds || []
+                            this.currentForm.domains[index == null ? this.proIdx : index].reportExtraField5List = res.data.lines || []
+                        }
+                        this.$forceUpdate();
+                    }).catch(err => { this.$toast.clear(); });
             },
             //获取项目下的任务分组
             getTaskGroups(domainItem, index) {
@@ -1631,6 +1674,19 @@
                 this.$forceUpdate();
             },
 
+            clickPickExtraField4(i, item) {
+                if (item.state<2) return;
+                this.clickIndex = i;
+                item.showPickerExtraField4 = true;
+                this.$forceUpdate();
+            },
+            clickPickExtraField5(i, item) {
+                if (item.state<2) return;
+                this.clickIndex = i;
+                item.showPickerExtraField5 = true;
+                this.$forceUpdate();
+            },
+
             // 选择项目
             clickPicker(i, item) {
                 //不可待审核和已通过不可编辑
@@ -1773,7 +1829,20 @@
                 this.$forceUpdate();
 
             },
-
+            choseExtraField4(value) {
+                if (value) {
+                    this.currentForm.domains[this.clickIndex].extraField4 = value
+                }
+                this.currentForm.domains[this.clickIndex].showPickerExtraField4 = false;
+                this.$forceUpdate();
+            },
+            choseExtraField5(value) {
+                if (value) {
+                    this.currentForm.domains[this.clickIndex].extraField5 = value
+                }
+                this.currentForm.domains[this.clickIndex].showPickerExtraField5 = false;
+                this.$forceUpdate();
+            },
             getGroupStages(domain, index, flag = false) {
                 this.$axios.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId})
                         .then(res => {
@@ -2189,6 +2258,7 @@
 
                     // formData.append("draft", this.isDraft);
                     formData.append("draft", isDraft);
+                    const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
                     //填字段
                     for(var i in this.form[formIndex].domains) {
                         //没有选择项目的,跳过
@@ -2388,6 +2458,11 @@
                             this.$toast.fail('请选择'+this.weekArr[formIndex]+'投入项目的审核人');
                             return;
                         }
+
+                        if(reportExtraField4Name || reportExtraField5Name) {
+                            formData.append("extraField4", this.form[formIndex].domains[i].extraField4 || '');
+                            formData.append("extraField5", this.form[formIndex].domains[i].extraField5 || '');
+                        }
                     }
 
                 }

+ 7 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

@@ -310,6 +310,13 @@
                     });
                 }
 
+                if(this.user.companyId == 7536) {
+                    this.routers.splice(2, 0, {
+                        name: '扫码填报',
+                        url: '/edit?scanTheCode=1',
+                        icon: 'scan'
+                    })
+                }
                 // 设备管理
                 // if(this.user.companyId == 10) {
                 //     this.routers.push({

+ 2 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/index.vue

@@ -141,6 +141,8 @@
                         <div class="project_title" v-if="user.companyId == yuzhongCompId" >工作职责:{{item1.extraField2?item1.extraField2Name:''}}</div>
                         <div class="project_title" v-if="user.companyId == yuzhongCompId" >工作内容:{{item1.extraField3?item1.extraField3Name:''}}</div>
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-' && user.companyId != yuzhongCompId" >投入阶段:{{item1.stage}}</div>
+                        <div class="project_title" v-if="user.timeType.reportExtraField4Name" >{{ user.timeType.reportExtraField4Name }}:{{item1.extraField4}}</div>
+                        <div class="project_title" v-if="user.timeType.reportExtraField5Name" >{{ user.timeType.reportExtraField5Name }}:{{item1.extraField5}}</div>
                         <!--自定义维度 -->
                         <div class="project_title" v-if="user.timeType.customDegreeActive == 1" >{{user.timeType.customDegreeName}}:{{item1.degreeName}}</div>
                         <div class="project_title" v-if="user.timeType.customDataActive == 1" >{{user.timeType.customDataName}}:{{item1.customData}}</div>