123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810 |
- <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-select="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"></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
- }
- },
- 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: '结束日期', },
- ]
- 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: 'type_id', option: this.materialTypeList },
- { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'title' },
- ]
- 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: '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: '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_apply_list'
- this.get_child_url = '/api/purchase_refer_apply'
- 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 () {
- // 获取采购类型
- this.axios({ method: 'get', url: '/api/basic_purchase_list', }).then((res) => {
- this.purchaseTypeList = res.data.data
- this.purchaseTypeList.forEach(element => {
- element.value = element.type_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.purchase_order_apply_no = this.currencyOrder
- 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: 'get',
- url: this.get_child_url,
- params: {
- ...row,
- type: this.refer_type
- }
- }).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)
- 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
- }
- })
- },
- 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, row) {
- switch (this.type) {
- case 1://采购单参照请购单
- this.currencyOrder = row.purchase_order_apply_no
- this.axios({
- method: 'get',
- url: this.get_child_url,
- params: {
- purchase_order_apply_no: row.purchase_order_apply_no
- }
- }).then((res) => {
- res.data.forEach(element => {
- element.residential_name = row.residential_name
- });
- this.parts_tableData = [...this.parts_tableData, ...res.data]
- }).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>
|