123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589 |
- <template>
- <div>
- <div class="my-title">详情</div>
- <div style="margin-left: 20px; margin-right: 20px">
- <!-- 工作流 -->
- <div v-show="dataForm.workFlowBusinessExt">
- <el-steps :active="activeNo" finish-status="success" align-center style="margin-bottom: 20px">
- <template v-for="(item, i) in stepList">
- <el-step
- :icon="item.icon"
- :title="item.title"
- :description="item.description"
- ></el-step>
- </template>
- </el-steps>
- <el-collapse style="margin-bottom: 20px">
- <el-collapse-item>
- <template slot="title">
- <span style="color: red">审批日志(展开查看更多):</span>
- </template>
- <template v-for="(item, i) in logList">
- <div>
- {{ ++i }}:{{ item.approverName }} {{ item.createTime }}
- {{ item.approvalValue }}
- </div>
- </template>
- </el-collapse-item>
- </el-collapse>
- </div>
- <div v-if="isFlow">
- <approve-component ref="approve" @approveFinished="approveFinished" />
- </div>
- <e-desc title="基本信息" column="3">
- <e-desc-item label="项目名称">{{ dataForm.projectName }}</e-desc-item>
- <e-desc-item label="项目类别">{{ dataForm.typeName }}</e-desc-item>
- <e-desc-item label="备注" span="3">{{ dataForm.remark }}</e-desc-item>
- <e-desc-item label="关联BOM物料清单" span="3">{{
- dataForm.productName
- }}</e-desc-item>
- <e-desc-item v-if="dataForm.attachList" label="附件" span="3">
- <div v-for="(item, index) in dataForm.attachList" style="display: inline">
- <span v-if="index > 0">,</span>
- <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
- </div>
- </e-desc-item>
- </e-desc>
- <div class="desc">
- <h1 class="desc-title">BOM物料明细报价</h1>
- <el-row>
- <el-table
- :data="dataForm.quotedPriceProductList"
- border
- style="width: 100%"
- >
- <el-table-column
- label="序号"
- type="index"
- width="50"
- align="center"
- >
- </el-table-column>
- <el-table-column
- prop="productName"
- header-align="center"
- align="center"
- :show-tooltip-when-overflow="true"
- min-width="160px"
- label="物料名称"
- >
- </el-table-column>
- <el-table-column
- prop="productSpec"
- header-align="center"
- align="center"
- :show-tooltip-when-overflow="true"
- label="物料规格"
- >
- </el-table-column>
- <el-table-column
- prop="mapNumber"
- header-align="center"
- align="center"
- :show-tooltip-when-overflow="true"
- label="主图号"
- >
- </el-table-column>
- <el-table-column
- prop="materials"
- header-align="center"
- align="center"
- :show-tooltip-when-overflow="true"
- label="材料"
- >
- </el-table-column>
- <el-table-column
- prop="cnt"
- header-align="center"
- align="center"
- :show-tooltip-when-overflow="true"
- label="单套数量"
- >
- </el-table-column>
- <el-table-column
- prop="unit"
- header-align="center"
- align="center"
- :show-tooltip-when-overflow="true"
- label="单位"
- >
- </el-table-column>
- <el-table-column
- prop="size"
- header-align="center"
- align="center"
- :show-tooltip-when-overflow="true"
- label="物料尺寸"
- >
- </el-table-column>
- <el-table-column
- prop="developedSize"
- header-align="center"
- align="center"
- :show-tooltip-when-overflow="true"
- label="展开尺寸"
- >
- </el-table-column>
- <el-table-column
- prop="surfaceTreatment"
- header-align="center"
- align="center"
- :show-tooltip-when-overflow="true"
- label="表面处理"
- >
- </el-table-column>
- <el-table-column
- prop="notes"
- header-align="center"
- align="center"
- :show-tooltip-when-overflow="true"
- min-width="200px"
- label="备注"
- >
- </el-table-column>
- <!-- 初次报价 -->
- <template>
- <el-table-column
- prop="materialPrice"
- header-align="center"
- align="center"
- min-width="120px"
- label="原材料费"
- >
- </el-table-column>
- <el-table-column
- prop="processPrice"
- header-align="center"
- align="center"
- min-width="120px"
- label="生产加工费"
- >
- </el-table-column>
- <el-table-column
- prop="handlePrice"
- header-align="center"
- align="center"
- min-width="120px"
- label="热表处理费"
- >
- </el-table-column>
- <el-table-column
- prop="detectionPrice"
- header-align="center"
- align="center"
- min-width="120px"
- label="检测费"
- >
- </el-table-column>
- <el-table-column
- prop="reviewPrice"
- header-align="center"
- align="center"
- min-width="120px"
- label="复验费"
- >
- </el-table-column>
- <el-table-column
- prop="unitPrice"
- header-align="center"
- align="center"
- min-width="120px"
- label="单价费"
- >
- </el-table-column>
- <el-table-column
- prop="elsePrice"
- header-align="center"
- align="center"
- min-width="120px"
- label="其他费"
- >
- </el-table-column>
- </template>
- <!-- 精准报价 -->
- <template>
- <el-table-column
- prop="precisionMaterialPrice"
- header-align="center"
- align="center"
- min-width="120px"
- label="精准原材料费"
- >
- </el-table-column>
- <el-table-column
- prop="precisionProcessPrice"
- header-align="center"
- align="center"
- min-width="120px"
- label="精准生产加工费"
- >
- </el-table-column>
- <el-table-column
- prop="precisionHandlePrice"
- header-align="center"
- align="center"
- min-width="120px"
- label="精准热表处理费"
- >
- </el-table-column>
- <el-table-column
- prop="precisionDetectionPrice"
- header-align="center"
- align="center"
- min-width="120px"
- label="精准检测费"
- >
- </el-table-column>
- <el-table-column
- prop="precisionReviewPrice"
- header-align="center"
- align="center"
- min-width="120px"
- label="精确复验费"
- >
- </el-table-column>
- <el-table-column
- prop="precisionUnitPrice"
- header-align="center"
- align="center"
- min-width="120px"
- label="精准单价费"
- >
- </el-table-column>
- <el-table-column
- prop="precisionElsePrice"
- header-align="center"
- align="center"
- min-width="120px"
- label="精确其他费"
- >
- </el-table-column>
- </template>
- </el-table>
- </el-row>
- </div>
- <div class="desc">
- <h1 class="desc-title">任务工单派发</h1>
- <el-row>
- <el-table :data="dataForm.workInfoList" border style="width: 100%">
- <el-table-column
- label="序号"
- type="index"
- width="50"
- align="center"
- >
- </el-table-column>
- <el-table-column
- prop="taskType"
- header-align="center"
- align="center"
- min-width="100"
- width="120"
- label="工单类型"
- >
- <template slot-scope="scope">
- <span>{{
- taskTypeOption.findIndex(
- (t) => t.value == scope.row.taskType
- ) > -1
- ? taskTypeOption.find((t) => t.value == scope.row.taskType)
- .label
- : ""
- }}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="taskName"
- header-align="center"
- align="center"
- :show-tooltip-when-overflow="true"
- label="工单名称"
- >
- </el-table-column>
- <el-table-column
- prop="ranks"
- header-align="center"
- align="center"
- width="120"
- label="级别"
- >
- <template slot-scope="scope">
- <span>{{
- rankTypeOption.findIndex((t) => t.value == scope.row.ranks) >
- -1
- ? rankTypeOption.find((t) => t.value == scope.row.ranks)
- .label
- : ""
- }}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="content"
- header-align="center"
- align="center"
- min-width="100"
- label="工单内容"
- :show-tooltip-when-overflow="true"
- >
- </el-table-column>
- <el-table-column
- prop="receiver"
- header-align="center"
- align="center"
- width="150"
- label="任务接收人"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.receiverName }}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="attachListVo"
- header-align="center"
- align="center"
- width="150"
- label="任务附件"
- >
- <template slot-scope="scope">
- <el-button
- :disabled="
- !scope.row.attachListVo || scope.row.attachListVo.length === 0
- "
- type="text"
- size="small"
- @click="attachDetails(scope.row.attachListVo)"
- >查看</el-button
- >
- </template>
- </el-table-column>
- <el-table-column
- prop="notes"
- header-align="center"
- align="center"
- :show-tooltip-when-overflow="true"
- label="备注"
- >
- </el-table-column>
- </el-table>
- </el-row>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="onChose">返回</el-button>
- </span>
- <attach-detail-dialog ref="attachDetail" @onChose="onChose" />
- <!-- 文件预览 -->
- <preview-component v-if="previewVisible" ref="preview"/>
- </div>
- </template>
- <script>
- import EDesc from '../common/e-desc'
- import EDescItem from '../common/e-desc-item'
- import UploadComponent from '../common/upload-component-v2'
- import AttachDetailDialog from '../common/attach-detail-dialog'
- import ApproveComponent from '../common/approve-component'
- import { dealStepData, dealStepLogs } from '@/api/util'
- import { getDetail } from '@/api/quoted'
- import { getCoCode } from '@/api/cus'
- import { getProductList, getProductAllDetail } from '@/api/product'
- import {
- productTypeOption,
- taskTypeOption,
- rankTypeOption
- } from '@/utils/enums'
- import PreviewComponent from '@/views/modules/common/preview-component'
- export default {
- name: 'cus-quoted-detail',
- components: { PreviewComponent, EDesc, EDescItem, UploadComponent, AttachDetailDialog, ApproveComponent },
- props: {},
- data () {
- return {
- isFlow: false,
- previewVisible: false,
- id: 0,
- productTypeOption: productTypeOption,
- taskTypeOption: taskTypeOption,
- rankTypeOption: rankTypeOption,
- coOption: [],
- productIdOption: [],
- dataForm: {
- materialCost: 0,
- materialCostSecond: 0,
- totalPrice: 0,
- totalPriceSecond: 0,
- quotedPriceProductList: [], // 报价物料清单
- workInfoList: []
- },
- productList: [],
- activeNo: 0,
- stepList: [],
- logList: []
- }
- },
- watch: {},
- computed: {},
- created () {},
- mounted () {},
- activated () {},
- methods: {
- onChose () {
- this.$emit('onChose')
- },
- async init (id, businessType) {
- this.id = id || 0
- this.isFlow = !!(businessType && businessType !== '')
- this.dataForm = {
- workFlowBusinessExt: null
- }
- this.stepList = []
- this.logList = []
- await this.getCoCode()
- await this.getProductList()
- this.getDetail(id, businessType)
- },
- async getCoCode () {
- await getCoCode().then(({ data }) => {
- if (data && data.code === '200') {
- this.coOption = data.data
- }
- })
- },
- async getProductList (productName) {
- let params = {
- current: 1,
- size: 20,
- productName: productName
- }
- await getProductList(params).then(({ data }) => {
- if (data && data.code === '200') {
- this.productIdOption = []
- data.data.records.forEach((item) => {
- this.productIdOption.push({
- label: item.productName,
- value: item.productId
- })
- })
- }
- })
- },
- getDetail (id, businessType) {
- getDetail(id).then(({ data }) => {
- if (data && data.code === '200') {
- this.dataForm = data.data
- let find1 = this.coOption.find(
- (t) => t.coId === this.dataForm.coId
- )
- if (find1) {
- this.dataForm.coCode = find1.coCode
- }
- let find2 = this.productTypeOption.find(
- (t) => t.value === this.dataForm.type
- )
- if (find2) {
- this.dataForm.typeName = find2.label
- }
- let find3 = this.productIdOption.find(
- (t) => t.value === this.dataForm.productId
- )
- if (find3) {
- this.dataForm.productName = find3.label
- }
- this.productIdChangeHandle(this.dataForm.productId)
- // 流程图展示
- if (data.data.workFlowBusinessExt) {
- dealStepData(data.data.workFlowBusinessExt.workFlowProcessStepList, this.stepList)
- dealStepLogs(data.data.workFlowBusinessExt.processLogList, this.logList)
- }
- if (data.data.workFlowProcessStepList) {
- this.activeNo = Number(data.data.workFlowProcessStepList.activeNo)
- }
- // 初始化审批Form
- this.showApproveForm(businessType, id)
- }
- })
- },
- attachDetails (attachList) {
- this.$refs.attachDetail.init(attachList)
- },
- productIdChangeHandle (val) {
- if (val) {
- getProductAllDetail(val).then(({ data }) => {
- if (data && data.code === '200') {
- this.productList = data.data
- if (
- this.dataForm.quotedPriceProductList == null ||
- this.dataForm.quotedPriceProductList.length === 0
- ) {
- this.productList.forEach((item) => {
- this.dataForm.quotedPriceProductList.push({
- productId: item.productId
- })
- item.id = this.dataForm.quotedPriceProductList.find(
- (t) => t.productId === item.productId
- ).id
- })
- } else {
- this.dataForm.quotedPriceProductList.forEach((item) => {
- let tempItem = this.productList.find(
- (t) => t.productId === item.productId
- )
- if (tempItem) {
- item.productName = tempItem.productName
- item.productSpec = tempItem.productSpec
- item.mapNumber = tempItem.mapNumber
- item.materials = tempItem.materials
- item.cnt = tempItem.cnt
- item.unit = tempItem.unit
- item.size = tempItem.size
- item.developedSize = tempItem.developedSize
- item.surfaceTreatment = tempItem.surfaceTreatment
- item.notes = tempItem.notes
- }
- })
- }
- }
- })
- } else {
- this.productList = []
- }
- },
- // 初始化审批Form
- showApproveForm (businessType, businessId) {
- if (this.isFlow) {
- this.$nextTick(() => {
- this.$refs.approve.init(businessType, businessId)
- })
- }
- },
- // 审批完成
- approveFinished () {
- this.onChose()
- this.$emit('approveFinished')
- },
- // 预览
- previewFile (fileName, url) {
- this.previewVisible = true
- this.$nextTick(() => {
- this.$refs.preview.init(fileName, url)
- })
- }
- }
- }
- </script>
- <style scoped>
- .desc .desc-title {
- margin-bottom: 10px;
- color: #333;
- font-weight: 700;
- font-size: 16px;
- line-height: 1.5715;
- }
- </style>
|