Browse Source

修改物资页面显示

dev
caoyizhong 2 years ago
parent
commit
f008aa5ab8
  1. 12
      src/views/activiti/form/ProcessUdgetPlanForm.vue
  2. 75
      src/views/merchandisenews/ProcessMerchandiseNewsList.vue
  3. 94
      src/views/merchandisenews/modules/ProcessMerchandiseNewsForm.vue

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

@ -93,7 +93,7 @@
<a-col :span="8">
<a-form-item label="文件" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
<j-upload v-decorator="['fileId']" :trigger-change="true"></j-upload>
<j-upload v-decorator="['fileId']" :trigger-change="true" style="z-index: 999"></j-upload>
</a-form-item>
</a-col>
@ -1309,22 +1309,24 @@
}
formData.fileId = getStringArry(formData.fileId)
if (this.materialPrice != 0 && this.materialPrice != null) {
formData.materialPrice = this.materialPrice
formData.materialPrice = this.materialPrice;
}else{
formData.materialPrice = 0;
}
formData.describes = this.describes
if (new Date(formData.createTime).getTime() / 100 > new Date(formData.needTime).getTime() / 100) {
this.$message.error('需求时间不能小于当前流程发起时间')
return
}
console.log(this.opinion, '流程说明')
// console.log(this.opinion, '')
this.form.validateFields((err, values) => {
if (!err) {
console.log(this.processData, '申请列表传值数据')
// console.log(this.processData, '')
formData.procDefId = this.processData.id
formData.procDeTitle = this.processData.name
formData.title = this.processData.description
//formData.sourceCapital
console.log('this.planType++', this.planType)
// console.log('this.planType++', this.planType)
if (!formData.tableName) formData.tableName = this.processData.businessTable
var url = this.url.addFromTableApply
let method = 'post'

75
src/views/merchandisenews/ProcessMerchandiseNewsList.vue

@ -4,17 +4,17 @@
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-col :xl="5" :lg="7" :md="8" :sm="24">
<a-form-item label="商品名称">
<a-input placeholder="请输入商品名称" v-model="queryParam.merchandiseName"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-col :xl="5" :lg="7" :md="8" :sm="24">
<a-form-item label="物资编号">
<a-input placeholder="请输入物资编号" v-model="queryParam.materialsNumber"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-col :xl="5" :lg="7" :md="8" :sm="24">
<a-form-item label="供应商">
<!-- <a-input placeholder="供应商" v-model="queryParam.materialsUnit"></a-input>-->
<!-- <a-select v-model="queryParam.materialsUnit" placeholder="请选择" @popupScroll="handlePopupScroll">-->
@ -43,6 +43,23 @@
<!-- </a-select>-->
</a-form-item>
</a-col>
<a-col :xl="4" :lg="7" :md="8" :sm="24">
<a-form-item label="归口部门">
<!-- <a-input placeholder="供应商" v-model="queryParam.materialsUnit"></a-input>-->
<a-select v-model="queryParam.materialDepart" placeholder="请选择">
<a-select-option v-for="(item,index) in bigIds" :key="index" :value="item.materialDepart">{{item.materialDepart}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="7" :md="8" :sm="24">
<a-form-item label="物资类型">
<!-- <a-input placeholder="供应商" v-model="queryParam.materialsUnit"></a-input>-->
<j-dict-select-tag v-model="queryParam.materialType"
dictCode="material_type"
placeholder="请选择物资类型"/>
</a-form-item>
</a-col>
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">-->
<!-- <a-form-item label="物资单位">-->
@ -61,16 +78,16 @@
<!-- </a-col>-->
<template v-if="toggleSearchStatus">
</template>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<!-- <a @click="handleToggleSearch" style="margin-left: 8px">-->
<!-- {{ toggleSearchStatus ? '收起' : '展开' }}-->
<!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
<!-- </a>-->
</span>
</a-col>
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">-->
<!-- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">-->
<!-- <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>-->
<!-- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>-->
<!--&lt;!&ndash; <a @click="handleToggleSearch" style="margin-left: 8px">&ndash;&gt;-->
<!--&lt;!&ndash; {{ toggleSearchStatus ? '收起' : '展开' }}&ndash;&gt;-->
<!--&lt;!&ndash; <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>&ndash;&gt;-->
<!--&lt;!&ndash; </a>&ndash;&gt;-->
<!-- </span>-->
<!-- </a-col>-->
</a-row>
</a-form>
</div>
@ -78,6 +95,9 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a-button @click="handleAdd" type="primary" icon="plus" v-has="'merchandiseNews:add'">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('物资清单表')">导出</a-button>
<a-button type="primary" icon="download" @click="downloadFile('http://182.92.73.21:9090/file/temp/物资清单表12323123_1672369326884.xls')" v-has="'merchandiseNews:import'">物资清单表导入模板</a-button>
@ -200,6 +220,7 @@
fetching: false,
description: '物资清单表管理页面',
bigId:[],
bigIds:[],
//
columns: [
{
@ -256,6 +277,18 @@
scopedSlots: { customRender: 'specification' },
dataIndex: 'specification'
},
{
title:'归口部门',
align:"center",
scopedSlots: { customRender: 'materialDepart' },
dataIndex: 'materialDepart'
},
{
title:'物资类型',
align:"center",
scopedSlots: { customRender: 'materialType' },
dataIndex: 'materialType'
},
// {
// title:'',
// align:"center",
@ -280,7 +313,8 @@
deleteBatch: "/merchandisenews/processMerchandiseNews/deleteBatch",
exportXlsUrl: "/merchandisenews/processMerchandiseNews/exportXls",
importExcelUrl: "merchandisenews/processMerchandiseNews/importExcel",
supplierId: "/supplier/processSupplier/list"
supplierId: "/supplier/processSupplier/list",
getMaterialDepart: "/merchandisenews/processMerchandiseNews/getMaterialDepart"
},
dictOptions:{},
@ -298,7 +332,7 @@
methods: {
onSearch(searchText) {
console.log(searchText)
// console.log(searchText)
// this.dataSource = !searchText ? [] : [searchText];
this.fetchData(searchText);
},
@ -324,6 +358,17 @@
})
}
});
getAction(this.url.getMaterialDepart,par).then((res)=>{
if(res.success){
// console.log(res.result,"===================");
// this.bigId = res.result.records;
res.result.forEach( item => {
this.bigIds.push(item);
})
}
});
},
initDictConfig(){
},

94
src/views/merchandisenews/modules/ProcessMerchandiseNewsForm.vue

@ -5,14 +5,14 @@
<a-row>
<a-col :span="8">
<a-form-item label="商品名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['merchandiseName']" placeholder="请输入商品名称" ></a-input>
<a-input v-decorator="['merchandiseName',validatorRules.merchandiseName]" placeholder="请输入商品名称" ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <a-input v-decorator="['supplierId']" placeholder="请输入供应商" ></a-input>-->
<a-auto-complete
v-decorator="['supplierId']"
v-decorator="['supplierId',validatorRules.supplierId]"
:data-source="bigId"
placeholder="请选择"
@select="onSelectSupplier"
@ -22,14 +22,14 @@
</a-col>
<a-col :span="8">
<a-form-item label="第三方商品编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['partyNumber']" placeholder="请输入第三方商品编号" ></a-input>
<a-input v-decorator="['partyNumber',validatorRules.partyNumber]" placeholder="请输入第三方商品编号" ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="品名分类" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <a-input v-decorator="['descriptionId']" placeholder="请输入品名编号ID" ></a-input>-->
<a-auto-complete
v-decorator="['descriptionId']"
v-decorator="['descriptionId',validatorRules.descriptionId]"
:data-source="bigIdRake"
placeholder="请选择"
@select="onSelectRake"
@ -39,12 +39,12 @@
</a-col>
<a-col :span="8">
<a-form-item label="物资编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['materialsNumber']" placeholder="请输入物资编号" ></a-input>
<a-input v-decorator="['materialsNumber',validatorRules.materialsNumber]" placeholder="请输入物资编号" ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="物资单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['materialsUnit']" placeholder="请输入物资单位" ></a-input>
<a-input v-decorator="['materialsUnit',validatorRules.materialsUnit]" placeholder="请输入物资单位" ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
@ -62,6 +62,24 @@
<a-input v-decorator="['synopsis']" placeholder="请输入简介概要" ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="归口部门" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <a-input placeholder="供应商" v-model="queryParam.materialsUnit"></a-input>-->
<a-select v-decorator="['materialDepart',validatorRules.materialDepart]" placeholder="请选择">
<a-select-option v-for="(item,index) in bigIds" :key="index" :value="item.materialDepart">{{item.materialDepart}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="物资类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <a-input placeholder="供应商" v-model="queryParam.materialsUnit"></a-input>-->
<j-dict-select-tag type="list" v-decorator="['materialType',validatorRules.materialType]"
:trigger-change="true" dictCode="material_type"
placeholder="请选择物资类型" />
</a-form-item>
</a-col>
<!-- <a-col :span="8">-->
<!-- <a-form-item label="分类" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-input-number v-decorator="['classify']" placeholder="请输入分类" style="width: 100%" />-->
@ -111,12 +129,16 @@
data () {
return {
bigId:[],
bigIder:[],
bigIds:[],
bigIdser:[],
bigIdRake:[],
bigIdRaker:[],
form: this.$form.createForm(this),
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
sm: { span: 6 },
},
wrapperCol: {
xs: { span: 24 },
@ -124,6 +146,15 @@
},
confirmLoading: false,
validatorRules: {
materialType: { rules: [{ required: true, message: '请选择物资类型!' }] },
merchandiseName: { rules: [{ required: true, message: '请输入物资名称!' }] },
supplierId: { rules: [{ required: true, message: '请输入供应商!' }] },
partyNumber: { rules: [{ required: true, message: '请输入第三方编号!' }] },
descriptionId: { rules: [{ required: true, message: '请选择品类类型!' }] },
materialsNumber: { rules: [{ required: true, message: '请输入物资编码!' }] },
materialsUnit: { rules: [{ required: true, message: '请输入物资单位!' }] },
materialDepart: { rules: [{ required: true, message: '请选择归口部门!' }] },
},
url: {
add: "/merchandisenews/processMerchandiseNews/add",
@ -131,6 +162,7 @@
queryById: "/merchandisenews/processMerchandiseNews/queryById",
supplierId: "/supplier/processSupplier/list",
descriptionRake: "/description/processDescription/list",
getMaterialDepart: "/merchandisenews/processMerchandiseNews/getMaterialDepart"
}
}
},
@ -177,6 +209,9 @@
pageSize: 100
}
this.bigId = [];
this.bigIdr = [];
this.bigIds = [];
this.bigIdser = [];
getAction(this.url.supplierId,par).then((res)=>{
if(res.success){
// console.log(res.result.records);
@ -184,8 +219,20 @@
res.result.records.forEach( item => {
this.bigId.push(item.supplierName);
})
this.bigIder = res.result.records;
}
});
getAction(this.url.getMaterialDepart,par).then((res)=>{
if(res.success){
// console.log(res.result,"===================");
// this.bigId = res.result.records;
res.result.forEach( item => {
this.bigIds.push(item);
})
this.bigIdser = res.result;
}
});
},
onSearchRake(searchText) {
console.log(searchText)
@ -199,10 +246,11 @@
//
let par = {
delFlag: 0,
descriptionName: value,
materialClassify: value,
pageSize: 100
}
this.bigIdRake = [];
this.bigIdRaker = [];
getAction(this.url.descriptionRake,par).then((res)=>{
if(res.success){
console.log(res.result);
@ -210,6 +258,7 @@
res.result.records.forEach( item => {
this.bigIdRake.push(item.materialClassify);
})
this.bigIdRaker = res.result.records;
}
});
},
@ -222,7 +271,7 @@
this.model = Object.assign({}, record);
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'merchandiseName','supplierId','partyNumber','descriptionId','materialsNumber','materialsUnit','type','specification','synopsis','classify'))
this.form.setFieldsValue(pick(this.model,'merchandiseName','supplierId','partyNumber','descriptionId','materialsNumber','materialsUnit','type','specification','synopsis','classify','materialDepart','materialType'))
})
},
//
@ -241,7 +290,7 @@
//
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
// that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
@ -251,6 +300,29 @@
httpurl+=this.url.edit;
method = 'put';
}
// console.log("values",values);
// console.log("this.model",this.model);
this.bigIder.forEach(it =>{
// console.log(it,"this.dig");
if(values.supplierId === it.supplierName){
values.supplierId = it.id;
}
})
let big = false;
this.bigIdRaker.forEach(it =>{
// console.log(it,"this.bigIdRake");
if(values.descriptionId === it.materialClassify){
values.descriptionId = it.id;
big = true;
}
})
if(!big){
values.descriptionId = null;
}
let pattern = new RegExp("[\u4E00-\u9FA5]+");
if(pattern.test(values.materialType)){
values.materialType = null;
}
let formData = Object.assign(this.model, values);
console.log("表单提交数据",formData)
httpAction(httpurl,formData,method).then((res)=>{
@ -268,7 +340,7 @@
})
},
popupCallback(row){
this.form.setFieldsValue(pick(row,'merchandiseName','supplierId','partyNumber','descriptionId','materialsNumber','materialsUnit','type','specification','synopsis','classify'))
this.form.setFieldsValue(pick(row,'merchandiseName','supplierId','partyNumber','descriptionId','materialsNumber','materialsUnit','type','specification','synopsis','classify','materialDepart','materialType'))
},
}
}

Loading…
Cancel
Save