镇公司收集任务
This commit is contained in:
parent
4192e6cbfd
commit
28729caa81
@ -1,12 +1,13 @@
|
||||
<template>
|
||||
<view class="personnel_list">
|
||||
|
||||
<u-tabs style="background-color: #fff;" :list="tabLists" @click="changeTypeCurrent" lineColor='#0022C7'
|
||||
lineWidth='40' inactiveStyle='color:#0022C7' activeStyle="color:#0022C7"></u-tabs>
|
||||
<u-tabs style="background-color: #0022C7;" :list="tabLists" @click="changeTypeCurrent" lineColor='white'
|
||||
lineWidth='100' inactiveStyle='color:white' activeStyle="color:white"></u-tabs>
|
||||
<view class="" style="height: 20rpx;">
|
||||
</view>
|
||||
<view class="card" v-for="(item,index) in gatherList" :key="index" v-show="page==1"
|
||||
<view class="card" v-for="(item,index) in gatherList" :key="item.id" v-if="page==1&&item.planting"
|
||||
@click="navgo(`/subpkg/townTask/townGather?type=plant&task_id=${task_id}&index=${index}`)">
|
||||
|
||||
<view class="card_head">
|
||||
<view class="">
|
||||
养植信息
|
||||
@ -15,7 +16,7 @@
|
||||
点击查看
|
||||
</view>
|
||||
</view>
|
||||
<view class="card_content" @click="navgo(`/subpkg/townTask/townGather?type=supply&task_id=${task_id}`)">
|
||||
<view class="card_content">
|
||||
<view class="" style="margin-bottom: 20rpx;">
|
||||
法人姓名: {{item.planting[0].entityName}}
|
||||
</view>
|
||||
@ -24,7 +25,8 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card" v-for="(item,index) in gatherList" :key="index" v-show="page==2">
|
||||
<view class="card" v-for="(item,index) in gatherList" :key="index" v-if="page==2&&item.supply"
|
||||
@click="navgo(`/subpkg/townTask/townGather?type=supply&task_id=${task_id}&index=${index}`)">
|
||||
<view class="card_head">
|
||||
<view class="">
|
||||
批发商信息
|
||||
@ -83,15 +85,19 @@
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
onShow() {
|
||||
townMasterTask3List({
|
||||
id: this.task_id
|
||||
}).then(res => {
|
||||
this.gatherList = res.data.template_info.extend.purchase_sales_info
|
||||
})
|
||||
},
|
||||
onLoad(option) {
|
||||
this.task_id = option.task_id
|
||||
townMasterTask3List({
|
||||
id: option.task_id
|
||||
}).then(res => {
|
||||
|
||||
this.gatherList = res.data.template_info.extend.purchase_sales_info
|
||||
|
||||
})
|
||||
// townTask3List()
|
||||
},
|
||||
@ -104,6 +110,7 @@
|
||||
},
|
||||
|
||||
navgo(url) {
|
||||
this.show = false
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="content" v-if="flag">
|
||||
<view class="tit">
|
||||
<text v-if="page">养殖信息</text>
|
||||
<text v-else>镇批发商信息收集表</text>
|
||||
@ -179,7 +179,7 @@
|
||||
<u--textarea :disabled="readonly" v-model="formData.familyNotes" autoHeight placeholder="请输入"
|
||||
border="surround" count></u--textarea>
|
||||
</u-form-item>
|
||||
<u-button type="primary" text="提交" @click="confirm1" color="#0122C7"></u-button>
|
||||
<u-button v-if="!readonly" type="primary" text="提交" @click="confirm1" color="#0122C7"></u-button>
|
||||
</u--form>
|
||||
</view>
|
||||
<!-- 镇批发商信息收集表 -->
|
||||
@ -190,8 +190,7 @@
|
||||
<u--input :readonly="readonly" v-model="formData1.storeName" placeholder="请输入店铺名称"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="auto" label="经营类型" required prop="type" borderBottom>
|
||||
<u--input :readonly="readonly" v-model="formData1.type" placeholder="请输入经营类型"
|
||||
type="number"></u--input>
|
||||
<u--input :readonly="readonly" v-model="formData1.type" placeholder="请输入经营类型"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="auto" label="店主姓名" required prop="shopkeeperName" borderBottom>
|
||||
<u--input :readonly="readonly" v-model="formData1.shopkeeperName" placeholder="请输入店主姓名"></u--input>
|
||||
@ -344,13 +343,16 @@
|
||||
<view class="" style="height: 20rpx;">
|
||||
|
||||
</view>
|
||||
<u-button type="primary" text="提交" @click="confirm" color="#0122C7"></u-button>
|
||||
<u-button v-if="!readonly" type="primary" text="提交" @click="confirm" color="#0122C7"></u-button>
|
||||
</u--form>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
<view class="" v-else>
|
||||
<u-loading-page></u-loading-page>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -371,6 +373,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
flag: false,
|
||||
page: 1,
|
||||
taskId: "",
|
||||
readonly: false,
|
||||
@ -454,38 +457,31 @@
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
this.taskId = option.task_id
|
||||
if (option.type == 'supply') this.page = 0
|
||||
|
||||
if (option.index) {
|
||||
townMasterTask3List({
|
||||
id: option.task_id
|
||||
}).then(res => {
|
||||
this.formData = res.data.template_info.extend.purchase_sales_info[option[index]].planting[0]
|
||||
this.formData1 = res.data.template_info.extend.purchase_sales_info[option[index]].supply[0]
|
||||
console.log(res.data.template_info.extend.purchase_sales_info[0].supply[0])
|
||||
this.readonly = true
|
||||
this.flag = true
|
||||
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.taskId = option.task_id
|
||||
this.flag = true
|
||||
|
||||
},
|
||||
created() {
|
||||
this.initRules();
|
||||
// if (this.$props.readonly && this.$props.datas) {
|
||||
// this.formData = this.$props.datas;
|
||||
// let keys = Object.keys(this.formData);
|
||||
// keys.forEach(item => {
|
||||
// if (!isNaN(this.formData[item]) && this.formData[item] != '' && this.formData[item] != null &&
|
||||
// this
|
||||
// .formData[item] != undefined) {
|
||||
// parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[
|
||||
// item]) : null;
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
},
|
||||
|
||||
computed: {
|
||||
@ -506,6 +502,7 @@
|
||||
return !white.includes(item);
|
||||
})
|
||||
arr.forEach(key => {
|
||||
|
||||
this.rules[key] = {
|
||||
validator: (rule, value, callback) => {
|
||||
this.$refs.breedingForm.clearValidate(rule.field);
|
||||
@ -513,6 +510,25 @@
|
||||
},
|
||||
trigger: ['change', 'blur']
|
||||
}
|
||||
if (key == 'phone') {
|
||||
console.log("phone")
|
||||
this.rules[key] = [{
|
||||
required: true,
|
||||
message: '请输入手机号',
|
||||
trigger: ['change', 'blur'],
|
||||
},
|
||||
{
|
||||
|
||||
validator: (rule, value, callback) => {
|
||||
|
||||
return uni.$u.test.mobile(value);
|
||||
},
|
||||
message: '手机号码不正确',
|
||||
|
||||
trigger: ['blur'],
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
arr1.forEach(key => {
|
||||
this.rules1[key] = {
|
||||
@ -522,6 +538,25 @@
|
||||
},
|
||||
trigger: ['change', 'blur']
|
||||
}
|
||||
if (key == 'shopkeeperPhone') {
|
||||
|
||||
this.rules1[key] = [{
|
||||
required: true,
|
||||
message: '请输入手机号',
|
||||
trigger: ['change', 'blur'],
|
||||
},
|
||||
{
|
||||
|
||||
validator: (rule, value, callback) => {
|
||||
|
||||
return uni.$u.test.mobile(value);
|
||||
},
|
||||
message: '手机号码不正确',
|
||||
|
||||
trigger: ['blur'],
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
},
|
||||
// 校验
|
||||
@ -542,20 +577,36 @@
|
||||
this.formData[data.value] = e.detail.value;
|
||||
},
|
||||
async commit() {
|
||||
await townMasterTask3Commit({
|
||||
id: Number(this.taskId),
|
||||
purchase_sales_info: {
|
||||
planting: [{
|
||||
...this.formData
|
||||
}],
|
||||
supply: [{
|
||||
...this.formData1
|
||||
}]
|
||||
}
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
if (this.page) {
|
||||
await townMasterTask3Commit({
|
||||
id: Number(this.taskId),
|
||||
purchase_sales_info: {
|
||||
planting: [{
|
||||
...this.formData
|
||||
}],
|
||||
|
||||
}
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
|
||||
} else {
|
||||
await townMasterTask3Commit({
|
||||
id: Number(this.taskId),
|
||||
purchase_sales_info: {
|
||||
supply: [{
|
||||
...this.formData1
|
||||
}],
|
||||
|
||||
}
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
async nextFormFn() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user