Browse Source

添加预算计划采购查看库存代码

dev
long 2 years ago
parent
commit
8341f2c1c9
  1. 171
      src/views/activiti/form/ProcessUdgetPlanForm.vue

171
src/views/activiti/form/ProcessUdgetPlanForm.vue

@ -128,32 +128,43 @@
</a-tooltip>
<!-- <a-button @click="chaKan(props)">查看</a-button>-->
</template>
<template v-slot:actionPrice="props" >
<a-tooltip placement="top" >
<template v-slot:title="props" >
<p v-for="(item,index) in historyPrices" :key="index">历史价格{{ item.price }} 历史数量{{item.quantity}} 修改人{{item.createBy_dictText}}</p>
<template v-slot:actionPrice="props">
<a-tooltip placement="top">
<template v-slot:title="props">
<p v-for="(item,index) in historyPrices" :key="index">历史价格{{ item.price }} 历史数量{{item.quantity}}
修改人{{item.createBy_dictText}}</p>
</template>
<a-button @mouseenter="seeHistoryPrice(props)">记录</a-button>
</a-tooltip>
<!-- <a-button @click="chaKan(props)">查看</a-button>-->
</template>
<template v-slot:materialWateNumber="props">
<a-tooltip placement="top">
<template v-slot:title="props">
库存数{{ wateNumber }}
</template>
<a-button @mouseenter="seeWateNumber(props)">库存</a-button>
</a-tooltip>
<!-- <a-button @click="chaKan(props)">查看</a-button>-->
</template>
</p-editable-table>
</a-tab-pane>
</a-tabs>
<!-- <j-form-container >
<a-form :form="form">
<a-row>
<a-col :span="24" >
<a-form-item label="流程说明" >
<j-editor v-decorator="[ 'opinion', {} ]" triggerChange></j-editor>
&lt;!&ndash;<a-input type="textarea" v-decorator="[ 'opinion' ]" :rows="4" />&ndash;&gt;
</a-form-item>
</a-col>
</a-row>
</a-form>
</j-form-container>-->
<!-- <j-form-container >
<a-form :form="form">
<a-row>
<a-col :span="24" >
<a-form-item label="流程说明" >
<j-editor v-decorator="[ 'opinion', {} ]" triggerChange></j-editor>
&lt;!&ndash;<a-input type="textarea" v-decorator="[ 'opinion' ]" :rows="4" />&ndash;&gt;
</a-form-item>
</a-col>
</a-row>
</a-form>
</j-form-container>-->
<div class="div_process">
<div v-if="isGetOneAndLast">
@ -181,6 +192,8 @@
<script>
import Template1 from '../../jeecg/JVxeDemo/layout-demo/Template1'
const VALIDATE_NO_PASSED = Symbol()
import pick from 'lodash.pick'
import { getAction, httpAction, getCurrentTime, getStringArry, getRecord, downFile } from '@/api/manage'
@ -235,6 +248,7 @@
name: 'ProcessUdgetPlanForm',
mixins: [JEditableTableMixin],
components: {
Template1,
JFormContainer,
JDate,
JUpload,
@ -255,7 +269,7 @@
// editingKey: '',
isabled: true,
isGetOneAndLast: false,
isIfDirect:false,
isIfDirect: false,
bigId: [],
opinion: '',
bigIdRake: [],
@ -267,11 +281,11 @@
describes: '',
hiegs: true,
historyBigId: [],
historyPrices:[],
historyPrice:{
},
historyPrices: [],
wateNumber: 0,
historyPrice: {},
isHistoryBigId: false,
isIfInspection:false,
isIfInspection: false,
bigIdMerchandiseNews: [],
bigIdMerchandiseNewsList: [],
labelCol: {
@ -459,6 +473,17 @@
slotName: 'actionPrice'
// scopedSlots: {customRender: 'fileSlot'}
},
{
title: '库存数量',
key: 'materialWateNumber',
type: FormTypes.slot,
disabled: this.disabled,
width: '80px',
// placeholder: '${title}',
// defaultValue: '',
slotName: 'materialWateNumber'
// scopedSlots: {customRender: 'fileSlot'}
},
{
title: '数量',
key: 'materialQuantity',
@ -536,7 +561,8 @@
descriptionRake: '/description/processDescription/descriptionName',
merchandiseNewsList: '/merchandisenews/processMerchandiseNews/merchandiseNewsList',
historyUrl: '/suppliesstronger/processSuppliesStronger/list',
priceQuantityHistory:'/hy/priceQuantityHistory/list',
stock: '/suppliesstronger/processSuppliesStronger/stock',
priceQuantityHistory: '/hy/priceQuantityHistory/list',
getFirstNode: '/actProcessIns/getFirstNode',
processUdgetPlanMaterial: {
list: '/hy/processUdgetPlan/queryProcessUdgetPlanMaterialByMainId'
@ -581,7 +607,7 @@
isPlanType: { type: Boolean, default: false, required: false },
/*资金来源*/
isSourceCapital: { type: Boolean, default: false, required: false },
routePlanName:{type:String,default:'',required: false},
routePlanName: { type: String, default: '', required: false },
//data
formData: {
type: Object,
@ -787,20 +813,20 @@
}
},
async seeHistoryPrice(log){
this.historyPrices=[];
async seeHistoryPrice(log) {
this.historyPrices = []
console.log(log)
let param={
relationId:log.rowId,
let param = {
relationId: log.rowId,
pageSize: 5
}
getAction(this.url.priceQuantityHistory, param).then((res) => {
console.log(res);
console.log(res)
if (res.success) {
res.result.records.forEach(item => {
if (parseInt(res.result.total) > 0) {
this.isHistoryBigId = true
console.log(item.createBy_dictText);
console.log(item.createBy_dictText)
this.historyPrices.push(item)
}
@ -809,12 +835,33 @@
}
})
},
async seeWateNumber(log) {
//
//this.assigneesText
console.log(this.assigneesText)
let pas = await log.target.getValuesPromise(log.rowIds)
if (pas[log.index].materialNumber !== '' && pas[log.index].materialNumber !== null) {
//
let par = {
merchandiseNewsId: pas[log.index].materialNumber,
materialType: this.assigneesText
}
getAction(this.url.stock, par).then((res) => {
// console.log(res);
if (res.success) {
this.wateNumber = res.result.materialQuantity
console.log(res, '----------------')
}
})
}
},
//
async chaKan(log) {
// console.log("00000000",log);
let pas = await log.target.getValuesPromise(log.rowIds)
// console.log("111111111",log.rowIds);
// console.log("222222222222",pas);
console.log('222222222222', pas)
if (pas[log.index].materialNumber !== '' && pas[log.index].materialNumber !== null) {
this.historyBigId = []
//
@ -1142,11 +1189,11 @@
this.isBu = undefined
},
selectChang(val){
if (val==1){
this.isIfInspection=true;
}else {
this.isIfInspection=false;
selectChang(val) {
if (val == 1) {
this.isIfInspection = true
} else {
this.isIfInspection = false
}
},
/*回显数据*/
@ -1170,23 +1217,23 @@
// this.fetchDataRake();
this.descriptionFetchDatas()
}
if (this.isPlanType && this.routePlanName=='采购员'){
if (this.isPlanType && this.routePlanName == '采购员') {
if (res.result.materialType == 1) {
this.isTargetLibrary = true
}
if (res.result.materialType!=6){
if (res.result.planType==1){
this.isIfDirect=true
if (res.result.materialType != 6) {
if (res.result.planType == 1) {
this.isIfDirect = true
//isIfInspection
if (res.result.ifDirect==1){
this.isIfInspection=true
if (res.result.ifDirect == 1) {
this.isIfInspection = true
}
}else {
this.isIfDirect=false
} else {
this.isIfDirect = false
}
}else {
this.isIfDirect=false
} else {
this.isIfDirect = false
}
}
@ -1252,9 +1299,9 @@
}
}
formData.fileId = getStringArry(formData.fileId)
if (this.materialPrice != 0 && this.materialPrice != null) {
formData.materialPrice = this.materialPrice
}
if (this.materialPrice != 0 && this.materialPrice != null) {
formData.materialPrice = this.materialPrice
}
formData.describes = this.describes
if (new Date(formData.createTime).getTime() / 100 > new Date(formData.needTime).getTime() / 100) {
this.$message.error('需求时间不能小于当前流程发起时间')
@ -1282,14 +1329,14 @@
formData.title = this.processData.title
formData.processInstanceId = this.processData.id
}
if(formData.planType==1 && formData.materialType !=6){
if (formData.planType == 1 && formData.materialType != 6) {
console.log('格式化后的数据', formData)
if (formData.ifDirect==null){
if (formData.ifDirect == null) {
this.$message.error('请选择是否属于直达物资!')
return
}else {
if(formData.ifDirect==1){
if (formData.ifInspection==null){
} else {
if (formData.ifDirect == 1) {
if (formData.ifInspection == null) {
this.$message.error('请选择是否需要送检!')
return
}
@ -1336,7 +1383,7 @@
}
console.log(this.data, '数据回显')
let fieldval = pick(this.data, 'id', 'planType', 'company', 'createTime', 'departId', 'createBy', 'materialType', 'processPlan', 'needTime', 'sort', 'orderNumber', 'fileId', 'opinion', 'sourceCapital','ifDirect','ifInspection')
let fieldval = pick(this.data, 'id', 'planType', 'company', 'createTime', 'departId', 'createBy', 'materialType', 'processPlan', 'needTime', 'sort', 'orderNumber', 'fileId', 'opinion', 'sourceCapital', 'ifDirect', 'ifInspection')
this.$nextTick(() => {
this.assigneesText = this.data.materialType
this.form.setFieldsValue(fieldval)
@ -1449,8 +1496,8 @@
this.$message.error('请选择采购类型')
return
} else {
this.passTask();
this.handleSubmit(true);
this.passTask()
this.handleSubmit(true)
}
}
})
@ -1507,14 +1554,14 @@
url = this.url.edit
method = 'put'
}
if(formData.planType==1 && formData.materialType !=6){
if (formData.planType == 1 && formData.materialType != 6) {
console.log('格式化后的数据', formData)
if (formData.ifDirect==null){
if (formData.ifDirect == null) {
this.$message.error('请选择是否属于直达物资!')
return
}else {
if(formData.ifDirect==1){
if (formData.ifInspection==null){
} else {
if (formData.ifDirect == 1) {
if (formData.ifInspection == null) {
this.$message.error('请选择是否需要送检!')
return
}
@ -1527,7 +1574,7 @@
httpAction(url, formData, method).then((res) => {
if (res.success) {
//todo
if(e!=true){
if (e != true) {
this.$emit('afterSubmit', formData)
}
} else {

Loading…
Cancel
Save