123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905 |
- <template>
- <div>
- <Modal fullscreen
- :title="title"
- v-model="show"
- @on-ok="then">
- <Topsearch ref="topsearch"
- :list="set_list"
- @init="init"
- @searchData="init">
- </Topsearch>
- <Table @on-selection-change="selectTableProject"
- :max-height="maxHeight"
- stripe
- border
- :columns="project_tableColumns"
- :data="project_tableData"></Table>
- <div ref="footercenter"
- class="footer-center">
- <Page :total="total"
- :current.sync="pageIndex"
- :show-total="true"
- :page-size="pageSize"
- :show-sizer="true"
- :show-elevator="true"
- @on-change="changePage"
- @on-page-size-change="changeSize">
- </Page>
- </div>
- <Topsearch ref="topsearch"
- :list="set_childrenList"
- :showbtn='set_childrenList.length>0?true:false'
- @searchData="childrenSearch"></Topsearch>
- <Table row-key="__index"
- @on-selection-change="selectTable"
- :max-height="maxHeight"
- stripe
- border
- v-if="type!=9"
- v-show="type!=14"
- :columns="parts_tableColumns"
- :data="parts_tableData">
- <template slot="purchases_num" slot-scope="{index}">
- <Input v-model="parts_tableData[index].purchases_num" ></Input>
- </template>
- </Table>
- <vxe-table resizable
- border
- size="mini"
- align="center"
- ref="xTree"
- v-else
- v-show="type!=14"
- highlight-hover-row
- :scroll-y="{enabled: false}"
- :scroll-x="{enabled: false}"
- :tree-config="{children: 'children',indent:10,line:true}"
- :data="parts_tableData"
- @toggle-tree-expand="toggleExpandChangeEvent"
- @checkbox-change="selectChangeEvent">
- <vxe-table-column field="laravel"
- title="展开"
- type="checkbox"
- tree-node
- min-width="50"></vxe-table-column>
- <vxe-table-column field="stock_type_title"
- title="存货分类名称"
- min-width="70"></vxe-table-column>
- <vxe-table-column field="code"
- title="存货编码"
- min-width="80"></vxe-table-column>
- <vxe-table-column field="title"
- title="存货名称"
- :edit-render="{enabled:false}"
- min-width="100">
- <template #default="{ row }">
- <vxe-button type="text"
- style="color:#606266">{{row.title}}</vxe-button>
- </template>
- </vxe-table-column>
- <vxe-table-column field="model"
- title="规格型号"
- min-width="20"></vxe-table-column>
- <vxe-table-column field="matching_number"
- title="配比数量"
- min-width="40"
- :edit-render="{enabled:false}"></vxe-table-column>
- <vxe-table-column field="number"
- title="数量"
- min-width="40"
- :edit-render="{enabled:false}">
- </vxe-table-column>
- <vxe-table-column field="unit"
- title="计量单位"
- min-width="20"></vxe-table-column>
- <vxe-table-column field="single"
- title="单重"
- min-width="20"></vxe-table-column>
- <vxe-table-column field="total_single"
- title="总重"
- min-width="20">
- <template #default="{ row }">
- <span>{{ countAmount(row) }} </span>
- </template>
- </vxe-table-column>
- <vxe-table-column field="img_number"
- title="工程图号"
- min-width="40"></vxe-table-column>
- <vxe-table-column field="attr"
- title="存货属性"
- width="180"
- :edit-render="{enabled:false,name: '$select', options: stockGoodsList, props: {multiple: true}}"></vxe-table-column>
- <vxe-table-column field="remark"
- title="备注"
- min-width="80"></vxe-table-column>
- </vxe-table>
- </Modal>
- </div>
- </template>
- <script>
- export default {
- data () {
- return {
- show: false,
- list: [],
- childrenList: [],
- stockGoodsList: [],
- project_tableColumns: [],
- project_tableData: [],
- parts_tableColumns: [],
- parts_tableData: [],
- total: 100,
- pageIndex: 1,
- pageSize: 10,
- maxHeight: null,
- proxyObj: {},
- get_project_url: '',
- params: {},
- childrenParams: {},
- get_child_url: '',
- tableResult: [],
- projectDetail: {},
- detailProxy: {},
- detailChangeProxy: {},
- supplierList: [{ label: "1", value: 1 }],
- childrenCheck: {},
- purchaseTypeList: [],
- materialTypeList: [],
- currencyOrder: null,
- plan_no_list:[],
- material:[],
- project_code:[],
- project_title:[],
- supply:[],
- plan_no:[],
- }
- },
- computed: {
- set_list () {
- switch (this.type) {
- case 1:
- return [//参照采购计划
- { title: '计划单号', name: 'Select', value: '', placeholder: '请选择计划单号', serverName: 'plan_no',option:this.plan_no_list },
- { title: '采购计划类型', name: 'Select', value: '', placeholder: '请选择采购计划类型', serverName: 'plan_type', option: this.purchaseTypeList },
-
- { 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: 'supply_title', },
- { 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:
- case 7:
- 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: '结束日期', },
- ]
- }
- },
- set_childrenList () {
- switch (this.type) {
- case 1:
- return [//采购参照请购单
- { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'material_type_id', option: this.materialTypeList },
- {title: '物料名称',name:'Select',value:'',placeholder:'请输入物料名称',serverName:'material_title',option:this.material},
- {title: '项目编码',name:'Select',value:'',placeholder:'请选择项目编码',serverName:'project_code',option:this.project_code},
- {title: '项目名称',name:'Select',value:'',placeholder:'请选择项目编码',serverName:'project_title',option:this.project_title},
- {title: '建议供应商',name:'Select',value:'',placeholder:'请选择项目编码',serverName:'supply_id',option:this.supply},
- { 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' },
- ]
- case 4:
- case 6:
- return [//质检参照到货单
- { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'type_id', option: this.materialTypeList },
- { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: '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' },
- ]
- }
- }
- },
- watch: {},
- created () {
- this.axios({
- method: 'get',
- url: '/api/basics_material_index',
- }).then((res) => {
- this.materialTypeList = res.data.data
- this.materialTypeList.forEach(element => {
- element.label = element.title
- element.value = element.type_id
- });
- }).catch((err) => { });
- switch (this.type) {
- 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: 'plan_no', minWidth: 200, },
- { title: '采购计划类型', align: 'center', key: 'plan_type_title', minWidth: 150, },
-
- {
- title: '单据日期', align: 'center', key: 'crt_time', minWidth: 200,
- render: (h, params) =>
- 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: 'material_type', align: 'center', minWidth: 150 },
- { title: '物料名称', key: 'material_title', align: 'center', minWidth: 150 },
- {
- title: '物料规格', key: '', align: 'center', minWidth: 150,
- render: (h, params) => {
- const { row } = params
- let text = `${row.long}*${row.width}*${row.high}`
- return h('span', {}, text)
- }
- },
- { title: '计量单位', key: 'unit', 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,
- render:(h,params)=>{
- const {row} = params;
- return h("span",{},row.num-row.reference_num)
- } },
- { 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_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 },
- {
- title: '预计到货', align: 'center', key: 'arrive_time', minWidth: 200,
- render: (h, params) =>
- h('span', this.func.replaceDate(params.row.arrive_time * 1)),
- },
- {
- title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
- render: (h, params) =>
- h('span', this.func.replaceDate(params.row.crt_time * 1)),
- },
- ]
- 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: '', align: 'center', minWidth: 150,
- render: (h, params) => {
- const { row } = params
- let text = `${row.long}*${row.width}*${row.high}`
- return h('span', {}, text)
- }
- },
- { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
- { title: '采购数量', key: 'num', align: 'center', minWidth: 150 },
- ]
- this.get_project_url = '/api/purchase_list'
- this.get_child_url = '/api/purchase_refer'
- this.childrenParams = {}
- break
- case 3: //质检单参照采购单
- 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 },
- {
- title: '预计到货', align: 'center', key: 'arrive_time', minWidth: 200,
- render: (h, params) =>
- h('span', this.func.replaceDate(params.row.arrive_time * 1)),
- },
- {
- title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
- render: (h, params) =>
- h('span', this.func.replaceDate(params.row.crt_time * 1)),
- },
- ]
- 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: '', align: 'center', minWidth: 150,
- render: (h, params) => {
- const { row } = params
- let text = `${row.long}*${row.width}*${row.high}`
- return h('span', {}, text)
- }
- },
- { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
- { title: '采购数量', key: 'num', align: 'center', minWidth: 150 },
- ]
- this.get_project_url = '/api/purchase_list'
- this.get_child_url = '/api/quality_refer'
- this.childrenParams = { type: this.refer_type }
- 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', key: 'supply_title', minWidth: 150 },
- {
- title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
- render: (h, params) =>
- h('span', this.func.replaceDate(params.row.crt_time * 1)),
- },
- ]
- 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: '', align: 'center', minWidth: 150,
- render: (h, params) => {
- const { row } = params
- let text = `${row.long}*${row.width}*${row.high}`
- return h('span', {}, text)
- }
- },
- { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
- { title: '到货数量', key: 'num', align: 'center', minWidth: 150 },
- ]
- this.get_project_url = '/api/purchase_arrive_list'
- this.get_child_url = '/api/quality_refer'
- this.childrenParams = { type: this.refer_type }
- break
- case 5: //入库单参照采购单
- 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 },
- {
- title: '预计到货', align: 'center', key: 'arrive_time', minWidth: 200,
- render: (h, params) =>
- h('span', this.func.replaceDate(params.row.arrive_time * 1)),
- },
- {
- title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
- render: (h, params) =>
- h('span', this.func.replaceDate(params.row.crt_time * 1)),
- },
- ]
- 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: '', align: 'center', minWidth: 150,
- render: (h, params) => {
- const { row } = params
- let text = `${row.long}*${row.width}*${row.high}`
- return h('span', {}, text)
- }
- },
- { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
- { title: '采购数量', key: 'num', align: 'center', minWidth: 150 },
- ]
- this.get_project_url = '/api/purchase_list'
- this.get_child_url = '/api/warehouse_order_in_refer'
- this.childrenParams = { type: this.refer_type }
- break
- case 6: //入库单参照到货单
- 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', key: 'supply_title', minWidth: 150 },
- {
- title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
- render: (h, params) =>
- h('span', this.func.replaceDate(params.row.crt_time * 1)),
- },
- ]
- 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: '', align: 'center', minWidth: 150,
- render: (h, params) => {
- const { row } = params
- let text = `${row.long}*${row.width}*${row.high}`
- return h('span', {}, text)
- }
- },
- { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
- { title: '到货数量', key: 'num', align: 'center', minWidth: 150 },
- ]
- this.get_project_url = '/api/purchase_arrive_list'
- this.get_child_url = '/api/warehouse_order_in_refer'
- this.childrenParams = { type: this.refer_type }
- break
- case 7: //入库单参照质检单
- this.project_tableColumns = [
- { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
- { title: '订单号', align: 'center', key: 'purchase_order_quality_no', minWidth: 200, },
- { title: '项目名称', align: 'center', key: 'type_title', minWidth: 150 },
- { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 },
- {
- title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
- render: (h, params) =>
- h('span', this.func.replaceDate(params.row.crt_time * 1)),
- },
- ]
- 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: '', align: 'center', minWidth: 150,
- render: (h, params) => {
- const { row } = params
- let text = `${row.long}*${row.width}*${row.high}`
- return h('span', {}, text)
- }
- },
- { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
- { title: '质检数量', key: 'num', align: 'center', minWidth: 150 },
- ]
- this.get_project_url = '/api/purchase_quality_list'
- this.get_child_url = '/api/warehouse_order_in_refer'
- this.childrenParams = { type: this.refer_type }
- break
- case 8: //出库单参照入库单
- this.project_tableColumns = [
- { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
- { title: '订单号', align: 'center', key: 'order_in_no', minWidth: 200, },
- { title: '项目名称', align: 'center', key: 'residential_name', minWidth: 150 },
- { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 },
- { title: '操作员', align: 'center', key: 'nickname', minWidth: 100 },
- {
- title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
- render: (h, params) =>
- h('span', this.func.replaceDate(params.row.crt_time * 1)),
- },
- ]
- 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: '', align: 'center', minWidth: 150,
- render: (h, params) => {
- const { row } = params
- let text = `${row.long}*${row.width}*${row.high}`
- return h('span', {}, text)
- }
- },
- { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
- { title: '派工数量', key: 'num', align: 'center', minWidth: 150 },
- ]
- this.get_project_url = '/api/warehouse_order_in_list'
- this.get_child_url = '/api/warehouse_order_out_refer'
- this.childrenParams = { type: this.refer_type }
- break
- case 9: //出库单参照派工单
- break
- case 15: //参照质检单
- this.list = [
- { 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: '结束日期', },
- ]
- this.project_tableColumns = [
- { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
- { title: '订单号', align: 'center', key: 'purchase_order_quality_no', minWidth: 200, },
- { title: '项目名称', align: 'center', key: 'type_title', minWidth: 150 },
- { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 },
- {
- title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
- render: (h, params) =>
- h('span', this.func.replaceDate(params.row.crt_time * 1)),
- },
- ]
- 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: '', align: 'center', minWidth: 150,
- render: (h, params) => {
- const { row } = params
- let text = `${row.long}*${row.width}*${row.high}`
- return h('span', {}, text)
- }
- },
- { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
- { title: '质检数量', key: 'num', align: 'center', minWidth: 150 },
- ]
- this.get_project_url = '/api/purchase_quality_list'
- this.get_child_url = '/api/purchase_quality_detail'
- // this.childrenParams = { type: 3}
- break
- }
- },
- mounted () {
- let type_id = '';
- if(this.type ==1){
- type_id = 2
- }
- // 获取采购类型
- 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.id
- element.label = element.title
- })
-
- }).catch((err) => { });
- this.$nextTick((e) => {
- const clientTableHeight = window.innerHeight - 51 - 57 -
- this.$refs['topsearch'].$el.clientHeight -
- this.$refs['footercenter'].clientHeight
- this.maxHeight = Math.floor(clientTableHeight / 2) - 20
- })
- },
- methods: {
-
- selectChangeEvent ({ records }) {
- this.tableResult = JSON.parse(JSON.stringify(records))
- },
- toggleExpandChangeEvent () { },
- countAmount (row) {
- return row.single * row.number
- },
- then () {
- this.$emit('then')
- },
- init (row) {
- row.page_index = 1
- row.page_size = this.pageSize
- let params = {
- ...this.params,
- ...row,
- sub_state: 1,
- }
- this.proxyObj = params
- this.parts_tableData = []
- this.getData(params)
- },
- childrenSearch (row) {
- switch (this.type) {
- case 1:
- 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
- break;
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- row.refer_order_no = this.currencyOrder
- break;
- // case 3:
- // row.purchase_order_arrive_no = this.currencyOrder
- // break;
- // case 4:
- // row.purchase_order_quality_no = this.currencyOrder
- // break;
- }
- 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.children
- }
- }).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 = ''
- }
- if(params.start_time == 'NaN'){
- params.start_time == ''
- }
- 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
- 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;
- }
- })
- },
- renderRadio (h, params) {
- const { row, index } = params
- return h('Radio', {
- props: {
- value: row.check,
- },
- on: {
- 'on-change': (e) => {
- if (this.type != 14) {
- this.project_tableData.forEach((item) => (item.check = false))
- this.project_tableData[index].check = true
- this.childrenCheck = this.params
- this.childrenCheck.id = row.id
- this.childrenCheck.project_sub_id = row.project_sub_id
- this.changeRadio(this.project_tableData[index])
- } else {
- // console.log('this.project_tableData[index] :>> ', this.project_tableData[index]);
- this.tableResult = [this.project_tableData[index]]
- }
- },
- },
- })
- },
- changeRadio (row) {
- console.log('row :>> ', row);
- },
- changePage (e) {
- this.pageIndex = e
- this.proxyObj.page_index = this.pageIndex
- this.getData(this.proxyObj)
- },
- changeSize (e) {
- this.pageSize = e
- this.proxyObj.page_size = this.pageSize
- this.getData(this.proxyObj)
- },
- selectTable (result) {
- this.tableResult = result
- this.tableResult.forEach(element => {
- //入库参照//0未参照1参照采购单2参照到货单3参照质检
- //出库参照//0未参照1参照入库单2参照派工单
- switch (this.type) {
- case 5:
- element.type = 1
- break;
- case 6:
- element.type = 2
- break;
- case 7:
- element.type = 3
- break;
- case 8:
- element.type = 1
- break;
- case 9:
- element.type = 2
- break;
- default:
- break;
- }
- });
- },
- 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: 'post',
- url: this.get_child_url,
- data: {
- plan_no
- }
- }).then((res) => {
- 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://到货单参照采购单
- this.currencyOrder = row.purchase_order_no
- this.axios({
- method: 'get',
- url: this.get_child_url,
- params: {
- purchase_order_no: row.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({
- method: 'get',
- url: this.get_child_url,
- params: {
- refer_order_no: row.purchase_order_no,
- type: this.refer_type
- }
- }).then((res) => {
- this.parts_tableData = [...this.parts_tableData, ...res.data]
- }).catch((err) => { });
- break;
- case 4://质检单参照到货单
- this.currencyOrder = row.purchase_order_arrive_no
- this.axios({
- method: 'get',
- url: this.get_child_url,
- params: {
- refer_order_no: row.purchase_order_arrive_no,
- type: this.refer_type
- }
- }).then((res) => {
- this.parts_tableData = [...this.parts_tableData, ...res.data]
- }).catch((err) => { });
- break;
- case 5://入库单参照采购单
- this.currencyOrder = row.purchase_order_no
- this.axios({
- method: 'get',
- url: this.get_child_url,
- params: {
- refer_order_no: row.purchase_order_no,
- type: this.refer_type
- }
- }).then((res) => {
- this.parts_tableData = [...this.parts_tableData, ...res.data]
- }).catch((err) => { });
- break
- case 6://入库单参照到货单
- this.currencyOrder = row.purchase_order_arrive_no
- this.axios({
- method: 'get',
- url: this.get_child_url,
- params: {
- refer_order_no: row.purchase_order_arrive_no,
- type: this.refer_type
- }
- }).then((res) => {
- this.parts_tableData = [...this.parts_tableData, ...res.data]
- }).catch((err) => { });
- break
- case 7://入库单参照质检单
- this.currencyOrder = row.purchase_order_quality_no
- this.axios({
- method: 'get',
- url: this.get_child_url,
- params: {
- refer_order_no: row.purchase_order_quality_no,
- type: this.refer_type
- }
- }).then((res) => {
- this.parts_tableData = [...this.parts_tableData, ...res.data]
- }).catch((err) => { });
- break
- case 8://出库单参照入库单
- this.currencyOrder = row.order_in_no
- this.axios({
- method: 'get',
- url: this.get_child_url,
- params: {
- refer_order_no: row.order_in_no,
- type: this.refer_type
- }
- }).then((res) => {
- this.parts_tableData = [...this.parts_tableData, ...res.data]
- }).catch((err) => { });
- break
- default:
- break;
- }
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .footer-center {
- display: flex;
- justify-content: center;
- padding: 10px 0;
- }
- /deep/.ivu-table-fixed-body {
- padding-bottom: 20px;
- }
- </style>
|