|
@@ -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')
|