Browse Source

修改出货流程显示

dev
caoyizhong 2 years ago
parent
commit
5e04f49e7d
  1. 264
      src/views/activiti/form/ProcessMaterialsDeliveryForm.vue
  2. 9
      src/views/suppliesstronger/ProcessSuppliesStrongerList.vue
  3. 36
      src/views/suppliesstronger/modules/ProcessSuppliesStrongerForm.vue

264
src/views/activiti/form/ProcessMaterialsDeliveryForm.vue

@ -60,7 +60,14 @@
@valueChange ="onSelect"
:rowNumber="true"
:rowSelection="true"
:actionButton="true"/>
:actionButton="true"
@added="addid"
>
<!-- <template v-slot:qing="props">-->
<!-- <a-input v-decorator="['pleaseSendNumber']" placeholder="请输入" style="width: 100%" @change="shuru" type="number"/>-->
<!-- </template>-->
</j-editable-table>
</a-tab-pane>
</a-tabs>
<div class="div_process">
@ -104,8 +111,8 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany'
},
data() {
return {
accountingAttributesVal: '',
heid: true,
addId : '',
bigIdMerchandiseNewsList:[],
labelCol: {
xs: { span: 24 },
@ -194,6 +201,7 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany'
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
// slotName: 'qing'
},
{
title: '实发数',
@ -334,24 +342,29 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany'
console.log(userInfo)
// userInfo.company=company;
this.popupCallback(company,userInfo);
this.fetchData();
},
methods: {
//
addid(val){
this.addId = val.row.id;
// console.log(this.addId);
},
//
isMaterialType(val){
if(val !== undefined){
this.accountingAttributesVal = val;
this.heid = false;
this.fetchData(val);
}
// console.log("l",val);
},
//table
onSelect(record) {
console.log(record)
async onSelect(record) {
// console.log(record)
if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.equipment === ''){
// console.log("materialGroup")
this.fetchMerchandiseNews(record.row.materialGroup);
this.fetchMerchandiseNews(record.row.materialGroup,1);
}
if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.equipment !== ''){
if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.equipment !== '' && record.row.actualSendNumber === '' ){
// console.log("materialNumber")
let materialName = { }
this.bigIdMerchandiseNewsList.forEach( item => {
@ -361,7 +374,7 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany'
unit: item.materialsUnit,
supplierName: item.supplierName,
price: item.price,
residueNumber : item.residueNumber === undefined ? 0 : item.residueNumber,
// residueNumber : item.residueNumber === undefined ? 0 : item.residueNumber,
}
}
@ -376,96 +389,183 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany'
'materialUnit': materialName.unit,
'supplier': materialName.supplierName,
'materialPrice': materialName.price,
'actualSendNumber': materialName.residueNumber,
'materialAmount': materialName.price * materialName.residueNumber,
// 'actualSendNumber': materialName.residueNumber,
// 'materialAmount': materialName.price * materialName.residueNumber,
},
},
]
this.$refs.processMaterialsDeliveryList.setValues(values);
}
//
// if(record.row.pleaseSendNumber !== '' && record.row.materialPrice !== '' && record.row.pleaseSendNumber !== undefined && record.row.materialPrice !== undefined){
// // record.row.materialAmount = record.row.materialQuantity * record.row.materialPrice;
// let values = [
// {
// rowKey: record.row.id,
// values: {
// 'equipment': record.row.equipment,
// 'materialGroup': record.row.materialGroup,
// 'materialName': record.row.materialName,
// 'materialUnit': record.row.materialUnit,
// 'supplier': record.row.supplier,
// 'materialPrice': record.row.materialPrice,
// 'materialAmount': record.row.pleaseSendNumber * record.row.materialPrice,
// },
// },
// ]
// this.$refs.processMaterialsDeliveryList.setValues(values);
// }
let a = false;
let numberStar = 0;
let numberEnd = 0;
//
if(record.row.pleaseSendNumber !== '' && record.row.pleaseSendNumber !== undefined){
// record.row.materialAmount = record.row.materialQuantity * record.row.materialPrice;
let num = 0;
this.bigIdMerchandiseNewsList.forEach( item =>{
console.log("item",item);
numberStar = item.batch.substring(0,item.batch.indexOf("/"));
numberEnd = item.batch.slice(numberStar.length+1);
num = record.row.pleaseSendNumber - item.residueNumber;
if(num > 0){
//
record.row.pleaseSendNumber = item.residueNumber;
record.row.actualSendNumber = record.row.pleaseSendNumber;
this.$refs.processMaterialsDeliveryList.handleClickAdd();
a =true;
}else{
record.row.actualSendNumber = record.row.pleaseSendNumber;
// console.log("222" ,record.row.actualSendNumber);
}
});
let drop = record.row.materialGroup;
let values = [
{
rowKey: record.row.id,
values: {
'equipment': record.row.equipment,
'materialGroup': record.row.materialGroup,
'materialName': record.row.materialName,
'materialUnit': record.row.materialUnit,
'supplier': record.row.supplier,
'materialPrice': record.row.materialPrice,
'actualSendNumber': record.row.actualSendNumber,
'materialAmount': record.row.actualSendNumber * record.row.materialPrice,
'pleaseSendNumber' : record.row.pleaseSendNumber,
},
},
]
this.$refs.processMaterialsDeliveryList.setValues(values);
//
if(a){
let merchandiseNewser = {};
let merchandiseNews = {};
let is = false;
let onIs= false;
do{
// console.log("numberStar",parseInt(numberStar)+1)
merchandiseNewser =await this.fetchMerchandiseNews(drop,parseInt(numberStar)+1);
// console.log(merchandiseNewser);
merchandiseNewser.forEach( item => {
merchandiseNews = item;
});
// console.log(merchandiseNews);
let sum = num - merchandiseNews.residueNumber;
if( sum > 0 ){
// console.log("");
// console.log("numberEnd",numberEnd);
// console.log("merchandiseNews.batch.substring()",merchandiseNews.batch.substring(0,merchandiseNews.batch.indexOf("/")));
//
let isLose = parseInt(numberEnd) - parseInt( merchandiseNews.batch.substring(0,merchandiseNews.batch.indexOf("/")) );
if(isLose === 0 ){
onIs = true;
}else {
is = true;
numberStar = numberStar+1;
this.$refs.processMaterialsDeliveryList.handleClickAdd();
}
}else{
sum = num;
// console.log("");
is = false;
}
let values = [
{
rowKey: this.addId,
values: {
'equipment': record.row.equipment,
'materialGroup': record.row.materialGroup,
'materialName': record.row.materialName,
'materialUnit': record.row.materialUnit,
'supplier': record.row.supplier,
'materialPrice': record.row.materialPrice,
'actualSendNumber': sum,
'materialAmount': sum * record.row.materialPrice,
'pleaseSendNumber' : sum,
},
},
]
this.$refs.processMaterialsDeliveryList.setValues(values);
if(onIs){
this.$message.warn('没有更多批次了');
is = false;
return;
}
}while (is);
}
}
},
fetchMerchandiseNews(value){ //
fetchMerchandiseNews(value,batch){ //
//
let par = {
delFlag: 0,
descriptionId:value,
}
this.bigIdMerchandiseNews = [];
this.bigIdMerchandiseNewsList = [];
let qc = [];
let numberList = [];
if(this.processMaterialsDeliveryListTable.columns[1].options.length > 0){
this.processMaterialsDeliveryListTable.columns[1].options = [];
}
this.$refs.processMaterialsDeliveryList.getValues((a,b,c)=>{
// console.log(a,b,c)
b.forEach(item =>{
if(item.equipment !== '' && item.equipment !== undefined && item.equipment !== null){
numberList.push(item.materialNumber);
}
return new Promise((resolve, reject) => {
//
let par = {
delFlag: 0,
descriptionId:value,
batchNum: batch,
}
this.bigIdMerchandiseNews = [];
this.bigIdMerchandiseNewsList = [];
let qc = [];
let numberList = [];
if(this.processMaterialsDeliveryListTable.columns[1].options.length > 0){
this.processMaterialsDeliveryListTable.columns[1].options = [];
}
this.$refs.processMaterialsDeliveryList.getValues((a,b,c)=>{
// console.log(a,b,c)
b.forEach(item =>{
if(item.equipment !== '' && item.equipment !== undefined && item.equipment !== null){
numberList.push(item.materialNumber);
}
});
});
});
getAction(this.url.merchandiseNewsList,par).then((res)=>{
if(res.success){
console.log(res.result);
let newList = res.result;
// console.log("12312312:"+numberList.length);
if(numberList.length > 0){
newList.forEach( item => {
qc.push({
title : item.materialsNumber,
value : item.merchandiseNewsId,
disabled : false
getAction(this.url.merchandiseNewsList,par).then((res)=>{
if(res.success){
console.log(res.result);
let newList = res.result;
// console.log("12312312:"+numberList.length);
if(numberList.length > 0){
newList.forEach( item => {
qc.push({
title : item.materialsNumber,
value : item.merchandiseNewsId,
disabled : false
})
})
})
numberList.forEach( num => {
qc.forEach( i => {
if(num === i.value){
// console.log(num,i.value);
i.disabled = true;
}
});
})
this.processMaterialsDeliveryListTable.columns[1].options = qc;
}else{
newList.forEach( item => {
this.processMaterialsDeliveryListTable.columns[1].options.push({
title : item.materialsNumber,
value : item.merchandiseNewsId,
disabled : false
numberList.forEach( num => {
qc.forEach( i => {
if(num === i.value){
// console.log(num,i.value);
i.disabled = true;
}
});
})
})
this.processMaterialsDeliveryListTable.columns[1].options = qc;
}else{
newList.forEach( item => {
this.processMaterialsDeliveryListTable.columns[1].options.push({
title : item.materialsNumber,
value : item.merchandiseNewsId,
disabled : false
})
})
}
// console.log(this.processUdgetPlanMaterialTable.columns[1].options);
resolve(this.bigIdMerchandiseNewsList = res.result );
// return
}
// console.log(this.processUdgetPlanMaterialTable.columns[1].options);
this.bigIdMerchandiseNewsList = res.result;
}
});
});
},
fetchData(){ //
fetchData(value){ //
//
let par = {
delFlag: 0,
accountingAttributes: this.accountingAttributesVal,
accountingAttributes: value,
}
getAction(this.url.descriptionRake,par).then((res)=>{
if(res.success){

9
src/views/suppliesstronger/ProcessSuppliesStrongerList.vue

@ -35,6 +35,7 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('物资总库')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
@ -143,22 +144,22 @@
{
title:'物料组',
align:"center",
dataIndex: 'itemGroup'
dataIndex: 'descriptionName'
},
{
title:'物料',
align:"center",
dataIndex: 'item'
dataIndex: 'materialsNumber'
},
{
title:'物料描述',
align:"center",
dataIndex: 'itemDescription'
dataIndex: 'merchandiseName'
},
{
title:'计量单位',
align:"center",
dataIndex: 'unitMeasurement'
dataIndex: 'materialsUnit'
},
{
title:'数量',

36
src/views/suppliesstronger/modules/ProcessSuppliesStrongerForm.vue

@ -10,35 +10,35 @@
</a-col>
<a-col :span="8">
<a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['supplier']" placeholder="请输入供应商" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="供应商描述" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['supplierDescription']" type="list" :trigger-change="true" placeholder="请输入供应商描述" />
<a-input v-decorator="['supplierId']" placeholder="请输入供应商" />
</a-form-item>
</a-col>
<!-- <a-col :span="8">-->
<!-- <a-form-item label="供应商描述" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-input v-decorator="['supplierDescription']" type="list" :trigger-change="true" placeholder="请输入供应商描述" />-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :span="8">
<a-form-item label="物料组" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <a-input v-decorator="['itemGroup']" type="list" :trigger-change="true" placeholder="请输入物料组" />-->
<a-input v-decorator="['descriptionId']" type="list" :trigger-change="true" placeholder="请输入物料组" />
<a-select v-decorator="['itemGroup']" placeholder="请选择物料组" >
<a-select-option v-for="(item,index) in bigId" :key="index" :value="item.itemGroup">{{item.itemGroup}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="物料" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['item']" type="list" :trigger-change="true" placeholder="请输入物料" />
<!-- <a-select v-decorator="['descriptionId']" placeholder="请选择物料组" >-->
<!-- <a-select-option v-for="(item,index) in bigId" :key="index" :value="item.itemGroup">{{item.itemGroup}}</a-select-option>-->
<!-- </a-select>-->
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="物料描述" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['itemDescription']" type="list" :trigger-change="true" placeholder="请输入物料描述" />
<a-form-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['merchandiseNewsId']" type="list" :trigger-change="true" placeholder="请输入物料" />
</a-form-item>
</a-col>
<!-- <a-col :span="8">-->
<!-- <a-form-item label="物料描述" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-input v-decorator="['itemDescription']" type="list" :trigger-change="true" placeholder="请输入物料描述" />-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :span="8">
<a-form-item label="计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-form-item label="计量单位(只 )" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['unitMeasurement']" type="list" :trigger-change="true" placeholder="请输入计量单位" />
</a-form-item>
</a-col>

Loading…
Cancel
Save