12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163 |
- <template>
- <div>
- <div class="tabsdomPurchase">
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="采购申请" name="first">
- <el-form
- ref="form"
- v-loading="loading"
- :model="form"
- :rules="rules"
- class="cost_form"
- label-width="150px"
- style="width: 100%;padding: 5px"
- >
- <el-row>
- <el-col>
- <el-card shadow="always" style="padding: 15px 5px 5px 15px">
- <el-row>
- <el-col :span="24">
- <el-form-item prop="purchaseCode" label="采购单号">
- <el-input v-model="form.purchaseCode" placeholder="请输入" :readonly="formDisable" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item prop="proId" label="关联项目名称">
- <el-select
- v-if="!formDisable"
- v-model="form.proId"
- filterable
- placeholder="请选择项目"
- :disabled="formDisable"
- @change="selectProMain()"
- >
- <el-option
- v-for="item in proData"
- :key="item.id"
- :label="item.proname"
- :value="item.id"
- >
- <span style="float: left">{{ item.proname }}</span>
- <span style="float: right; color: #8492a6; font-size: 13px">{{ item.custname }}</span>
- </el-option>
- </el-select>
- <el-input v-else v-model="form.proName" readonly />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item prop="custName" label="客户名称">
- <el-input v-model="form.custName" placeholder="请选择项目带出" readonly />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item prop="placeDate" label="下单日期">
- <el-date-picker
- v-model="form.placeDate"
- type="datetime"
- value-format="yyyy-MM-dd HH:mm:ss"
- placeholder="请选择"
- style="width: 100%"
- :disabled="formDisable"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item prop="requireCompleteTime" label="要求完成时间">
- <el-date-picker
- v-model="form.requireCompleteTime"
- type="datetime"
- value-format="yyyy-MM-dd HH:mm:ss"
- placeholder="请选择"
- style="width: 100%"
- :disabled="formDisable"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <!-- <el-row>
- <el-col :span="12">
- <el-form-item prop="supplierId" label="供应商">
- <el-select
- v-model="form.supplierId"
- filterable
- clearable
- placeholder="请选择供应商"
- :disabled="formDisable"
- @change="changeSupplier"
- >
- <el-option
- v-for="item in supplierData"
- :key="item.id"
- :label="item.supplierName"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item prop="contactUser" label="联系人">
- <el-input v-model="form.contactUser" placeholder="请选择供应商带出" readonly />
- </el-form-item>
- </el-col>
- </el-row>-->
- <el-row>
- <el-col :span="24">
- <el-form-item prop="purchaseContent" label="采购内容">
- <el-input v-model="form.purchaseContent" type="textarea" :rows="3" :readonly="formDisable" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-form-item prop="purchaseFile" label="附件">
- <el-upload
- v-if="!formDisable"
- ref="upload"
- class="upload-demo"
- :action="$constant.BASE_URI+'/FileController/uploadImage'"
- :http-request="uploadFile"
- :before-remove="beforeRemove"
- multiple
- :file-list="fileUrlList"
- >
- <el-button size="small" type="primary">点击上传</el-button>
- <div slot="tip" class="el-upload__tip">请上传50MB以内的文件</div>
- <div slot="file" slot-scope="{file}">
- <a :href="file.url">{{ file.name }}</a>
- <span class="el-upload-list__item-actions">
- <i class="el-icon-delete" @click="handlePictureRemove(file,fileUrlList)" />
- </span>
- </div>
- </el-upload>
- <div v-else>
- <div v-for="(item, index) in fileUrlList" :key="index">
- <a :href="item.url">{{ item.name }}</a>
- </div>
- </div>
- </el-form-item>
- </el-col>
- </el-row>
- <!-- <el-row>
- <el-col :span="12">
- <el-form-item prop="orderAmount" label="订单总金额(元)">
- <el-input v-model="form.orderAmount" type="number" placeholder="请输入" :readonly="formDisable" />
- </el-form-item>
- </el-col>
- <el-col :span="3" class="col-txt"><span /></el-col>
- <el-col :span="12">
- <el-form-item prop="taxRate" label="税率(%)">
- <el-select v-model="form.taxRate" placeholder="请选择" :disabled="formDisable">
- <el-option
- v-for="item in dc_data.PURCHASE_TAX_RATE"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-form-item prop="amountBelong" label="费用|成本归属">
- <el-select
- ref="amountBelong"
- v-model="form.amountBelong"
- placeholder="请选择"
- :disabled="formDisable"
- @change="belongChange()"
- >
- <el-option
- v-for="item in belongData"
- :key="item.value"
- :label="item.value"
- :value="item.value"
- >
- <span style="float: left">{{ item.value }}</span>
- <span style="float: right; color: #8492a6; font-size: 13px">{{ item.type }}</span>
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item prop="payType" label="支付方式">
- <el-select v-model="form.payType" placeholder="请选择" :disabled="formDisable">
- <el-option
- v-for="item in dc_data.PAY_TYPE"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item prop="placeUser" label="下单人">
- <el-input v-model="form.placeUser" :disabled="formDisable" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-form-item prop="payContent" label="支付说明">
- <el-input v-model="form.payContent" type="textarea" :rows="3" :readonly="formDisable" />
- </el-form-item>
- </el-col>
- </el-row>-->
- </el-card>
- </el-col>
- </el-row>
- </el-form>
- <h3 v-show="formDisable">流程历史</h3>
- <el-card v-show="formDisable" style="padding: 15px 5px 5px 15px">
- <div class="tableDom">
- <el-table
- :data="historyList"
- :header-cell-style="{
- background:'#1890FF !important',
- color:'white'
- }"
- border
- style="width: 100%"
- >
- <el-table-column fixed label="序号" type="index" width="60" />
- <el-table-column
- label="节点名称"
- prop="nodeName"
- width="180"
- />
- <el-table-column
- label="处理人"
- prop="auditUserName"
- width="180"
- />
- <el-table-column
- label="审核结果"
- prop="auditResultString"
- />
- <el-table-column
- label="审核意见"
- prop="auditContent"
- />
- <el-table-column
- label="发起/审核时间"
- prop="createdAt"
- >
- <template slot-scope="scope">
- {{ $common.transTime(scope.row.createdAt) }}
- </template>
- </el-table-column>
- </el-table>
- </div>
- </el-card>
- <h3 v-if="isAudit">处理</h3>
- <el-card v-if="isAudit" shadow="always" style="padding: 15px 5px 5px 15px">
- <el-form
- ref="confirmForm"
- :model="confirmForm"
- class="cost_form"
- label-width="100px"
- style="width: 100%;padding: 5px"
- >
- <el-row :gutter="10">
- <el-col :span="24">
- <el-form-item label="处理结果" style="margin-bottom: 15px">
- <el-radio-group v-model="confirmForm.confirmResult">
- <el-radio :label="1">同意</el-radio>
- <el-radio v-if="agreeNoStatus" :label="2">退回发起人</el-radio>
- <el-radio v-if="agreeBackStatus" :label="3">退回上节点</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="处理意见">
- <el-input v-model="confirmForm.confirmContent" style="margin-top:10px" type="textarea" />
- <el-dropdown size="mini" split-button trigger="hover" type="primary">
- 常用语选择
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item
- v-for="(item, index) in dc_data.COMMON_PHRASES"
- :key="index"
- @click.native="selectCommonPhrases(item.label)"
- >
- {{ item.label }}
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="审核人抄送">
- <user-select
- :default-select="confirmList"
- :multiple="true"
- class="cclist"
- @selectValue="parentMethod"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </el-card>
- </el-tab-pane>
- <el-tab-pane label="流程图" name="second">
- <div style="width: 100%">
- <el-row>
- <el-col :span="24">
- <div class="node_info">
- <div>节点说明:</div>
- <div v-for="(item, index) in nodeColor" :key="index" class="dis_flex">
- <div class="node_class" :style="{backgroundColor: item.nodeback}" />
- {{ item.name }}
- </div>
- </div>
- <div id="containerPurchase" ref="containerPurchase" style="width: 100%" />
- </el-col>
- </el-row>
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- <div slot="footer" style="text-align: right;padding-top: 10px">
- <el-button @click="closeDialog">{{ isDetail ? '关 闭' : '取 消' }}</el-button>
- <el-button v-show="!isDetail" :loading="btnLoading" type="primary" @click.native="confirmSubmit()">确 定</el-button>
- </div>
- </div>
- </template>
- <script>
- import { upload } from '@/static/utils/channel'
- import Base from '@/views/base/base'
- import UserSelect from '@/views/components/UserSelect'
- import constant from '@/static/utils/constant'
- import * as echarts from 'echarts'
- const lineStyle = {
- color: '#00116a',
- width: 2
- }
- export default {
- name: 'ApplyPurchase',
- components: { UserSelect },
- mixins: [Base],
- data() {
- return {
- loading: false,
- btnLoading: false,
- activeName: 'first',
- dc_key: ['PURCHASE_TAX_RATE', 'PAY_TYPE', 'COMMON_PHRASES'],
- form: {
- id: '',
- purchaseCode: '',
- proId: '',
- customerId: '',
- placeDate: this.$common.transDate(new Date(), constant.DATE_PATTERN.DATE_TIME_h),
- requireCompleteTime: '',
- // supplierId: '',
- // contactUser: '',
- // orderAmount: '',
- // taxRate: '',
- // amountBelong: '',
- // amountBelongType: '',
- // payType: '',
- // placeUser: this.$common.currUser() ? this.$common.currUser().truename : '',
- purchaseContent: '',
- purchaseFile: '',
- // payContent: ''
- },
- rules: {
- proId: [{ required: true, message: '请选择项目', trigger: 'change' }],
- purchaseContent: [{ required: true, message: '请输入采购内容', trigger: 'blur' }],
- // supplierId: [{ required: true, message: '请选择供应商', trigger: 'change' }],
- // orderAmount: [{ required: true, message: '请输入订单总金额(员)', trigger: 'blur' }],
- // taxRate: [{ required: true, message: '请选择税率(%)', trigger: 'change' }],
- // payContent: [{ required: true, message: '请输入支付说明', trigger: 'blur' }]
- },
- proData: [],
- belongData: [],
- supplierData: [],
- fileUrlList: [],
- selectList: [],
- linesData: [],
- id: '',
- isAudit: false,
- isAgain: false,
- isDetail: false,
- formDisable: false,
- confirmForm: {
- flowMainPushId: '',
- confirmContent: '',
- confirmResult: 1
- },
- flowRow: {},
- agreeNoStatus: false,
- agreeBackStatus: false,
- historyList: [],
- confirmList: [],
- nodeColor: [
- { name: '审核通过', nodeback: '#2A3980' },
- { name: '未经过', nodeback: '#999999' },
- { name: '退回', nodeback: '#E04242' },
- { name: '审核中', nodeback: '#E08E42' },
- { name: '撤回', nodeback: '#4294E0' }
- ]
- }
- },
- mounted() {
- this.initDict(this.dc_key).then((res) => {})
- // this.supplierRequest('listAllAndOaListAll', { supplierStatus: '0' }).then(res => {
- // this.supplierData = res.data || []
- // })
- },
- methods: {
- initData(id, isAudit, isDetail, isAgain, flowRow) {
- this.id = id
- this.isAudit = isAudit || false
- this.isDetail = isDetail || false
- this.isAgain = isAgain || false
- this.formDisable = (isAudit || isDetail)
- this.flowRow = flowRow || {}
- if (this.isAudit) {
- this.confirmForm.flowMainPushId = this.flowRow.flowMainPushId
- const data = { flowMainPushId: this.flowRow.flowMainPushId }
- this.flowMainRequest('getOutgoingFlowsByFlowMainPushId', data).then(res => {
- if (res.data) {
- res.data.forEach(item => {
- if (item.conditionExpression === '${agree==\'no\'}') {
- this.agreeNoStatus = true
- }
- if (item.conditionExpression === '${agree==\'back\'}') {
- this.agreeBackStatus = true
- }
- })
- }
- })
- }
- if (this.formDisable) {
- const data = { flowMainId: this.flowRow.id }
- this.flowMainRequest('getFlowHistroyByFlowMainId', data).then(res => {
- this.historyList = res.data || []
- })
- } else {
- this.ourOrderMainRequest('getSelectProject', {}).then(res => {
- this.proData = res.data || []
- })
- }
- if (id) {
- this.getData()
- } else {
- this.getCGNo()
- }
- },
- getData() {
- this.loading = true
- this.baseRequest('getById', { id: this.id }).then(res => {
- if (res.data) {
- this.form = res.data
- if (this.form.purchaseFile) {
- this.fileUrlList = JSON.parse(this.form.purchaseFile)
- }
- // this.getBelongData()
- }
- this.loading = false
- })
- },
- closeDialog() {
- this.$emit('closeDialog', false)
- },
- handleClick(tab, event) {
- if (this.activeName === 'second') this.createNodeCanvas(this.flowRow)
- },
- getCGNo() {
- this.baseRequest('getCGNo', {}).then((res) => {
- if (res.data) {
- this.form.purchaseCode = res.data.msg
- }
- })
- },
- selectProMain() {
- this.form.proName = ''
- this.form.custName = ''
- this.form.customerId = ''
- // this.form.amountBelong = ''
- // this.form.amountBelongType = ''
- const obj = this.proData.find(item => item.id === this.form.proId)
- if (obj) {
- this.form.proName = obj.proname
- this.form.custName = obj.custname
- this.form.customerId = obj.custid
- }
- // if (this.form.proId) {
- // this.getBelongData()
- // } else {
- // this.belongData = []
- // }
- },
- getBelongData() {
- this.belongData = []
- this.ourOrderMainRequest('getBelongData', { proId: this.form.proId }).then(res => {
- this.belongData = res.data || []
- })
- },
- changeSupplier(val) {
- const obj = this.supplierData.find(x => x.id === val)
- if (obj) {
- this.form.contactUser = obj.contactUser
- } else {
- this.form.contactUser = ''
- }
- },
- uploadFile(param) {
- upload(param, true).then((res) => {
- if (res.key === 200) {
- this.fileUrlList.push(res)
- this.form.purchaseFile = JSON.stringify(this.fileUrlList)
- this.$message.info('文件上传成功')
- } else {
- const uid = param.file.uid
- const idx = this.$refs.upload.uploadFiles.findIndex(item => item.uid === uid)
- this.$refs.upload.uploadFiles.splice(idx, 1)
- this.$message.error('文件上传失败')
- }
- }).catch(() => {
- this.$message.error('文件上传异常!')
- const uid = param.file.uid
- const idx = this.$refs.upload.uploadFiles.findIndex(item => item.uid === uid)
- this.$refs.upload.uploadFiles.splice(idx, 1)
- })
- },
- belongChange() {
- const obj = this.belongData.find(item => item.value === this.form.amountBelong)
- if (obj) {
- this.form.amountBelongType = obj.type
- } else {
- this.form.amountBelongType = ''
- }
- },
- selectCommonPhrases(e) {
- if (!this.confirmForm.confirmContent) this.confirmForm.confirmContent = ''
- this.confirmForm.confirmContent += e
- },
- parentMethod(val) {
- if (val.length > 0) {
- this.form.ccList = val.join(',')
- }
- },
- confirmSubmit() {
- this.$refs.form.validate((valid) => {
- if (valid) {
- let formData
- let url
- let successMsg
- if (this.isAudit) {
- formData = { ...this.confirmForm }
- url = 'auditApplyPurchase'
- successMsg = '处理成功'
- } else if (this.isAgain) {
- formData = { ...this.form, flowMainId: this.flowRow.id }
- this.$delete(formData, 'flowMainCcList')
- url = 'reApplyPurchase'
- successMsg = '流程发起成功'
- } else {
- formData = { ...this.form }
- url = 'addApplyPurchase'
- successMsg = '流程发起成功'
- }
- this.btnLoading = true
- this.baseRequest(url, formData).then(res => {
- this.btnLoading = false
- if (res.data.key === 200) {
- this.$message.success(successMsg)
- this.$emit('closeDialog', true)
- } else {
- this.$message.error(res.data.msg)
- }
- })
- }
- })
- },
- async createNodeCanvas(row) {
- const node = [ // 节点
- {
- nodeKey: 'curr_user',
- name: '申请人发起',
- value: [45, 250],
- symbol: 'image://' + require('../asste/huifangkuai.png'),
- symbolSize: [110, 60]
- },
- {
- nodeKey: 'dept_superior_1_0_1',
- name: '直接上级审核',
- value: [125, 250],
- symbol: 'image://' + require('../asste/huifangkuai.png'),
- symbolSize: [110, 60]
- },
- {
- nodeKey: 'dept_head_1_0_1',
- name: '部门负责人审核',
- value: [205, 250],
- symbol: 'image://' + require('../asste/huifangkuai.png'),
- symbolSize: [110, 60]
- },
- {
- nodeKey: 'flow_fgld_1_0_1',
- name: '分管领导审核',
- value: [285, 250],
- symbol: 'image://' + require('../asste/huifangkuai.png'),
- symbolSize: [110, 60]
- },
- {
- nodeKey: 'flow_sjfgld_1_0_1',
- name: '上级分管领导\n审核',
- value: [365, 250],
- symbol: 'image://' + require('../asste/huifangkuai.png'),
- symbolSize: [110, 60]
- },
- {
- nodeKey: 'flow_zyld_1_0_1',
- name: '主要领导\n审核',
- value: [445, 250],
- symbol: 'image://' + require('../asste/huifangkuai.png'),
- symbolSize: [110, 60]
- },
- {
- nodeKey: 'flow_cgzy_1_0_1',
- name: '采购专员\n审核',
- value: [525, 250],
- symbol: 'image://' + require('../asste/huifangkuai.png'),
- symbolSize: [110, 60]
- },
- {
- name: '结束',
- value: [525, 100],
- symbol: 'image://' + require('../asste/huifangkuai.png'),
- symbolSize: [110, 60]
- },
- {
- label: {
- show: true,
- color: 'red', // 节点文字颜色
- backgroundColor: '#f5f5f5'
- },
- itemStyle: {
- color: '#f5f5f5'
- },
- name: '退回发起人 ',
- value: [450, 600],
- symbolSize: [70, 20]
- },
- {
- label: {
- show: true,
- color: 'red', // 节点文字颜色
- backgroundColor: '#f5f5f5'
- },
- itemStyle: {
- color: '#f5f5f5'
- },
- name: '退回发起人',
- value: [350, 550],
- symbolSize: [70, 20]
- },
- {
- label: {
- show: true,
- color: 'red', // 节点文字颜色
- backgroundColor: '#f5f5f5'
- },
- itemStyle: {
- color: '#f5f5f5'
- },
- name: ' 退回发起人 ',
- value: [300, 500],
- symbolSize: [20, 20]
- },
- {
- label: {
- show: true,
- color: 'red', // 节点文字颜色
- backgroundColor: '#f5f5f5'
- },
- itemStyle: {
- color: '#f5f5f5'
- },
- name: ' 退回发起人 ',
- value: [250, 450],
- symbolSize: [20, 20]
- },
- {
- label: {
- show: true,
- color: 'red', // 节点文字颜色
- backgroundColor: '#f5f5f5'
- },
- itemStyle: {
- color: '#f5f5f5'
- },
- name: ' 退回发起人 ',
- value: [250, 450],
- symbolSize: [20, 20]
- },
- {
- label: {
- show: true,
- color: 'red', // 节点文字颜色
- backgroundColor: '#f5f5f5'
- },
- itemStyle: {
- color: '#f5f5f5'
- },
- name: ' 退回发起人 ',
- value: [175, 400],
- symbolSize: [20, 20]
- },
- {
- label: {
- show: true,
- color: 'red', // 节点文字颜色
- backgroundColor: '#f5f5f5'
- },
- itemStyle: {
- color: '#f5f5f5'
- },
- name: ' 退回发起人 ',
- value: [100, 350],
- symbolSize: [20, 20]
- }
- ]
- this.linesData = [ // 连线
- {
- nodeKey: 'curr_user',
- lineStyle: lineStyle,
- coords: [[45, 250], [105, 250]]
- },
- {
- nodeKey: 'dept_superior_1_0_1',
- lineStyle: lineStyle,
- coords: [[125, 250], [185, 250]]
- },
- {
- nodeKey: 'dept_head_1_0_1',
- lineStyle: lineStyle,
- coords: [[205, 250], [265, 250]]
- },
- {
- nodeKey: 'flow_fgld_1_0_1',
- lineStyle: lineStyle,
- coords: [[285, 250], [345, 250]]
- },
- {
- nodeKey: 'flow_sjfgld_1_0_1',
- lineStyle: lineStyle,
- coords: [[365, 250], [425, 250]]
- },
- {
- nodeKey: 'flow_zyld_1_0_1',
- lineStyle: lineStyle,
- coords: [[445, 250], [505, 250]]
- },
- {
- nodeKey: 'flow_zyld_1_0_1_back',
- lineStyle: lineStyle,
- coords: [[450, 250], [450, 550]],
- symbol: 'none'
- },
- {
- nodeKey: 'flow_sjfgld_1_0_1_back',
- lineStyle: lineStyle,
- coords: [[370, 250], [370, 500]],
- symbol: 'none'
- },
- {
- nodeKey: 'flow_fgld_1_0_1_back',
- lineStyle: lineStyle,
- coords: [[290, 250], [290, 450]],
- symbol: 'none'
- },
- {
- nodeKey: 'dept_head_1_0_1_back',
- lineStyle: lineStyle,
- coords: [[210, 250], [210, 400]],
- symbol: 'none'
- },
- {
- nodeKey: 'dept_superior_1_0_1_back',
- lineStyle: lineStyle,
- coords: [[130, 250], [130, 350]],
- symbol: 'none'
- },
- {
- nodeKey: 'flow_cgzy_1_0_1_back',
- lineStyle: lineStyle,
- coords: [[50, 250], [50, 600]],
- symbol: 'none'
- },
- {
- nodeKey: 'flow_zyld_1_0_1_back',
- lineStyle: lineStyle,
- coords: [[450, 550], [50, 550]],
- symbol: 'none'
- },
- {
- nodeKey: 'flow_sjfgld_1_0_1_back',
- lineStyle: lineStyle,
- coords: [[370, 500], [50, 500]],
- symbol: 'none'
- },
- {
- nodeKey: 'flow_fgld_1_0_1_back',
- lineStyle: lineStyle,
- coords: [[290, 450], [50, 450]],
- symbol: 'none'
- },
- {
- nodeKey: 'dept_head_1_0_1_back',
- lineStyle: lineStyle,
- coords: [[210, 400], [50, 400]],
- symbol: 'none'
- },
- {
- nodeKey: 'dept_superior_1_0_1_back',
- lineStyle: lineStyle,
- coords: [[130, 350], [50, 350]],
- symbol: 'none'
- },
- {
- nodeKey: 'flow_cgzy_1_0_1_back',
- lineStyle: lineStyle,
- coords: [[50, 600], [530, 600]],
- symbol: 'none'
- },
- {
- nodeKey: 'flow_cgzy_1_0_1_back',
- lineStyle: lineStyle,
- coords: [[530, 600], [530, 250]],
- symbol: 'none'
- },
- {
- lineStyle: lineStyle,
- coords: [[530, 250], [530, 130]]
- }
- ]
- if (row.id) {
- const { data } = await this.flowMainRequest('getIMGFlowHistroyByFlowMainId', { flowMainId: row.id })
- for (let i = 0; i < data.length; i++) {
- const index = node.findIndex((e) => e.nodeKey === data[i].nodeKey)
- switch (data[i].nodeKey) {
- case 'curr_user':
- if (data[i].type === '1') {
- this.getImgUrl(index, data[i].type, node)
- this.getLineStyle(data[i].nodeKey)
- }
- break
- case 'dept_superior_1_0_1':
- if (data[i].type === '1' || data[i].type === '3') {
- this.getImgUrl(index, data[i].type, node)
- }
- if (data[i].type === '1') {
- this.getLineStyle(data[i].nodeKey)
- }
- if (data[i].type === '2') {
- this.getLineStyle('dept_superior_1_0_1_back')
- this.getImgUrl(index, data[i].type, node)
- }
- break
- case 'dept_head_1_0_1':
- if (data[i].type === '1' || data[i].type === '3') {
- this.getImgUrl(index, data[i].type, node)
- }
- if (data[i].type === '1') {
- this.getLineStyle(data[i].nodeKey)
- }
- if (data[i].type === '2') {
- this.getLineStyle('dept_head_1_0_1_back')
- this.getLineStyle('dept_superior_1_0_1_back')
- this.getImgUrl(index, data[i].type, node)
- }
- break
- case 'flow_fgld_1_0_1':
- this.getImgUrl(index, data[i].type, node)
- if (data[i].type === '1') {
- this.getLineStyle('flow_fgld_1_0_1')
- }
- if (data[i].type === '2') {
- this.getLineStyle('flow_fgld_1_0_1_back')
- this.getLineStyle('dept_superior_1_0_1_back')
- this.getLineStyle('dept_head_1_0_1_back')
- }
- break
- case 'flow_sjfgld_1_0_1':
- this.getLineStyle(data[i].nodeKey)
- this.getImgUrl(index, data[i].type, node)
- if (data[i].type === '2') {
- this.getLineStyle('flow_sjfgld_1_0_1_back')
- this.getLineStyle('flow_fgld_1_0_1_back')
- this.getLineStyle('dept_head_1_0_1_back')
- this.getLineStyle('dept_superior_1_0_1_back')
- }
- break
- case 'flow_zyld_1_0_1':
- if (data[i].type === '1') {
- this.getLineStyle(data[i].nodeKey)
- this.getImgUrl(index, data[i].type, node)
- }
- if (data[i].type === '2') {
- this.getLineStyle('flow_zyld_1_0_1_back')
- this.getLineStyle('flow_sjfgld_1_0_1_back')
- this.getLineStyle('flow_fgld_1_0_1_back')
- this.getLineStyle('dept_head_1_0_1_back')
- this.getLineStyle('dept_superior_1_0_1_back')
- this.getLineStyle('flow_sjfgld_1_0_1_back')
- }
- break
- case 'flow_cgzy_1_0_1':
- this.getImgUrl(index, data[i].type, node)
- if (data[i].type === '1') {
- this.getLineStyle(data[i].nodeKey)
- const endIndex = node.findIndex((e) => e.name === '结束')
- this.getImgUrl(endIndex, '1', node)
- }
- if (data[i].type === '2') {
- this.getLineStyle('flow_cgzy_1_0_1_back')
- this.getLineStyle('flow_zyld_1_0_1_back')
- this.getLineStyle('flow_sjfgld_1_0_1_back')
- this.getLineStyle('flow_fgld_1_0_1_back')
- this.getLineStyle('dept_head_1_0_1_back')
- this.getLineStyle('dept_superior_1_0_1_back')
- this.getLineStyle('flow_sjfgld_1_0_1_back')
- }
- break
- default:
- }
- }
- }
- this.$nextTick(() => {
- const chartDom = document.getElementById('containerPurchase')
- var myCharts = echarts.init(chartDom)
- const charts = {
- nodes: node,
- linesData: this.linesData
- }
- const option = {
- xAxis: {
- min: 0,
- max: 600,
- padding: [0, 50, 0, 50],
- show: false,
- type: 'value'
- },
- yAxis: {
- min: 0,
- max: 650,
- show: false,
- type: 'value'
- },
- grid: {
- left: 50,
- right: 0,
- bottom: 0,
- top: 0
- },
- series: [
- {
- type: 'graph',
- coordinateSystem: 'cartesian2d',
- symbol: 'rect',
- symbolSize: [80, 40],
- itemStyle: {
- color: 'rgb(225,7,7)'
- },
- symbolOffset: [10, 0],
- // force: {
- // edgeLength: 100,//连线的长度
- // repulsion: 200 //子节点之间的间距
- // },
- label: {
- show: true,
- color: 'white' // 节点文字颜色
- },
- data: charts.nodes
- },
- {
- type: 'lines',
- polyline: false,
- coordinateSystem: 'cartesian2d',
- symbol: ['', 'arrow'],
- symbolSize: 10,
- data: charts.linesData
- }
- ]
- }
- myCharts.clear()
- myCharts.setOption(option)
- window.addEventListener('resize', () => {
- myCharts.resize()
- })
- })
- },
- getLineStyle(nodeKey) {
- for (let i = 0; i < this.linesData.length; i++) {
- if (this.linesData[i].nodeKey === nodeKey) {
- this.linesData[i].lineStyle = {
- color: '#2A3980',
- width: 2
- }
- }
- }
- },
- getImgUrl(index, type, node) {
- if (index === -1) return
- switch (type) {
- case '1':
- node[index].symbol = 'image://' + require('../asste/lanfangkuai.png')
- break
- case '2':
- node[index].symbol = 'image://' + require('../asste/hongfangkuai.jpg')
- break
- case '3':
- node[index].symbol = 'image://' + require('../asste/huangfanmgkuai.png')
- break
- case '4' || '5':
- node[index].symbol = 'image://' + require('../asste/qianlanfangkuai.jpg')
- break
- default:
- }
- },
- baseRequest(opUrl, postData) {
- return this.$channel.globleRequest('ApplyPurchaseController', opUrl, postData, 'project task')
- },
- flowMainRequest(opUrl, postData) {
- return this.$channel.globleRequest('FlowMainController', opUrl, postData, 'project')
- },
- ourOrderMainRequest(opUrl, postData) {
- return this.$channel.globleRequest('OutOrderMainController', opUrl, postData, 'project')
- },
- supplierRequest(opUrl, postData) {
- return this.$channel.globleRequest('SupplierController', opUrl, postData, 'project')
- }
- }
- }
- </script>
- <style lang="scss">
- #containerPurchase {
- width: 100%;
- height: 600px;
- background: #F5F5F5;
- }
- .cclist {
- .col-input {
- padding: 0;
- }
- }
- .mb25 {
- margin-bottom: 25px;
- }
- .pdtopbottom16 {
- padding: 0px 16px;
- }
- .pdtop16px {
- padding-top: 16px;
- }
- .cost_form {
- .col-input {
- font-weight: 400;
- }
- .el-form-item__label .moneydetails {
- text-align: right;
- font-size: 16px;
- font-family: 微软雅黑;
- padding-right: 10px;
- line-height: 40px;
- word-break: keep-all;
- white-space: nowrap;
- color: #606266;
- text-rendering: optimizeLegibility;
- font-weight: 400;
- }
- .moneydetails {
- text-align: right;
- font-size: 16px;
- font-family: 微软雅黑;
- padding-right: 10px;
- word-break: keep-all;
- white-space: nowrap;
- color: #606266;
- text-rendering: optimizeLegibility;
- font-weight: 400;
- }
- .moneydetails:before {
- content: "*";
- color: #ff4949;
- }
- }
- .txtc {
- text-align: center
- }
- .ml5 {
- margin-left: 5px;
- }
- .eltype {
- margin-bottom: 5px;
- }
- .tabsdomPurchase {
- .el-tabs__header {
- text-align: center !important;
- width: 139px !important;
- text-align: center !important;
- display: block !important;
- margin: auto !important;
- margin-bottom: 15px !important;
- }
- .el-tabs__nav-wrap::after {
- display: none;
- }
- .el-upload {
- width: 100%;
- text-align: left;
- }
- }
- .feeMoneyTotal {
- width: 100%;
- height: 14px;
- font-size: 14px;
- font-weight: 400;
- color: #1890FF;
- margin-top: 31px;
- margin-bottom: 13px;
- }
- </style>
|