|
@@ -0,0 +1,244 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <el-dialog :title="title" :visible.sync="dialogFormVisible" @close="close">
|
|
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" style="margin: 0px">
|
|
|
|
|
+ <el-row :gutter="20" style="margin: 0px">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="客户名称:" style="margin: 0px">
|
|
|
|
|
+ {{ theDeliverOrder.custName }}
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="项目名称:" style="margin: 0px">
|
|
|
|
|
+ {{ theDeliverOrder.projectName }}
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="合同编号:" style="margin: 0px">
|
|
|
|
|
+ {{ theDeliverOrder.contractCode }}
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="工单编号:" style="margin: 0px">
|
|
|
|
|
+ {{ theDeliverOrder.orderCode }}
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col v-if="theProgress.progressType != ''" :span="12">
|
|
|
|
|
+ <el-form-item label="要求发货时间:" style="margin: 0px">
|
|
|
|
|
+ {{ parseTime(theDeliverOrder.requiredDeliveryTime, '{y}-{m}-{d}') }}
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col v-if="theProgress.progressType != ''" :span="12">
|
|
|
|
|
+ <el-form-item label="收货信息:" style="margin: 0px">
|
|
|
|
|
+ {{ theDeliverOrder.receivingInfo }}
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col v-if="theProgress.progressType != ''" :span="24">
|
|
|
|
|
+ <el-form-item label="特殊要求说明:" style="margin: 0px">
|
|
|
|
|
+ {{ theDeliverOrder.specialRequirements }}
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="任务标题:" style="margin: 0px">
|
|
|
|
|
+ {{ form.progressTitle }}
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col v-if="form.progressType != ''" :span="12">
|
|
|
|
|
+ <el-form-item label="任务类型:" style="margin: 0px">
|
|
|
|
|
+ <span v-show="form.progressType == '10'">发货任务单</span>
|
|
|
|
|
+ <span v-show="form.progressType == '20'">组装任务单</span>
|
|
|
|
|
+ <span v-show="form.progressType == '30'">部署安装单</span>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="负责人:" style="margin: 0px">
|
|
|
|
|
+ {{ form.principalPerson }}
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="优先级:" style="margin: 0px">
|
|
|
|
|
+ <span v-show="form.progressLevel == '10'">最高</span>
|
|
|
|
|
+ <span v-show="form.progressLevel == '20'">普通</span>
|
|
|
|
|
+ <span v-show="form.progressLevel == '30'">较低</span>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="开始/截止日期:">
|
|
|
|
|
+ {{ parseTime(form.startDate, '{y}-{m}-{d}') }} 至
|
|
|
|
|
+ {{ parseTime(form.endDate, '{y}-{m}-{d}') }}
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-table ref="productTable" :data="products" style="width: 100%">
|
|
|
|
|
+ <el-table-column label="产品名称" prop="productName" />
|
|
|
|
|
+ <el-table-column label="产品编号" prop="productCode" />
|
|
|
|
|
+ <el-table-column v-if="!workId" label="数量" prop="num" />
|
|
|
|
|
+ <el-table-column v-if="form.progressType == '10'" label="组装/采购数量" prop="productNum" />
|
|
|
|
|
+ <el-table-column v-if="form.progressType != '10'" label="数量" prop="productNum" />
|
|
|
|
|
+ <el-table-column v-if="form.progressType == '10'" label="获取方式" prop="operateType" />
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col v-if="theProgress && theProgress.deliverStatus >= 30" :span="12">
|
|
|
|
|
+ <el-form-item label="快递名称:" style="margin-top: 10px; margin-bottom: 0px">
|
|
|
|
|
+ {{ theProgress.expressName }}
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col v-if="theProgress && theProgress.deliverStatus >= 30" :span="12">
|
|
|
|
|
+ <el-form-item label="快递单号:" style="margin-top: 10px; margin-bottom: 0px">
|
|
|
|
|
+ {{ theProgress.expressCode }}
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col v-if="theProgress && theProgress.deliverStatus >= 30" :span="12">
|
|
|
|
|
+ <el-form-item label="预计到货时间:" style="margin: 0px">
|
|
|
|
|
+ {{ parseTime(theProgress.estimatedArrivalTime, '{y}-{m}-{d}') }}
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col v-if="theProgress && theProgress.deliverStatus >= 40" :span="12">
|
|
|
|
|
+ <el-form-item label="到货时间:" style="margin: 0px">
|
|
|
|
|
+ {{ parseTime(theProgress.arrivalTime, '{y}-{m}-{d}') }}
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24" style="margin-top: 10px">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="theProgress && theProgress.assembleFileName != ''"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="showFile(theProgress.assembleFileUrl, theProgress.assembleFileName)">
|
|
|
|
|
+ 组装报告:{{ theProgress.assembleFileName }}
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="theProgress && theProgress.checkFileName != ''"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="showFile(theProgress.checkFileUrl, theProgress.checkFileName)">
|
|
|
|
|
+ 验收单:{{ theProgress.checkFileName }}
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="theProgress && theProgress.installCheckFileName != ''"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="showFile(theProgress.installCheckFileUrl, theProgress.installCheckFileName)">
|
|
|
|
|
+ 安装验收单:{{ theProgress.installCheckFileName }}
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="备注:" style="margin: 0px">
|
|
|
|
|
+ {{ form.remark }}
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <el-button @click="close">关 闭</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+ import orderWorkApi from '@/api/work/deliver'
|
|
|
|
|
+ import to from 'await-to-js'
|
|
|
|
|
+
|
|
|
|
|
+ export default {
|
|
|
|
|
+ name: 'WorkOrderFeedback',
|
|
|
|
|
+ components: {},
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ theDeliverOrder: {},
|
|
|
|
|
+ theProgress: {},
|
|
|
|
|
+ form: {
|
|
|
|
|
+ progressTitle: undefined,
|
|
|
|
|
+ progressType: '',
|
|
|
|
|
+ progressContext: '',
|
|
|
|
|
+ startDate: '',
|
|
|
|
|
+ endDate: '',
|
|
|
|
|
+ progressLevel: '10',
|
|
|
|
|
+ principalPersonId: '',
|
|
|
|
|
+ principalPerson: '',
|
|
|
|
|
+ remark: undefined,
|
|
|
|
|
+ },
|
|
|
|
|
+ rules: {
|
|
|
|
|
+ progressTitle: [{ required: true, message: '不能为空', trigger: ['blur', 'change'] }],
|
|
|
|
|
+ progressContext: [{ required: true, message: '不能为空', trigger: ['blur', 'change'] }],
|
|
|
|
|
+ principalPerson: [{ required: true, trigger: 'change', message: '请选择负责人' }],
|
|
|
|
|
+ },
|
|
|
|
|
+ dialogFormVisible: false,
|
|
|
|
|
+ planId: 0,
|
|
|
|
|
+ workId: 0,
|
|
|
|
|
+ title: '',
|
|
|
|
|
+ orderId: '',
|
|
|
|
|
+ products: [],
|
|
|
|
|
+ allProducts: [],
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ mounted() {},
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ open(planId, orderId, row) {
|
|
|
|
|
+ this.theProgress = row
|
|
|
|
|
+ this.planId = planId
|
|
|
|
|
+ this.orderId = orderId
|
|
|
|
|
+ this.workId = row.id
|
|
|
|
|
+ this.title = '详情'
|
|
|
|
|
+ this.form = {
|
|
|
|
|
+ progressTitle: row.progressTitle,
|
|
|
|
|
+ progressType: row.progressType,
|
|
|
|
|
+ progressContext: row.progressContext,
|
|
|
|
|
+ startDate: row.startDate,
|
|
|
|
|
+ endDate: row.endDate,
|
|
|
|
|
+ progressLevel: row.progressLevel,
|
|
|
|
|
+ principalPersonId: row.principalPersonId,
|
|
|
|
|
+ principalPerson: row.principalPerson,
|
|
|
|
|
+ remark: row.remark,
|
|
|
|
|
+ }
|
|
|
|
|
+ this.getOrderDetails()
|
|
|
|
|
+ this.dialogFormVisible = true
|
|
|
|
|
+ },
|
|
|
|
|
+ close() {
|
|
|
|
|
+ this.dialogFormVisible = false
|
|
|
|
|
+ },
|
|
|
|
|
+ // 查看附件
|
|
|
|
|
+ showFile(url, fileName) {
|
|
|
|
|
+ const xhr = new XMLHttpRequest()
|
|
|
|
|
+ xhr.open('GET', url, true)
|
|
|
|
|
+ xhr.responseType = 'blob' // 通过文件下载url拿到对应的blob对象
|
|
|
|
|
+ xhr.onload = () => {
|
|
|
|
|
+ if (xhr.status === 200) {
|
|
|
|
|
+ let link = document.createElement('a')
|
|
|
|
|
+ let body = document.querySelector('body')
|
|
|
|
|
+ link.href = window.URL.createObjectURL(xhr.response)
|
|
|
|
|
+ link.download = fileName
|
|
|
|
|
+ link.click()
|
|
|
|
|
+ this.$message.success('下载成功')
|
|
|
|
|
+ body.removeChild(link)
|
|
|
|
|
+ window.URL.revokeObjectURL(link.href)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ xhr.send()
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取详细信息
|
|
|
|
|
+ async getOrderDetails() {
|
|
|
|
|
+ this.products = []
|
|
|
|
|
+ this.allProducts = []
|
|
|
|
|
+ let progressProducts = []
|
|
|
|
|
+ this.theDeliverOrder = {}
|
|
|
|
|
+ const [err, res] = await to(orderWorkApi.getDeliverOrder({ id: this.orderId }))
|
|
|
|
|
+ if (err) return
|
|
|
|
|
+ if (res.code == 200 && res.data) {
|
|
|
|
|
+ this.theDeliverOrder = res.data
|
|
|
|
|
+ this.allProducts = res.data.product
|
|
|
|
|
+ progressProducts = res.data.progressProducts ? res.data.progressProducts : []
|
|
|
|
|
+ }
|
|
|
|
|
+ for (let p of progressProducts) {
|
|
|
|
|
+ p = JSON.parse(JSON.stringify(p))
|
|
|
|
|
+ // 10发货任务单/20组装任务单/30部署安装单
|
|
|
|
|
+ if (
|
|
|
|
|
+ (p.deliverProgressId == this.workId && this.form.progressType == '10') ||
|
|
|
|
|
+ (p.assembleProgressId == this.workId && this.form.progressType == '20') ||
|
|
|
|
|
+ (p.installProgressId == this.workId && this.form.progressType == '30')
|
|
|
|
|
+ ) {
|
|
|
|
|
+ this.products.push(p)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
|
|
+</script>
|