页面修改

This commit is contained in:
zmj 2023-11-18 20:17:03 +08:00
parent eca744e099
commit dcf5a1a22f
5 changed files with 491 additions and 410 deletions

View File

@ -98,3 +98,18 @@ export const commit_town_service_manager_task_6API = (data) => oahttp.post('/tas
*/ */
export const commit_town_master_task_6API = (data) => oahttp.post('/task/commit_town_master_task_6', export const commit_town_master_task_6API = (data) => oahttp.post('/task/commit_town_master_task_6',
data) data)
/**
* 应用软件推广
*/
export const commit_town_master_task_type_2API = (data) => oahttp.post('/task/commit_town_master_task_type_2',
data)
/**
* 应用软件推广
*/
export const commit_town_master_task_type_7API = (data) => oahttp.post('/task/commit_town_master_task_type_7',
data)
/**
* 应用软件推广
*/
export const commit_town_master_task_type_8API = (data) => oahttp.post('/task/commit_town_master_task_type_8',
data)

View File

@ -145,11 +145,10 @@
"village_task_type_7", "village_task_type_7",
], // /subpkg/townTask/townTask 1 ], // /subpkg/townTask/townTask 1
navToVillageListA: [ navToVillageListA: [
"town_task_type_master_2",
"town_task_type_master_4", "town_task_type_master_4",
"town_task_type_master_5", "town_task_type_master_5",
"town_task_type_master_7", // "",
"town_task_type_master_8"
], // /subpkg/townTask/townTask 1 ], // /subpkg/townTask/townTask 1
navToList: ["village_task_type_4", "village_task_type_5", "town_task_type_6", "town_task_type_master_6", ], navToList: ["village_task_type_4", "village_task_type_5", "town_task_type_6", "town_task_type_master_6", ],
@ -243,9 +242,24 @@
case "village_task_type_8": case "village_task_type_8":
this.navTo(`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}`); this.navTo(`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}`);
break; break;
case "town_task_type_master_2":
this.navTo(
`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
);
break;
case "town_task_type_master_3": case "town_task_type_master_3":
this.navTo(`/subpkg/townTask/gatherRecords?task_id=${this.$props.datas?.id}`); this.navTo(`/subpkg/townTask/gatherRecords?task_id=${this.$props.datas?.id}`);
break; break;
case "town_task_type_master_7":
this.navTo(
`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
);
break;
case "town_task_type_master_8":
this.navTo(
`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
);
break;
default: default:
this.navTo(''); this.navTo('');
break; break;

View File

@ -5,7 +5,7 @@
lineWidth='100' inactiveStyle='color:white' activeStyle="color:white"></u-tabs> lineWidth='100' inactiveStyle='color:white' activeStyle="color:white"></u-tabs>
<view class="" style="height: 20rpx;"> <view class="" style="height: 20rpx;">
</view> </view>
<view class="card" v-for="(item,index) in gatherList" :key="item.id" v-if="page==1&&item.planting" <view class="card" v-for="(item,index) in gatherList.planting" :key="item.id" v-if="page==1"
@click="navgo(`/subpkg/townTask/townGather?type=plant&task_id=${task_id}&index=${index}`)"> @click="navgo(`/subpkg/townTask/townGather?type=plant&task_id=${task_id}&index=${index}`)">
<view class="card_head"> <view class="card_head">
@ -18,14 +18,14 @@
</view> </view>
<view class="card_content"> <view class="card_content">
<view class="" style="margin-bottom: 20rpx;"> <view class="" style="margin-bottom: 20rpx;">
法人姓名: {{item.planting[0].entityName}} 法人姓名: {{item.entityName}}
</view> </view>
<view class=""> <view class="">
联系电话: {{item.planting[0].phone}} 联系电话: {{item.phone}}
</view> </view>
</view> </view>
</view> </view>
<view class="card" v-for="(item,index) in gatherList" :key="index" v-if="page==2&&item.supply" <view class="card" v-for="(item,index) in gatherList.supply" :key="index" v-if="page==2"
@click="navgo(`/subpkg/townTask/townGather?type=supply&task_id=${task_id}&index=${index}`)"> @click="navgo(`/subpkg/townTask/townGather?type=supply&task_id=${task_id}&index=${index}`)">
<view class="card_head"> <view class="card_head">
<view class=""> <view class="">
@ -37,10 +37,10 @@
</view> </view>
<view class="card_content"> <view class="card_content">
<view class="" style="margin-bottom: 20rpx;"> <view class="" style="margin-bottom: 20rpx;">
店主姓名: {{item.supply[0].storeName}} 店主姓名: {{item.storeName}}
</view> </view>
<view class=""> <view class="">
联系电话: {{item.supply[0].shopkeeperPhone}} 联系电话: {{item.shopkeeperPhone}}
</view> </view>
</view> </view>
</view> </view>
@ -72,7 +72,7 @@
data() { data() {
return { return {
show: false, show: false,
gatherList: [], gatherList: {},
page: 1, page: 1,
task_id: "", task_id: "",
tabLists: [{ tabLists: [{

View File

@ -381,6 +381,7 @@
taskId: "", taskId: "",
readonly: false, readonly: false,
landPlanList: ['自己养', '出租', '代养', '租更多地扩大养殖'], landPlanList: ['自己养', '出租', '代养', '租更多地扩大养殖'],
pas_Info: {},
breedingTypeList: [{ breedingTypeList: [{
id: 1, id: 1,
name: "水产" name: "水产"
@ -460,23 +461,37 @@
} }
}, },
onLoad(option) { onLoad(option) {
this.taskId = option.task_id this.taskId = option.task_id
if (option.type == 'supply') this.page = 0 if (option.type == 'supply') this.page = 0
if (option.index) {
townMasterTask3List({ townMasterTask3List({
id: option.task_id id: option.task_id
}).then(res => { }).then(res => {
this.pas_Info = res.data.template_info.extend.purchase_sales_info
if (option.index) {
this.readonly = true this.readonly = true
this.flag = true this.flag = true
console.log(option, 6464)
if (option.type == 'supply') { if (option.type == 'supply') {
this.formData1 = res.data.template_info.extend.purchase_sales_info[option.index]?.supply[0] this.formData1 = this.pas_Info.supply[option.index]
} else { } else {
this.formData = res.data.template_info.extend.purchase_sales_info[option.index]?.planting[ this.formData = this.pas_Info.planting[option.index]
0] }
} }
// if (option.type == 'supply') {
// this.formData1 = res.data.template_info.extend.purchase_sales_info[option.index]?.supply[0]
// } else {
// this.formData = res.data.template_info.extend.purchase_sales_info[option.index]?.planting[
// 0]
// }
}) })
}
// } // }
this.flag = true this.flag = true
@ -580,26 +595,20 @@
this.formData[data.value] = e.detail.value; this.formData[data.value] = e.detail.value;
}, },
async commit() { async commit() {
if (this.page) { if (this.page) {
this.pas_Info.planting.push(this.formData)
await townMasterTask3Commit({ await townMasterTask3Commit({
id: Number(this.taskId), id: Number(this.taskId),
purchase_sales_info: { purchase_sales_info: this.pas_Info
planting: [{
...this.formData
}],
}
}) })
} else { } else {
this.pas_Info.supply.push(this.formData1)
await townMasterTask3Commit({ await townMasterTask3Commit({
id: Number(this.taskId), id: Number(this.taskId),
purchase_sales_info: { purchase_sales_info: this.pas_Info
supply: [{
...this.formData1
}],
}
}) })
} }
Toast("操作成功") Toast("操作成功")

View File

@ -21,7 +21,8 @@
<view class="file"> <view class="file">
<view class="file_item" v-for="(item, index) in fileList" :key="'file'+index"> <view class="file_item" v-for="(item, index) in fileList" :key="'file'+index">
<image class="image" :src="item" @click="priview(index)"></image> <image class="image" :src="item" @click="priview(index)"></image>
<image v-if="!other.is_commit" class="del" src="/static/icons/delete.png" @click.stop="deleteFile(index)"> <image v-if="!other.is_commit" class="del" src="/static/icons/delete.png"
@click.stop="deleteFile(index)">
</image> </image>
</view> </view>
<view v-if="!other.is_commit && this.fileList.length<9" class="file_btn" @click="chooseFile"> <view v-if="!other.is_commit && this.fileList.length<9" class="file_btn" @click="chooseFile">
@ -76,9 +77,15 @@
import { import {
taskOtherTaskDetail, taskOtherTaskDetail,
taskOtherTaskCommit, taskOtherTaskCommit,
villageTask6Commit villageTask6Commit,
commit_town_master_task_type_2API,
commit_town_master_task_type_7API,
commit_town_master_task_type_8API
} from "@/api/task.js" } from "@/api/task.js"
import { Toast } from "../../libs/uniApi"; import {
Toast
} from "../../libs/uniApi";
export default { export default {
data() { data() {
return { return {
@ -102,22 +109,24 @@
fileList: [], fileList: [],
videoList: [], videoList: [],
video_src: '', video_src: '',
show_video: false show_video: false,
type_value: ""
}; };
}, },
onLoad(options) { onLoad(options) {
this.task_id = options.task_id; this.task_id = options.task_id;
this.type_value = options?.type_value || ""
this.initDetail(); this.initDetail();
}, },
computed: { computed: {
// //
placeholderLength() { placeholderLength() {
if(this.fileList.length==9)return 0; if (this.fileList.length == 9) return 0;
if (this.other.is_commit == 1) return this.fileList.length % 3 == 0 ? 0 : 3 - this.fileList.length % 3; if (this.other.is_commit == 1) return this.fileList.length % 3 == 0 ? 0 : 3 - this.fileList.length % 3;
return (this.fileList.length + 1) % 3 == 0 ? 0 : 3 - (this.fileList.length + 1) % 3; return (this.fileList.length + 1) % 3 == 0 ? 0 : 3 - (this.fileList.length + 1) % 3;
}, },
placeholderLengthVideo() { placeholderLengthVideo() {
if(this.videoList.length==9)return 0; if (this.videoList.length == 9) return 0;
if (this.other.is_commit == 1) return this.videoList.length % 3 == 0 ? 0 : 3 - this.videoList.length % 3; if (this.other.is_commit == 1) return this.videoList.length % 3 == 0 ? 0 : 3 - this.videoList.length % 3;
return (this.videoList.length + 1) % 3 == 0 ? 0 : 3 - (this.videoList.length + 1) % 3; return (this.videoList.length + 1) % 3 == 0 ? 0 : 3 - (this.videoList.length + 1) % 3;
}, },
@ -125,14 +134,17 @@
methods: { methods: {
// //
initDetail() { initDetail() {
taskOtherTaskDetail({ id: this.task_id }).then((res) => { taskOtherTaskDetail({
id: this.task_id
}).then((res) => {
this.taskInfo = res.data; this.taskInfo = res.data;
this.other = JSON.parse(JSON.stringify(res.data?.extend?.other||{})); // this.other = JSON.parse(JSON.stringify(res.data?.extend?.other || {})); //
this.approve_status = res.data?.approve_status; this.approve_status = res.data?.approve_status;
this.deny_notes = res.data?.deny_notes; this.deny_notes = res.data?.deny_notes;
res.data?.extend?.other?.note ? this.note = res.data?.extend?.other?.note : null; res.data?.extend?.other?.note ? this.note = res.data?.extend?.other?.note : null;
res.data?.extend?.other?.annex ? this.fileList = res.data?.extend?.other?.annex : null; res.data?.extend?.other?.annex ? this.fileList = res.data?.extend?.other?.annex : null;
res.data?.extend?.other?.video_annex ? this.videoList = res.data?.extend?.other?.video_annex : null; res.data?.extend?.other?.video_annex ? this.videoList = res.data?.extend?.other?.video_annex :
null;
// this.other.is_commit = 0; // this.other.is_commit = 0;
}) })
}, },
@ -141,7 +153,7 @@
this.other.is_commit = 0; this.other.is_commit = 0;
}, },
// , true // , true
isReject(){ isReject() {
if (this.approve_status == 3) { // if (this.approve_status == 3) { //
let other = { let other = {
note: this.note, note: this.note,
@ -149,7 +161,7 @@
video_annex: this.videoList video_annex: this.videoList
} }
let flag = true; let flag = true;
if(JSON.stringify(other)==JSON.stringify({ if (JSON.stringify(other) == JSON.stringify({
note: this.other.note, note: this.other.note,
annex: this.other.annex, annex: this.other.annex,
video_annex: this.other.video_annex video_annex: this.other.video_annex
@ -158,23 +170,54 @@
Toast('未检测到您的修改,请修改后提交') Toast('未检测到您的修改,请修改后提交')
} }
return flag; return flag;
} } else return true;
else return true;
}, },
// //
async submit() { async submit() {
if(!this.isReject())return; // if (!this.isReject()) return; //
if (this.note.trim() == '') return Toast('详情描述不能为空'); if (this.note.trim() == '') return Toast('详情描述不能为空');
if (this.type_value == 'town_task_type_master_2') {
await commit_town_master_task_type_2API({
id: this.task_id,
note: this.note,
annex: this.fileList,
video_annex: this.videoList
});
}
if (this.type_value == 'town_task_type_master_7') {
await commit_town_master_task_type_7API({
id: this.task_id,
note: this.note,
annex: this.fileList,
video_annex: this.videoList
});
}
if (this.type_value == 'town_task_type_master_8') {
await commit_town_master_task_type_8API({
id: this.task_id,
note: this.note,
annex: this.fileList,
video_annex: this.videoList
});
} else {
await villageTask6Commit({ await villageTask6Commit({
id: this.task_id, id: this.task_id,
note: this.note, note: this.note,
annex: this.fileList, annex: this.fileList,
video_annex: this.videoList video_annex: this.videoList
}); });
}
this.other.is_commit = 1; this.other.is_commit = 1;
this.approve_status = 1; this.approve_status = 1;
Toast('提交成功'); Toast('提交成功');
this.$u.sleep(500).then(()=>{ this.$u.sleep(500).then(() => {
uni.navigateBack() uni.navigateBack()
}) })
}, },