|
|
@@ -3,19 +3,24 @@
|
|
|
<Modal fullscreen
|
|
|
:title="title"
|
|
|
v-model="show"
|
|
|
- @on-ok="then">
|
|
|
+ >
|
|
|
<Topsearch ref="topsearch"
|
|
|
:list="set_list"
|
|
|
@init="init"
|
|
|
@searchData="init">
|
|
|
|
|
|
</Topsearch>
|
|
|
- <Table @on-select="selectTableProject"
|
|
|
+ <Table @on-selection-change="selectTableProject"
|
|
|
:max-height="maxHeight"
|
|
|
stripe
|
|
|
border
|
|
|
+ ref="projectTable"
|
|
|
:columns="project_tableColumns"
|
|
|
- :data="project_tableData"></Table>
|
|
|
+ :data="project_tableData">
|
|
|
+ <template slot="select" slot-scope="{row,index}">
|
|
|
+ <Checkbox type="checkbox" v-model='project_tableData[index].isChoose' @on-change='selectTableProjectRow($event,row,index)' :disabled="(row.supply_title != supply_title&&supply_title!='')||row.disabled_type "/>
|
|
|
+ </template>
|
|
|
+ </Table>
|
|
|
<div ref="footercenter"
|
|
|
class="footer-center">
|
|
|
<Page :total="total"
|
|
|
@@ -40,7 +45,17 @@
|
|
|
v-if="type!=9"
|
|
|
v-show="type!=14"
|
|
|
:columns="parts_tableColumns"
|
|
|
- :data="parts_tableData"></Table>
|
|
|
+ :data="parts_tableData">
|
|
|
+ <template slot="purchases_num" slot-scope="{row,index}">
|
|
|
+ <Input v-model="parts_tableData[index].purchases_num" type='number' @on-change='changePurchasesNum($event,row,index)' @on-focus='InputFocus(row,index)'></Input>
|
|
|
+ </template>
|
|
|
+ <template slot="arrive_num" slot-scope="{row,index}">
|
|
|
+ <Input v-model="parts_tableData[index].arrive_num" type='number' @on-change='changePurchasesNum($event,row,index)' @on-focus='InputFocus(row,index)'></Input>
|
|
|
+ </template>
|
|
|
+ <template slot="return_num" slot-scope="{row,index}">
|
|
|
+ <Input v-model="parts_tableData[index].return_num" type='number' @on-change='changePurchasesNum($event,row,index)' @on-focus='InputFocus(row,index)'></Input>
|
|
|
+ </template>
|
|
|
+ </Table>
|
|
|
<vxe-table resizable
|
|
|
border
|
|
|
size="mini"
|
|
|
@@ -111,15 +126,30 @@
|
|
|
title="备注"
|
|
|
min-width="80"></vxe-table-column>
|
|
|
</vxe-table>
|
|
|
+ <div slot="footer">
|
|
|
+ <Button
|
|
|
+ @click="show = false"
|
|
|
+ type="primary"
|
|
|
+ style="margin-right: 10px"
|
|
|
+ >
|
|
|
+ 返回
|
|
|
+ </Button>
|
|
|
+ <Button @click="then" type="primary">
|
|
|
+ 确认
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
</Modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
|
+ choose:{},
|
|
|
show: false,
|
|
|
+ checkAll:false,
|
|
|
list: [],
|
|
|
childrenList: [],
|
|
|
stockGoodsList: [],
|
|
|
@@ -144,28 +174,37 @@ export default {
|
|
|
childrenCheck: {},
|
|
|
purchaseTypeList: [],
|
|
|
materialTypeList: [],
|
|
|
- currencyOrder: null
|
|
|
+ currencyOrder: null,
|
|
|
+ plan_no_list:[],
|
|
|
+ material:[],
|
|
|
+ project_code:[],
|
|
|
+ project_title:[],
|
|
|
+ supply:[],
|
|
|
+ plan_no:[],
|
|
|
+ purchase_order_no_list:[],
|
|
|
+ purchase_order_no:[],
|
|
|
+ arrival_no_list:[]
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
set_list () {
|
|
|
switch (this.type) {
|
|
|
case 1:
|
|
|
- return [//参照请购单
|
|
|
- { title: '订单号', name: 'Input', value: '', placeholder: '请输入订单号', serverName: 'purchase_order_apply_no' },
|
|
|
- { title: '请购类型', name: 'Select', value: '', placeholder: '请选择请购类型', serverName: 'type_id', option: this.purchaseTypeList },
|
|
|
- { title: '项目名称', name: 'Input', value: '', placeholder: '请输入项目名称', serverName: 'title', },
|
|
|
- { title: '制单时间', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', },
|
|
|
+ return [//参照采购计划
|
|
|
+ { title: '计划单号', name: 'Select', value: '', placeholder: '请选择计划单号', serverName: 'plan_no',option:this.plan_no_list ,filterable:true},
|
|
|
+ { title: '采购计划类型', name: 'Select', value: '', placeholder: '请选择采购计划类型', serverName: 'plan_type', option: this.purchaseTypeList,filterable:true },
|
|
|
+
|
|
|
+ { title: '单据日期', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', }
|
|
|
]
|
|
|
case 2:
|
|
|
case 3:
|
|
|
case 5:
|
|
|
return [//参照采购单
|
|
|
- { title: '订单号', name: 'Input', value: '', placeholder: '请输入订单号', serverName: 'purchase_order_no' },
|
|
|
- { title: '采购类型', name: 'Select', value: '', placeholder: '请选择采购类型', serverName: 'type_id', option: this.purchaseTypeList },
|
|
|
- { title: '项目名称', name: 'Input', value: '', placeholder: '请输入项目名称', serverName: 'client_name', },
|
|
|
+ { title: '订单号', name: 'Input', value: '', placeholder: '请输入订单号', serverName: 'order_no' },
|
|
|
+ { title: '采购计划类型', name: 'Select', value: '', placeholder: '请选择采购类型', serverName: 'basics_purchase_id', option: this.purchaseTypeList,filterable:true },
|
|
|
+
|
|
|
{ title: '供应商名称', name: 'Input', value: '', placeholder: '请输入供应商名称', serverName: 'supply_title', },
|
|
|
- { title: '制单时间', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', },
|
|
|
+ { title: '单据时间', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', }
|
|
|
]
|
|
|
case 4:
|
|
|
case 6:
|
|
|
@@ -173,9 +212,9 @@ export default {
|
|
|
case 8:
|
|
|
case 9:
|
|
|
return [//参照质检单
|
|
|
- { title: '订单号', name: 'Input', value: '', placeholder: '请输入订单号', serverName: 'purchase_order_quality_no' },
|
|
|
- { title: '项目名称', name: 'Input', value: '', placeholder: '请输入项目名称', serverName: 'type_title', },
|
|
|
- { title: '制单时间', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', },
|
|
|
+ { title: '到货单号', name: 'Select', value: '', placeholder: '请输入订单号', serverName: 'arrival_no',option:this.arrival_no_list,filterable:true },
|
|
|
+ { title: '供应商名称', name: 'Select', value: '', placeholder: '请选择供应商', serverName: 'supply_id',option:this.supplierList,filterable:true },
|
|
|
+ { title: '单据日期', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', }
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
@@ -183,28 +222,32 @@ export default {
|
|
|
switch (this.type) {
|
|
|
case 1:
|
|
|
return [//采购参照请购单
|
|
|
- { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'type_id', option: this.materialTypeList },
|
|
|
- { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'title' },
|
|
|
+ { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'material_type_id', option: this.materialTypeList ,filterable:true},
|
|
|
+ {title: '物料名称',name:'Select',value:'',placeholder:'请输入物料名称',serverName:'material_title',option:this.material,filterable:true},
|
|
|
+ {title: '项目编码',name:'Select',value:'',placeholder:'请选择项目编码',serverName:'project_code',option:this.project_code,filterable:true},
|
|
|
+ {title: '项目名称',name:'Select',value:'',placeholder:'请选择项目编码',serverName:'project_title',option:this.project_title,filterable:true},
|
|
|
+ {title: '建议供应商',name:'Select',value:'',placeholder:'请选择项目编码',serverName:'supply_id',option:this.supply,filterable:true},
|
|
|
+ { title: '预计到货时间', start_server: 'arrive_start_time', end_server: 'arrive_end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', }
|
|
|
]
|
|
|
case 2:
|
|
|
case 3:
|
|
|
case 5:
|
|
|
return [//到货参照采购单
|
|
|
- { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'type_id', option: this.materialTypeList },
|
|
|
- { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'title' },
|
|
|
+ { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'material_type_id', option: this.materialTypeList,filterable:true },
|
|
|
+ { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'material_title' },
|
|
|
]
|
|
|
case 4:
|
|
|
case 6:
|
|
|
return [//质检参照到货单
|
|
|
- { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'type_id', option: this.materialTypeList },
|
|
|
- { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'title' },
|
|
|
+ { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'material_type_id', option: this.materialTypeList,filterable:true },
|
|
|
+ { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'material_title' },
|
|
|
]
|
|
|
case 7:
|
|
|
case 8:
|
|
|
case 9:
|
|
|
return [//参照质检单
|
|
|
- { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'type_id', option: this.materialTypeList },
|
|
|
- { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'title' },
|
|
|
+ { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'material_type_id', option: this.materialTypeList,filterable:true },
|
|
|
+ { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'material_title' },
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
@@ -222,24 +265,34 @@ export default {
|
|
|
});
|
|
|
|
|
|
}).catch((err) => { });
|
|
|
+ // 获取供应商列表
|
|
|
+ this.axios({ method: 'get', url: '/api/supply_list', }).then((res) => {
|
|
|
+ this.supplierList = res.data.data;
|
|
|
+ this.supplierList.forEach(v=>{
|
|
|
+ v.label = v.title;
|
|
|
+ v.value = v.id;
|
|
|
+ })
|
|
|
+ }).catch((err) => { });
|
|
|
switch (this.type) {
|
|
|
- case 1: //采购单参照请购单
|
|
|
+ case 1: //采购订单参照采购计划
|
|
|
this.project_tableColumns = [
|
|
|
{ title: '选择', align: 'center', minWidth: 100, type: 'selection' },
|
|
|
// { title: '订单号', align: 'center', key: 'purchase_order_apply_no', minWidth: 200, },
|
|
|
- { title: '订单号', align: 'center', key: 'purchase_order_apply_no', minWidth: 200, },
|
|
|
- { title: '请购类型', align: 'center', key: 'type_title', minWidth: 150, },
|
|
|
- { title: '项目名称', align: 'center', key: 'residential_name', minWidth: 150 },
|
|
|
+ { title: '计划单号', align: 'center', key: 'plan_no', minWidth: 200, },
|
|
|
+
|
|
|
+ { title: '采购计划类型', align: 'center', key: 'plan_type_title', minWidth: 150, },
|
|
|
+
|
|
|
{
|
|
|
- title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
|
|
|
+ title: '单据日期', align: 'center', key: 'crt_time', minWidth: 200,
|
|
|
render: (h, params) =>
|
|
|
- h('span', this.func.replaceDate(params.row.crt_time * 1)),
|
|
|
+ h('span', params.row.order_time?this.func.replaceDate(params.row.order_time * 1).split(' ')[0]:''),
|
|
|
},
|
|
|
+ { title: '备注', align: 'center', key: 'remark', minWidth: 150 }
|
|
|
]
|
|
|
this.parts_tableColumns = [
|
|
|
{ type: 'selection', align: 'center', minWidth: 100, fixed: 'left' },
|
|
|
- { title: '物料分类', key: 'type_title', align: 'center', minWidth: 150 },
|
|
|
- { title: '物料名称', key: 'title', align: 'center', minWidth: 150 },
|
|
|
+ { title: '物料分类', key: 'material_type', align: 'center', minWidth: 150 },
|
|
|
+ { title: '物料名称', key: 'material_title', align: 'center', minWidth: 150 },
|
|
|
{
|
|
|
title: '物料规格', key: '', align: 'center', minWidth: 150,
|
|
|
render: (h, params) => {
|
|
|
@@ -249,26 +302,95 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
{ title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
|
|
|
- { title: '请购数量', key: 'num', align: 'center', minWidth: 150 },
|
|
|
+ { title: '项目编码', key: 'project_code', align: 'center', minWidth: 150 },
|
|
|
+ { title: '项目名称', key: 'project_title', align: 'center', minWidth: 150 },
|
|
|
+ { title: '计划数量', key: 'num', align: 'center', minWidth: 150,},
|
|
|
+ { title: '未参照数量', key: 'num', align: 'center', minWidth: 150 ,
|
|
|
+ render:(h,params)=>{
|
|
|
+ const { row } = params
|
|
|
+ let text = row.num-row.reference_num
|
|
|
+ return h('span', {}, text)
|
|
|
+ }},
|
|
|
+ { title: '采购数量', key: 'purchases_num', align: 'center', minWidth: 150,slot:'purchases_num'
|
|
|
+ // render:(h,params,index)=>{
|
|
|
+ // console.log(index)
|
|
|
+ // return h("Input",{props:{value:params.row.purchases_num},on:{'on-change':(e)=>{
|
|
|
+ // console.log(index);
|
|
|
+ // // this.parts_tableData[index].purchases_num=e.target.value;
|
|
|
+ // console.log(this.parts_tableData)}}})
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ { title: '预计到货时间', key: 'arrived_time', align: 'center', minWidth: 150,
|
|
|
+ render:(h,params)=>{
|
|
|
+ const {row}=params;
|
|
|
+ return h('span',{},row.arrive_time?this.func.replaceDate(row.arrive_time*1).split(' ')[0]:'')
|
|
|
+ } },
|
|
|
+ { title: '建议供应商', key: 'supply_title', align: 'center', minWidth: 150 },
|
|
|
]
|
|
|
this.get_project_url = '/api/purchase_apply_list'
|
|
|
- this.get_child_url = '/api/purchase_refer_apply'
|
|
|
+ this.get_child_url = '/api/purchase_apply_detail'
|
|
|
this.childrenParams = {}
|
|
|
break
|
|
|
case 2: //到货单参照采购单
|
|
|
this.project_tableColumns = [
|
|
|
- { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
|
|
|
- { title: '订单号', align: 'center', key: 'purchase_order_no', minWidth: 200, },
|
|
|
- { title: '采购类型', align: 'center', key: 'type_title', minWidth: 100, },
|
|
|
- { title: '项目名称', align: 'center', key: 'residential_name', minWidth: 150 },
|
|
|
- { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 },
|
|
|
+ { align: 'center', Width: 100,slot:'select',renderHeader:(h,{colum,index})=>{
|
|
|
+ return h('Checkbox',{props:{},on:{'on-change':(val)=>{
|
|
|
+ if(val){
|
|
|
+ this.checkAll = true;
|
|
|
+ this.project_tableData.map(v=>{
|
|
|
+ v.isChoose = true;
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.checkAll = false;
|
|
|
+ this.project_tableData.map(v=>{
|
|
|
+ v.isChoose = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }}},'全选')
|
|
|
+ }},
|
|
|
+ { title: '订单号', align: 'center', key: 'order_no', minWidth: 200 },
|
|
|
+
|
|
|
+ { title: '采购订单类型', align: 'center', key: 'basics_purchase_title', minWidth: 100, },
|
|
|
+
|
|
|
+ { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 ,
|
|
|
+ renderHeader: (h, {colum,index}) => {
|
|
|
+ return h('div', [
|
|
|
+ h('Tooltip', {
|
|
|
+ props: {
|
|
|
+ placement: 'top',
|
|
|
+ transfer:true
|
|
|
+ }
|
|
|
+ }, [
|
|
|
+ h('div',[
|
|
|
+ h('span','供应商名称'),
|
|
|
+ h('Icon', {
|
|
|
+ attrs: {
|
|
|
+ // 图片需放在static文件夹下
|
|
|
+ type: "ios-help-circle-outline"
|
|
|
+ },
|
|
|
+ style: {
|
|
|
+ marginBottom: '3px'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ ]), // 表格列显示文字和图片
|
|
|
+ h('div', {
|
|
|
+ slot: 'content',
|
|
|
+ style: {
|
|
|
+ whiteSpace: 'normal',
|
|
|
+ }
|
|
|
+ }, '只能选择一种供应商,相同供应商可以多选' // 气泡内的文字
|
|
|
+ )
|
|
|
+ ])
|
|
|
+ ]);
|
|
|
+}
|
|
|
+ },
|
|
|
{
|
|
|
- title: '预计到货', align: 'center', key: 'arrive_time', minWidth: 200,
|
|
|
+ title: '预计到货日期', align: 'center', key: 'arrive_time', minWidth: 200,
|
|
|
render: (h, params) =>
|
|
|
- h('span', this.func.replaceDate(params.row.arrive_time * 1)),
|
|
|
+ h('span', params.row.arrive_time?this.func.replaceDate(params.row.arrive_time * 1).split(' ')[0]:''),
|
|
|
},
|
|
|
{
|
|
|
- title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
|
|
|
+ title: '单据日期', align: 'center', key: 'crt_time', minWidth: 200,
|
|
|
render: (h, params) =>
|
|
|
h('span', this.func.replaceDate(params.row.crt_time * 1)),
|
|
|
},
|
|
|
@@ -287,9 +409,17 @@ export default {
|
|
|
},
|
|
|
{ title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
|
|
|
{ title: '采购数量', key: 'num', align: 'center', minWidth: 150 },
|
|
|
+ { title: '未参照数量', key: 'num', align: 'center', minWidth: 150 ,
|
|
|
+ render:(h,params)=>{
|
|
|
+ const { row } = params
|
|
|
+ let text = row.num-row.reference_num
|
|
|
+ return h('span', {}, text)
|
|
|
+ }},
|
|
|
+ { title: '到货数量', key: 'arrive_num', align: 'center', minWidth: 150,slot:'arrive_num'
|
|
|
+ }
|
|
|
]
|
|
|
this.get_project_url = '/api/purchase_list'
|
|
|
- this.get_child_url = '/api/purchase_refer'
|
|
|
+ this.get_child_url = '/api/purchase_detail'
|
|
|
this.childrenParams = {}
|
|
|
break
|
|
|
case 3: //质检单参照采购单
|
|
|
@@ -331,14 +461,18 @@ export default {
|
|
|
break
|
|
|
case 4: //质检单参照到货单
|
|
|
this.project_tableColumns = [
|
|
|
- { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
|
|
|
- { title: '订单号', align: 'center', key: 'purchase_order_arrive_no', minWidth: 200, },
|
|
|
- { title: '项目名称', align: 'center', key: 'type_title', minWidth: 150 },
|
|
|
+ {
|
|
|
+ title: "选择",
|
|
|
+ align: "center",
|
|
|
+ minWidth: 100,
|
|
|
+ render: this.renderRadio,
|
|
|
+ },
|
|
|
+ { title: '到货单号', align: 'center', key: 'arrival_no', minWidth: 200, },
|
|
|
{ title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 },
|
|
|
{
|
|
|
- title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
|
|
|
+ title: '单据日期', align: 'center', key: 'order_time', minWidth: 200,
|
|
|
render: (h, params) =>
|
|
|
- h('span', this.func.replaceDate(params.row.crt_time * 1)),
|
|
|
+ h('span', this.func.replaceDate(params.row.order_time * 1)),
|
|
|
},
|
|
|
]
|
|
|
this.parts_tableColumns = [
|
|
|
@@ -355,9 +489,17 @@ export default {
|
|
|
},
|
|
|
{ title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
|
|
|
{ title: '到货数量', key: 'num', align: 'center', minWidth: 150 },
|
|
|
+ { title: '未参照数量', key: 'num', align: 'center', minWidth: 150 ,
|
|
|
+ render:(h,params)=>{
|
|
|
+ const { row } = params
|
|
|
+ let text = row.num-row.reference_num
|
|
|
+ return h('span', {}, text)
|
|
|
+ }},
|
|
|
+ { title: '退货数量', key: 'return_num', align: 'center', minWidth: 150,slot:'return_num'
|
|
|
+ }
|
|
|
]
|
|
|
this.get_project_url = '/api/purchase_arrive_list'
|
|
|
- this.get_child_url = '/api/quality_refer'
|
|
|
+ this.get_child_url = '/api/purchase_arrive_detail'
|
|
|
this.childrenParams = { type: this.refer_type }
|
|
|
break
|
|
|
case 5: //入库单参照采购单
|
|
|
@@ -533,13 +675,21 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
+ let type_id = '';
|
|
|
+ if(this.type ==1){
|
|
|
+ type_id = 1
|
|
|
+ }
|
|
|
+ if(this.type == 2){
|
|
|
+ type_id = 2
|
|
|
+ }
|
|
|
// 获取采购类型
|
|
|
- this.axios({ method: 'get', url: '/api/basic_purchase_list', }).then((res) => {
|
|
|
+ this.axios({ method: 'get', url: '/api/basic_purchase_list',params:{type_id} }).then((res) => {
|
|
|
this.purchaseTypeList = res.data.data
|
|
|
this.purchaseTypeList.forEach(element => {
|
|
|
- element.value = element.type_id
|
|
|
+ element.value = element.id
|
|
|
element.label = element.title
|
|
|
})
|
|
|
+
|
|
|
}).catch((err) => { });
|
|
|
this.$nextTick((e) => {
|
|
|
const clientTableHeight = window.innerHeight - 51 - 57 -
|
|
|
@@ -549,6 +699,30 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ InputFocus(row,index){
|
|
|
+ if(this.type==1){
|
|
|
+ this.parts_tableData[index].purchases_num = '';
|
|
|
+ }
|
|
|
+ if(this.type==2){
|
|
|
+ this.parts_tableData[index].arrive_num = '';
|
|
|
+ }
|
|
|
+ if(this.type==4){
|
|
|
+ this.parts_tableData[index].return_num = '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changePurchasesNum(e,row,index){
|
|
|
+
|
|
|
+ if((e.target.value)*1>(row.num-row.reference_num)*1){
|
|
|
+ if(this.type ==1){
|
|
|
+ this.parts_tableData[index].purchases_num = (row.num-row.reference_num)*1;}
|
|
|
+ if(this.type ==2){
|
|
|
+ this.parts_tableData[index].arrive_num = (row.num-row.reference_num)*1;}
|
|
|
+ if(this.type ==4){
|
|
|
+ this.parts_tableData[index].return_num = (row.num-row.reference_num)*1;}
|
|
|
+ return this.$Message.error('数量不能超过未参照数量')
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
selectChangeEvent ({ records }) {
|
|
|
this.tableResult = JSON.parse(JSON.stringify(records))
|
|
|
},
|
|
|
@@ -557,7 +731,46 @@ export default {
|
|
|
return row.single * row.number
|
|
|
},
|
|
|
then () {
|
|
|
- this.$emit('then')
|
|
|
+ let state = true;
|
|
|
+ if(this.tableResult.length==0){
|
|
|
+ return this.$Message.warning('请选择物料')
|
|
|
+ }
|
|
|
+ if(this.type==1){
|
|
|
+ this.tableResult.forEach(v=>{
|
|
|
+ if(!v.purchases_num){
|
|
|
+ return state =false
|
|
|
+ }
|
|
|
+ if(v.purchases_num>(v.num-v.reference_num)){
|
|
|
+ return state = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.type==2){
|
|
|
+ this.tableResult.forEach(v=>{
|
|
|
+ if(!v.arrive_num){
|
|
|
+ return state =false
|
|
|
+ }
|
|
|
+ if(v.arrive_num>(v.num-v.reference_num)){
|
|
|
+ return state = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.type ==4){
|
|
|
+ this.tableResult.forEach(v=>{
|
|
|
+ if(!v.return_num){
|
|
|
+ return state = false
|
|
|
+ }
|
|
|
+ if(v.return_num>(v.num-v.reference_num)){
|
|
|
+ return state = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(!state){
|
|
|
+ return this.$Message.warning('数量不能为空')
|
|
|
+ }else{
|
|
|
+ this.$emit('then')
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
init (row) {
|
|
|
row.page_index = 1
|
|
|
@@ -574,10 +787,15 @@ export default {
|
|
|
childrenSearch (row) {
|
|
|
switch (this.type) {
|
|
|
case 1:
|
|
|
- row.purchase_order_apply_no = this.currencyOrder
|
|
|
+ row.plan_no = [];
|
|
|
+ this.plan_no.forEach(v=>{
|
|
|
+ row.plan_no.push(v)
|
|
|
+ })
|
|
|
+ row.arrive_end_time = parseInt(new Date(row.arrive_end_time).getTime() / 1000) || ''
|
|
|
+ row.arrive_start_time= parseInt(new Date(row.arrive_start_time).getTime() / 1000) || ''
|
|
|
break;
|
|
|
case 2:
|
|
|
- row.purchase_order_no = this.currencyOrder
|
|
|
+ row.order_no = this.currencyOrder
|
|
|
break;
|
|
|
case 3:
|
|
|
case 4:
|
|
|
@@ -586,7 +804,7 @@ export default {
|
|
|
case 7:
|
|
|
case 8:
|
|
|
case 9:
|
|
|
- row.refer_order_no = this.currencyOrder
|
|
|
+ row.arrival_no = this.currencyOrder
|
|
|
break;
|
|
|
// case 3:
|
|
|
// row.purchase_order_arrive_no = this.currencyOrder
|
|
|
@@ -595,24 +813,39 @@ export default {
|
|
|
// row.purchase_order_quality_no = this.currencyOrder
|
|
|
// break;
|
|
|
}
|
|
|
- this.axios({
|
|
|
- method: 'get',
|
|
|
+ if(this.type == 1){
|
|
|
+ this.axios({
|
|
|
+ method: 'post',
|
|
|
url: this.get_child_url,
|
|
|
- params: {
|
|
|
- ...row,
|
|
|
- type: this.refer_type
|
|
|
+ data:{...row,
|
|
|
+ reference_type: 1
|
|
|
}
|
|
|
- }).then((res) => {
|
|
|
+ } ).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
const deep_obj = JSON.parse(JSON.stringify(res.data))
|
|
|
this.projectDetail = deep_obj
|
|
|
- this.parts_tableData = res.data
|
|
|
+ this.parts_tableData = res.data.children
|
|
|
}
|
|
|
}).catch((err) => { });
|
|
|
+ }else{
|
|
|
+ this.axios({
|
|
|
+ method: 'post',
|
|
|
+ url: this.get_child_url,
|
|
|
+ data:{...row,
|
|
|
+ reference_type: 1
|
|
|
+ }
|
|
|
+ } ).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ const deep_obj = JSON.parse(JSON.stringify(res.data))
|
|
|
+ this.projectDetail = deep_obj
|
|
|
+ this.parts_tableData = res.data.list
|
|
|
+ }
|
|
|
+ }).catch((err) => { });}
|
|
|
},
|
|
|
getData (params) {
|
|
|
params.end_time = Date.parse(params.end_time).toString().slice(0,10)
|
|
|
params.start_time = Date.parse(params.start_time).toString().slice(0,10)
|
|
|
+ params.reference_type =1;
|
|
|
if(params.end_time == 'NaN'){
|
|
|
params.end_time = ''
|
|
|
}
|
|
|
@@ -621,9 +854,33 @@ export default {
|
|
|
}
|
|
|
this.axios(this.get_project_url, { params: params }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
+
|
|
|
res.data.data.map((v) => (v.check = false))
|
|
|
this.project_tableData = res.data.data
|
|
|
this.total = res.data.total
|
|
|
+ if(this.type == 1){
|
|
|
+ this.plan_no_list = res.data.plan_no_list;
|
|
|
+ let data = [];
|
|
|
+ this.plan_no_list.forEach(v=>{
|
|
|
+ let obj = {};
|
|
|
+ obj.label = v;
|
|
|
+ obj.value = v;
|
|
|
+ data.push(obj)
|
|
|
+ })
|
|
|
+ this.plan_no_list = data;}
|
|
|
+
|
|
|
+ if(this.type == 4){
|
|
|
+
|
|
|
+ let data = [];
|
|
|
+ this.arrival_no_list = res.data.arrival_no_list
|
|
|
+ this.arrival_no_list.map(v=>{
|
|
|
+ let obj = {};
|
|
|
+ obj.label = v;
|
|
|
+ obj.value = v;
|
|
|
+ data.push(obj)
|
|
|
+ })
|
|
|
+ this.arrival_no_list = data;
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -632,6 +889,7 @@ export default {
|
|
|
return h('Radio', {
|
|
|
props: {
|
|
|
value: row.check,
|
|
|
+ disabled:((row.arrival_no == this.arrival_no&&this.arrival_no)||!this.arrival_no)?false:true
|
|
|
},
|
|
|
on: {
|
|
|
'on-change': (e) => {
|
|
|
@@ -651,7 +909,18 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
changeRadio (row) {
|
|
|
- console.log('row :>> ', row);
|
|
|
+ this.currencyOrder = row.arrival_no
|
|
|
+ console.log('nana')
|
|
|
+ this.axios({
|
|
|
+ method: 'post',
|
|
|
+ url: this.get_child_url,
|
|
|
+ data: {
|
|
|
+ arrival_no: row.arrival_no,
|
|
|
+ reference_type:1,
|
|
|
+ }
|
|
|
+ }).then((res) => {
|
|
|
+ this.parts_tableData =res.data.list
|
|
|
+ }).catch((err) => { });
|
|
|
},
|
|
|
changePage (e) {
|
|
|
this.pageIndex = e
|
|
|
@@ -689,35 +958,131 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- selectTableProject (selection, row) {
|
|
|
- switch (this.type) {
|
|
|
- case 1://采购单参照请购单
|
|
|
- this.currencyOrder = row.purchase_order_apply_no
|
|
|
- this.axios({
|
|
|
- method: 'get',
|
|
|
+ selectTableProjectRow(e,row,index){
|
|
|
+ switch(this.type){
|
|
|
+ case 2://到货单参照采购订单,不同的供应商只能单选
|
|
|
+ this.currencyOrder = [row.order_no]
|
|
|
+ if(e){ //如果点击为勾选状态
|
|
|
+ if(Object.keys(this.choose).length === 0){//勾选状态第一次点击
|
|
|
+ this.choose = row;
|
|
|
+ }
|
|
|
+ this.project_tableData.forEach(v=>{
|
|
|
+ if(v.supply_title!=this.choose.supply_title){
|
|
|
+ v.disabled_type = true;
|
|
|
+ }else{
|
|
|
+ v.disabled_type = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ let state = true;//没有数据勾选的状态
|
|
|
+ this.project_tableData.forEach(v=>{
|
|
|
+ if(v.isChoose){
|
|
|
+ return state = false //有数据勾选
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(state){
|
|
|
+ this.project_tableData.forEach(v=>{
|
|
|
+ v.disabled_type = false;
|
|
|
+ this.choose = [];
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.purchase_order_no = [];
|
|
|
+ this.project_tableData.forEach(v=>{
|
|
|
+ if(v.isChoose){
|
|
|
+ this.purchase_order_no.push(v.order_no)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.axios({
|
|
|
+ method: 'post',
|
|
|
url: this.get_child_url,
|
|
|
- params: {
|
|
|
- purchase_order_apply_no: row.purchase_order_apply_no
|
|
|
+ data: {
|
|
|
+ order_no: this.purchase_order_no,
|
|
|
+ reference_type: 1
|
|
|
}
|
|
|
}).then((res) => {
|
|
|
- res.data.forEach(element => {
|
|
|
- element.residential_name = row.residential_name
|
|
|
- });
|
|
|
- this.parts_tableData = [...this.parts_tableData, ...res.data]
|
|
|
+ this.parts_tableData =res.data.list
|
|
|
+ this.parts_tableData.map(v=>{
|
|
|
+ v.arrive_num = 0;
|
|
|
+ })
|
|
|
}).catch((err) => { });
|
|
|
- break;
|
|
|
- case 2://到货单参照采购单
|
|
|
- this.currencyOrder = row.purchase_order_no
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectTableProject (selection) {
|
|
|
+ switch (this.type) {
|
|
|
+ case 1://采购单参照请购单
|
|
|
+ console.log(selection);
|
|
|
+ // this.currencyOrder = row.plan_no
|
|
|
+ let plan_no = [];
|
|
|
+ selection.forEach(v=>{
|
|
|
+ plan_no.push(v.plan_no)
|
|
|
+ })
|
|
|
+ this.plan_no = plan_no;
|
|
|
+ this.axios.post('/api/purchase_apply_detail_list',{plan_no}).then(res=>{
|
|
|
+
|
|
|
+ this.material = res.data.material;
|
|
|
+ this.material.forEach(v=>{
|
|
|
+ v.label = v.title;
|
|
|
+ v.value = v.title;
|
|
|
+ })
|
|
|
+
|
|
|
+ this.project_code = res.data.project_code;
|
|
|
+ this.project_code.forEach(v=>{
|
|
|
+ v.label = v.project_code;
|
|
|
+ v.value = v.project_code;
|
|
|
+ })
|
|
|
+ this.project_title = res.data.project_title;
|
|
|
+ this.project_title.forEach(v=>{
|
|
|
+ v.label = v.project_title;
|
|
|
+ v.value = v.project_title;
|
|
|
+ })
|
|
|
+ this.supply = res.data.supply;
|
|
|
+ this.supply.forEach(v=>{
|
|
|
+ v.label = v.title;
|
|
|
+ v.value = v.id;
|
|
|
+ })
|
|
|
+ console.log(2)
|
|
|
+ this.$forceUpdate();
|
|
|
+ })
|
|
|
this.axios({
|
|
|
- method: 'get',
|
|
|
+ method: 'post',
|
|
|
url: this.get_child_url,
|
|
|
- params: {
|
|
|
- purchase_order_no: row.purchase_order_no
|
|
|
+ data: {
|
|
|
+ plan_no
|
|
|
}
|
|
|
}).then((res) => {
|
|
|
- this.parts_tableData = [...this.parts_tableData, ...res.data]
|
|
|
+ res.data.children.forEach(element => {
|
|
|
+ // element.residential_name = row.residential_name;
|
|
|
+ element.purchases_num = 0;
|
|
|
+ })
|
|
|
+ this.parts_tableData = res.data.children;
|
|
|
}).catch((err) => { });
|
|
|
break;
|
|
|
+ case 2://到货单参照采购单
|
|
|
+ // console.log(selection)
|
|
|
+ // // this.currencyOrder = selection.order_no
|
|
|
+ // if(selection.length<this.purchase_order_no_list.length){
|
|
|
+ // this.purchase_order_no_list =JSON.parse(JSON.stringify(selection));
|
|
|
+ // selection.forEach(v=>{
|
|
|
+ // this.purchase_order_no.push(v.order_no)
|
|
|
+ // })
|
|
|
+ // }else{
|
|
|
+ // this.purchase_order_no_list =JSON.parse(JSON.stringify(selection));
|
|
|
+ // this.purchase_order_no_list.forEach(v=>{
|
|
|
+ // this.purchase_order_no.push(v.order_no)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // console.log(this.purchase_order_no_list)
|
|
|
+ // this.axios({
|
|
|
+ // method: 'get',
|
|
|
+ // url: this.get_child_url,
|
|
|
+ // params: {
|
|
|
+ // purchase_order_no: this.purchase_order_no
|
|
|
+ // }
|
|
|
+ // }).then((res) => {
|
|
|
+ // this.parts_tableData = [...this.parts_tableData, ...res.data]
|
|
|
+ // }).catch((err) => { });
|
|
|
+ break;
|
|
|
case 3://质检单参照采购单
|
|
|
this.currencyOrder = row.purchase_order_no
|
|
|
this.axios({
|
|
|
@@ -732,7 +1097,8 @@ export default {
|
|
|
}).catch((err) => { });
|
|
|
break;
|
|
|
case 4://质检单参照到货单
|
|
|
- this.currencyOrder = row.purchase_order_arrive_no
|
|
|
+ this.currencyOrder = selection.arrival_no
|
|
|
+ console.log('nana')
|
|
|
this.axios({
|
|
|
method: 'get',
|
|
|
url: this.get_child_url,
|