|
|
@@ -10,7 +10,12 @@
|
|
|
<span class="bold font-18 main-color">进度描述</span>
|
|
|
<div class="flex flex-center">
|
|
|
<base-button type="0" title="批量导出" icon="upload" />
|
|
|
- <base-button class="ml-10" title="编辑" icon="upload" />
|
|
|
+ <base-button
|
|
|
+ class="ml-10"
|
|
|
+ :title="btnTitle"
|
|
|
+ icon="upload"
|
|
|
+ @click="edit"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="mt-20">
|
|
|
@@ -18,6 +23,7 @@
|
|
|
v-model="progress"
|
|
|
:rows="10"
|
|
|
type="textarea"
|
|
|
+ :disabled="btnTitle === '编辑'"
|
|
|
placeholder="填写项目进度信息"
|
|
|
/>
|
|
|
</div>
|
|
|
@@ -61,12 +67,24 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="mt-20">
|
|
|
- <el-carousel :interval="4000" type="card" height="200px">
|
|
|
- <el-carousel-item v-for="item in 6" :key="item"> </el-carousel-item>
|
|
|
+ <el-carousel :interval="4000" type="card" height="400px">
|
|
|
+ <el-carousel-item v-for="(item, index) in srcList" :key="item">
|
|
|
+ <el-image
|
|
|
+ :src="item"
|
|
|
+ fit="cover"
|
|
|
+ @click="showImageView(item, index)"
|
|
|
+ />
|
|
|
+ </el-carousel-item>
|
|
|
</el-carousel>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <el-image-viewer
|
|
|
+ v-if="showImage"
|
|
|
+ :url-list="srcList"
|
|
|
+ :initial-index="imageIndex"
|
|
|
+ @close="showImage = false"
|
|
|
+ />
|
|
|
</basic-container>
|
|
|
</template>
|
|
|
|
|
|
@@ -87,11 +105,37 @@ export default {
|
|
|
default: 0
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ year: {
|
|
|
+ handler(val) {
|
|
|
+ if (val) {
|
|
|
+ this.detail()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: false
|
|
|
+ },
|
|
|
+ month: {
|
|
|
+ handler(val) {
|
|
|
+ if (val) {
|
|
|
+ this.detail()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: false
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
projectId: '',
|
|
|
+ btnTitle: '编辑',
|
|
|
+ showImage: false,
|
|
|
+ imageIndex: 0,
|
|
|
progress: '',
|
|
|
loading: false,
|
|
|
+ srcList: [
|
|
|
+ 'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg',
|
|
|
+ 'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg',
|
|
|
+ 'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg'
|
|
|
+ ],
|
|
|
data: [
|
|
|
{
|
|
|
fileName: '支付情况表'
|
|
|
@@ -142,8 +186,47 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.projectId = this.$route.query.id
|
|
|
+ this.detail()
|
|
|
},
|
|
|
methods: {
|
|
|
+ detail() {
|
|
|
+ this.$api.dispatch
|
|
|
+ .home({
|
|
|
+ projectId: this.projectId,
|
|
|
+ year: this.year,
|
|
|
+ month: this.month
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.progress = res.data.processDescribe
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showImageView(res, index) {
|
|
|
+ this.imageIndex = index
|
|
|
+ this.showImage = true
|
|
|
+ },
|
|
|
+ edit() {
|
|
|
+ if (this.btnTitle === '保存' && this.progress.length > 0) {
|
|
|
+ const data = {
|
|
|
+ projectId: this.projectId,
|
|
|
+ year: this.year,
|
|
|
+ month: this.month,
|
|
|
+ processDescribe: this.progress
|
|
|
+ }
|
|
|
+ this.$api.dispatch.saveOrUpdate(data).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ console.log(res)
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.btnTitle = this.btnTitle === '编辑' ? '保存' : '编辑'
|
|
|
+ },
|
|
|
rowDel(row, index, done) {
|
|
|
this.$confirm('确定将选择数据删除?', {
|
|
|
confirmButtonText: '确定',
|