index.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  1. <template>
  2. <div>
  3. <Modal fullscreen
  4. :title="title"
  5. v-model="show"
  6. @on-ok="then">
  7. <Topsearch ref="topsearch"
  8. :list="set_list"
  9. @init="init"
  10. @searchData="init">
  11. </Topsearch>
  12. <Table @on-select="selectTableProject"
  13. :max-height="maxHeight"
  14. stripe
  15. border
  16. :columns="project_tableColumns"
  17. :data="project_tableData"></Table>
  18. <div ref="footercenter"
  19. class="footer-center">
  20. <Page :total="total"
  21. :current.sync="pageIndex"
  22. :show-total="true"
  23. :page-size="pageSize"
  24. :show-sizer="true"
  25. :show-elevator="true"
  26. @on-change="changePage"
  27. @on-page-size-change="changeSize">
  28. </Page>
  29. </div>
  30. <Topsearch ref="topsearch"
  31. :list="set_childrenList"
  32. :showbtn='set_childrenList.length>0?true:false'
  33. @searchData="childrenSearch"></Topsearch>
  34. <Table row-key="__index"
  35. @on-selection-change="selectTable"
  36. :max-height="maxHeight"
  37. stripe
  38. border
  39. v-if="type!=9"
  40. v-show="type!=14"
  41. :columns="parts_tableColumns"
  42. :data="parts_tableData"></Table>
  43. <vxe-table resizable
  44. border
  45. size="mini"
  46. align="center"
  47. ref="xTree"
  48. v-else
  49. v-show="type!=14"
  50. highlight-hover-row
  51. :scroll-y="{enabled: false}"
  52. :scroll-x="{enabled: false}"
  53. :tree-config="{children: 'children',indent:10,line:true}"
  54. :data="parts_tableData"
  55. @toggle-tree-expand="toggleExpandChangeEvent"
  56. @checkbox-change="selectChangeEvent">
  57. <vxe-table-column field="laravel"
  58. title="展开"
  59. type="checkbox"
  60. tree-node
  61. min-width="50"></vxe-table-column>
  62. <vxe-table-column field="stock_type_title"
  63. title="存货分类名称"
  64. min-width="70"></vxe-table-column>
  65. <vxe-table-column field="code"
  66. title="存货编码"
  67. min-width="80"></vxe-table-column>
  68. <vxe-table-column field="title"
  69. title="存货名称"
  70. :edit-render="{enabled:false}"
  71. min-width="100">
  72. <template #default="{ row }">
  73. <vxe-button type="text"
  74. style="color:#606266">{{row.title}}</vxe-button>
  75. </template>
  76. </vxe-table-column>
  77. <vxe-table-column field="model"
  78. title="规格型号"
  79. min-width="20"></vxe-table-column>
  80. <vxe-table-column field="matching_number"
  81. title="配比数量"
  82. min-width="40"
  83. :edit-render="{enabled:false}"></vxe-table-column>
  84. <vxe-table-column field="number"
  85. title="数量"
  86. min-width="40"
  87. :edit-render="{enabled:false}">
  88. </vxe-table-column>
  89. <vxe-table-column field="unit"
  90. title="计量单位"
  91. min-width="20"></vxe-table-column>
  92. <vxe-table-column field="single"
  93. title="单重"
  94. min-width="20"></vxe-table-column>
  95. <vxe-table-column field="total_single"
  96. title="总重"
  97. min-width="20">
  98. <template #default="{ row }">
  99. <span>{{ countAmount(row) }} </span>
  100. </template>
  101. </vxe-table-column>
  102. <vxe-table-column field="img_number"
  103. title="工程图号"
  104. min-width="40"></vxe-table-column>
  105. <vxe-table-column field="attr"
  106. title="存货属性"
  107. width="180"
  108. :edit-render="{enabled:false,name: '$select', options: stockGoodsList, props: {multiple: true}}"></vxe-table-column>
  109. <vxe-table-column field="remark"
  110. title="备注"
  111. min-width="80"></vxe-table-column>
  112. </vxe-table>
  113. </Modal>
  114. </div>
  115. </template>
  116. <script>
  117. export default {
  118. data () {
  119. return {
  120. show: false,
  121. list: [],
  122. childrenList: [],
  123. stockGoodsList: [],
  124. project_tableColumns: [],
  125. project_tableData: [],
  126. parts_tableColumns: [],
  127. parts_tableData: [],
  128. total: 100,
  129. pageIndex: 1,
  130. pageSize: 10,
  131. maxHeight: null,
  132. proxyObj: {},
  133. get_project_url: '',
  134. params: {},
  135. childrenParams: {},
  136. get_child_url: '',
  137. tableResult: [],
  138. projectDetail: {},
  139. detailProxy: {},
  140. detailChangeProxy: {},
  141. supplierList: [{ label: "1", value: 1 }],
  142. childrenCheck: {},
  143. purchaseTypeList: [],
  144. materialTypeList: [],
  145. currencyOrder: null
  146. }
  147. },
  148. computed: {
  149. set_list () {
  150. switch (this.type) {
  151. case 1:
  152. return [//参照请购单
  153. { title: '订单号', name: 'Input', value: '', placeholder: '请输入订单号', serverName: 'purchase_order_apply_no' },
  154. { title: '请购类型', name: 'Select', value: '', placeholder: '请选择请购类型', serverName: 'type_id', option: this.purchaseTypeList },
  155. { title: '项目名称', name: 'Input', value: '', placeholder: '请输入项目名称', serverName: 'title', },
  156. { title: '制单时间', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', },
  157. ]
  158. case 2:
  159. case 3:
  160. case 5:
  161. return [//参照采购单
  162. { title: '订单号', name: 'Input', value: '', placeholder: '请输入订单号', serverName: 'purchase_order_no' },
  163. { title: '采购类型', name: 'Select', value: '', placeholder: '请选择采购类型', serverName: 'type_id', option: this.purchaseTypeList },
  164. { title: '项目名称', name: 'Input', value: '', placeholder: '请输入项目名称', serverName: 'client_name', },
  165. { title: '供应商名称', name: 'Input', value: '', placeholder: '请输入供应商名称', serverName: 'supply_title', },
  166. { title: '制单时间', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', },
  167. ]
  168. case 4:
  169. case 6:
  170. case 7:
  171. case 8:
  172. case 9:
  173. return [//参照质检单
  174. { title: '订单号', name: 'Input', value: '', placeholder: '请输入订单号', serverName: 'purchase_order_quality_no' },
  175. { title: '项目名称', name: 'Input', value: '', placeholder: '请输入项目名称', serverName: 'type_title', },
  176. { title: '制单时间', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', },
  177. ]
  178. }
  179. },
  180. set_childrenList () {
  181. switch (this.type) {
  182. case 1:
  183. return [//采购参照请购单
  184. { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'type_id', option: this.materialTypeList },
  185. { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'title' },
  186. ]
  187. case 2:
  188. case 3:
  189. case 5:
  190. return [//到货参照采购单
  191. { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'type_id', option: this.materialTypeList },
  192. { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'title' },
  193. ]
  194. case 4:
  195. case 6:
  196. return [//质检参照到货单
  197. { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'type_id', option: this.materialTypeList },
  198. { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'title' },
  199. ]
  200. case 7:
  201. case 8:
  202. case 9:
  203. return [//参照质检单
  204. { title: '物料分类', name: 'Select', value: '', placeholder: '请选择物料分类', serverName: 'type_id', option: this.materialTypeList },
  205. { title: '物料名称', name: 'Input', value: '', placeholder: '请输入物料名称', serverName: 'title' },
  206. ]
  207. }
  208. }
  209. },
  210. watch: {},
  211. created () {
  212. this.axios({
  213. method: 'get',
  214. url: '/api/basics_material_index',
  215. }).then((res) => {
  216. this.materialTypeList = res.data.data
  217. this.materialTypeList.forEach(element => {
  218. element.label = element.title
  219. element.value = element.type_id
  220. });
  221. }).catch((err) => { });
  222. switch (this.type) {
  223. case 1: //采购单参照请购单
  224. this.project_tableColumns = [
  225. { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
  226. // { title: '订单号', align: 'center', key: 'purchase_order_apply_no', minWidth: 200, },
  227. { title: '订单号', align: 'center', key: 'purchase_order_apply_no', minWidth: 200, },
  228. { title: '请购类型', align: 'center', key: 'type_title', minWidth: 150, },
  229. { title: '项目名称', align: 'center', key: 'residential_name', minWidth: 150 },
  230. {
  231. title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
  232. render: (h, params) =>
  233. h('span', this.func.replaceDate(params.row.crt_time * 1)),
  234. },
  235. ]
  236. this.parts_tableColumns = [
  237. { type: 'selection', align: 'center', minWidth: 100, fixed: 'left' },
  238. { title: '物料分类', key: 'type_title', align: 'center', minWidth: 150 },
  239. { title: '物料名称', key: 'title', align: 'center', minWidth: 150 },
  240. {
  241. title: '物料规格', key: '', align: 'center', minWidth: 150,
  242. render: (h, params) => {
  243. const { row } = params
  244. let text = `${row.long}*${row.width}*${row.high}`
  245. return h('span', {}, text)
  246. }
  247. },
  248. { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
  249. { title: '请购数量', key: 'num', align: 'center', minWidth: 150 },
  250. ]
  251. this.get_project_url = '/api/purchase_apply_list'
  252. this.get_child_url = '/api/purchase_refer_apply'
  253. this.childrenParams = {}
  254. break
  255. case 2: //到货单参照采购单
  256. this.project_tableColumns = [
  257. { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
  258. { title: '订单号', align: 'center', key: 'purchase_order_no', minWidth: 200, },
  259. { title: '采购类型', align: 'center', key: 'type_title', minWidth: 100, },
  260. { title: '项目名称', align: 'center', key: 'residential_name', minWidth: 150 },
  261. { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 },
  262. {
  263. title: '预计到货', align: 'center', key: 'arrive_time', minWidth: 200,
  264. render: (h, params) =>
  265. h('span', this.func.replaceDate(params.row.arrive_time * 1)),
  266. },
  267. {
  268. title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
  269. render: (h, params) =>
  270. h('span', this.func.replaceDate(params.row.crt_time * 1)),
  271. },
  272. ]
  273. this.parts_tableColumns = [
  274. { type: 'selection', align: 'center', minWidth: 100, fixed: 'left' },
  275. { title: '物料分类', key: 'type_title', align: 'center', minWidth: 150 },
  276. { title: '物料名称', key: 'title', align: 'center', minWidth: 150 },
  277. {
  278. title: '物料规格', key: '', align: 'center', minWidth: 150,
  279. render: (h, params) => {
  280. const { row } = params
  281. let text = `${row.long}*${row.width}*${row.high}`
  282. return h('span', {}, text)
  283. }
  284. },
  285. { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
  286. { title: '采购数量', key: 'num', align: 'center', minWidth: 150 },
  287. ]
  288. this.get_project_url = '/api/purchase_list'
  289. this.get_child_url = '/api/purchase_refer'
  290. this.childrenParams = {}
  291. break
  292. case 3: //质检单参照采购单
  293. this.project_tableColumns = [
  294. { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
  295. { title: '订单号', align: 'center', key: 'purchase_order_no', minWidth: 200, },
  296. { title: '采购类型', align: 'center', key: 'type_title', minWidth: 100, },
  297. { title: '项目名称', align: 'center', key: 'residential_name', minWidth: 150 },
  298. { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 },
  299. {
  300. title: '预计到货', align: 'center', key: 'arrive_time', minWidth: 200,
  301. render: (h, params) =>
  302. h('span', this.func.replaceDate(params.row.arrive_time * 1)),
  303. },
  304. {
  305. title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
  306. render: (h, params) =>
  307. h('span', this.func.replaceDate(params.row.crt_time * 1)),
  308. },
  309. ]
  310. this.parts_tableColumns = [
  311. { type: 'selection', align: 'center', minWidth: 100, fixed: 'left' },
  312. { title: '物料分类', key: 'type_title', align: 'center', minWidth: 150 },
  313. { title: '物料名称', key: 'title', align: 'center', minWidth: 150 },
  314. {
  315. title: '物料规格', key: '', align: 'center', minWidth: 150,
  316. render: (h, params) => {
  317. const { row } = params
  318. let text = `${row.long}*${row.width}*${row.high}`
  319. return h('span', {}, text)
  320. }
  321. },
  322. { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
  323. { title: '采购数量', key: 'num', align: 'center', minWidth: 150 },
  324. ]
  325. this.get_project_url = '/api/purchase_list'
  326. this.get_child_url = '/api/quality_refer'
  327. this.childrenParams = { type: this.refer_type }
  328. break
  329. case 4: //质检单参照到货单
  330. this.project_tableColumns = [
  331. { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
  332. { title: '订单号', align: 'center', key: 'purchase_order_arrive_no', minWidth: 200, },
  333. { title: '项目名称', align: 'center', key: 'type_title', minWidth: 150 },
  334. { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 },
  335. {
  336. title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
  337. render: (h, params) =>
  338. h('span', this.func.replaceDate(params.row.crt_time * 1)),
  339. },
  340. ]
  341. this.parts_tableColumns = [
  342. { type: 'selection', align: 'center', minWidth: 100, fixed: 'left' },
  343. { title: '物料分类', key: 'type_title', align: 'center', minWidth: 150 },
  344. { title: '物料名称', key: 'title', align: 'center', minWidth: 150 },
  345. {
  346. title: '物料规格', key: '', align: 'center', minWidth: 150,
  347. render: (h, params) => {
  348. const { row } = params
  349. let text = `${row.long}*${row.width}*${row.high}`
  350. return h('span', {}, text)
  351. }
  352. },
  353. { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
  354. { title: '到货数量', key: 'num', align: 'center', minWidth: 150 },
  355. ]
  356. this.get_project_url = '/api/purchase_arrive_list'
  357. this.get_child_url = '/api/quality_refer'
  358. this.childrenParams = { type: this.refer_type }
  359. break
  360. case 5: //入库单参照采购单
  361. this.project_tableColumns = [
  362. { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
  363. { title: '订单号', align: 'center', key: 'purchase_order_no', minWidth: 200, },
  364. { title: '采购类型', align: 'center', key: 'type_title', minWidth: 100, },
  365. { title: '项目名称', align: 'center', key: 'residential_name', minWidth: 150 },
  366. { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 },
  367. {
  368. title: '预计到货', align: 'center', key: 'arrive_time', minWidth: 200,
  369. render: (h, params) =>
  370. h('span', this.func.replaceDate(params.row.arrive_time * 1)),
  371. },
  372. {
  373. title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
  374. render: (h, params) =>
  375. h('span', this.func.replaceDate(params.row.crt_time * 1)),
  376. },
  377. ]
  378. this.parts_tableColumns = [
  379. { type: 'selection', align: 'center', minWidth: 100, fixed: 'left' },
  380. { title: '物料分类', key: 'type_title', align: 'center', minWidth: 150 },
  381. { title: '物料名称', key: 'title', align: 'center', minWidth: 150 },
  382. {
  383. title: '物料规格', key: '', align: 'center', minWidth: 150,
  384. render: (h, params) => {
  385. const { row } = params
  386. let text = `${row.long}*${row.width}*${row.high}`
  387. return h('span', {}, text)
  388. }
  389. },
  390. { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
  391. { title: '采购数量', key: 'num', align: 'center', minWidth: 150 },
  392. ]
  393. this.get_project_url = '/api/purchase_list'
  394. this.get_child_url = '/api/warehouse_order_in_refer'
  395. this.childrenParams = { type: this.refer_type }
  396. break
  397. case 6: //入库单参照到货单
  398. this.project_tableColumns = [
  399. { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
  400. { title: '订单号', align: 'center', key: 'purchase_order_arrive_no', minWidth: 200, },
  401. { title: '项目名称', align: 'center', key: 'type_title', minWidth: 150 },
  402. { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 },
  403. {
  404. title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
  405. render: (h, params) =>
  406. h('span', this.func.replaceDate(params.row.crt_time * 1)),
  407. },
  408. ]
  409. this.parts_tableColumns = [
  410. { type: 'selection', align: 'center', minWidth: 100, fixed: 'left' },
  411. { title: '物料分类', key: 'type_title', align: 'center', minWidth: 150 },
  412. { title: '物料名称', key: 'title', align: 'center', minWidth: 150 },
  413. {
  414. title: '物料规格', key: '', align: 'center', minWidth: 150,
  415. render: (h, params) => {
  416. const { row } = params
  417. let text = `${row.long}*${row.width}*${row.high}`
  418. return h('span', {}, text)
  419. }
  420. },
  421. { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
  422. { title: '到货数量', key: 'num', align: 'center', minWidth: 150 },
  423. ]
  424. this.get_project_url = '/api/purchase_arrive_list'
  425. this.get_child_url = '/api/warehouse_order_in_refer'
  426. this.childrenParams = { type: this.refer_type }
  427. break
  428. case 7: //入库单参照质检单
  429. this.project_tableColumns = [
  430. { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
  431. { title: '订单号', align: 'center', key: 'purchase_order_quality_no', minWidth: 200, },
  432. { title: '项目名称', align: 'center', key: 'type_title', minWidth: 150 },
  433. { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 },
  434. {
  435. title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
  436. render: (h, params) =>
  437. h('span', this.func.replaceDate(params.row.crt_time * 1)),
  438. },
  439. ]
  440. this.parts_tableColumns = [
  441. { type: 'selection', align: 'center', minWidth: 100, fixed: 'left' },
  442. { title: '物料分类', key: 'type_title', align: 'center', minWidth: 150 },
  443. { title: '物料名称', key: 'title', align: 'center', minWidth: 150 },
  444. {
  445. title: '物料规格', key: '', align: 'center', minWidth: 150,
  446. render: (h, params) => {
  447. const { row } = params
  448. let text = `${row.long}*${row.width}*${row.high}`
  449. return h('span', {}, text)
  450. }
  451. },
  452. { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
  453. { title: '质检数量', key: 'num', align: 'center', minWidth: 150 },
  454. ]
  455. this.get_project_url = '/api/purchase_quality_list'
  456. this.get_child_url = '/api/warehouse_order_in_refer'
  457. this.childrenParams = { type: this.refer_type }
  458. break
  459. case 8: //出库单参照入库单
  460. this.project_tableColumns = [
  461. { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
  462. { title: '订单号', align: 'center', key: 'order_in_no', minWidth: 200, },
  463. { title: '项目名称', align: 'center', key: 'residential_name', minWidth: 150 },
  464. { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 },
  465. { title: '操作员', align: 'center', key: 'nickname', minWidth: 100 },
  466. {
  467. title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
  468. render: (h, params) =>
  469. h('span', this.func.replaceDate(params.row.crt_time * 1)),
  470. },
  471. ]
  472. this.parts_tableColumns = [
  473. { type: 'selection', align: 'center', minWidth: 100, fixed: 'left' },
  474. { title: '物料分类', key: 'type_title', align: 'center', minWidth: 150 },
  475. { title: '物料名称', key: 'title', align: 'center', minWidth: 150 },
  476. {
  477. title: '物料规格', key: '', align: 'center', minWidth: 150,
  478. render: (h, params) => {
  479. const { row } = params
  480. let text = `${row.long}*${row.width}*${row.high}`
  481. return h('span', {}, text)
  482. }
  483. },
  484. { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
  485. { title: '派工数量', key: 'num', align: 'center', minWidth: 150 },
  486. ]
  487. this.get_project_url = '/api/warehouse_order_in_list'
  488. this.get_child_url = '/api/warehouse_order_out_refer'
  489. this.childrenParams = { type: this.refer_type }
  490. break
  491. case 9: //出库单参照派工单
  492. break
  493. case 15: //参照质检单
  494. this.list = [
  495. { title: '订单号', name: 'Input', value: '', placeholder: '请输入订单号', serverName: 'purchase_order_quality_no' },
  496. { title: '项目名称', name: 'Input', value: '', placeholder: '请输入项目名称', serverName: 'type_title', },
  497. { title: '制单时间', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', },
  498. ]
  499. this.project_tableColumns = [
  500. { title: '选择', align: 'center', minWidth: 100, type: 'selection' },
  501. { title: '订单号', align: 'center', key: 'purchase_order_quality_no', minWidth: 200, },
  502. { title: '项目名称', align: 'center', key: 'type_title', minWidth: 150 },
  503. { title: '供应商名称', align: 'center', key: 'supply_title', minWidth: 150 },
  504. {
  505. title: '制单日期', align: 'center', key: 'crt_time', minWidth: 200,
  506. render: (h, params) =>
  507. h('span', this.func.replaceDate(params.row.crt_time * 1)),
  508. },
  509. ]
  510. this.parts_tableColumns = [
  511. { type: 'selection', align: 'center', minWidth: 100, fixed: 'left' },
  512. { title: '物料分类', key: 'type_title', align: 'center', minWidth: 150 },
  513. { title: '物料名称', key: 'title', align: 'center', minWidth: 150 },
  514. {
  515. title: '物料规格', key: '', align: 'center', minWidth: 150,
  516. render: (h, params) => {
  517. const { row } = params
  518. let text = `${row.long}*${row.width}*${row.high}`
  519. return h('span', {}, text)
  520. }
  521. },
  522. { title: '计量单位', key: 'unit', align: 'center', minWidth: 150 },
  523. { title: '质检数量', key: 'num', align: 'center', minWidth: 150 },
  524. ]
  525. this.get_project_url = '/api/purchase_quality_list'
  526. this.get_child_url = '/api/purchase_quality_detail'
  527. // this.childrenParams = { type: 3}
  528. break
  529. }
  530. },
  531. mounted () {
  532. // 获取采购类型
  533. this.axios({ method: 'get', url: '/api/basic_purchase_list', }).then((res) => {
  534. this.purchaseTypeList = res.data.data
  535. this.purchaseTypeList.forEach(element => {
  536. element.value = element.type_id
  537. element.label = element.title
  538. })
  539. }).catch((err) => { });
  540. this.$nextTick((e) => {
  541. const clientTableHeight = window.innerHeight - 51 - 57 -
  542. this.$refs['topsearch'].$el.clientHeight -
  543. this.$refs['footercenter'].clientHeight
  544. this.maxHeight = Math.floor(clientTableHeight / 2) - 20
  545. })
  546. },
  547. methods: {
  548. selectChangeEvent ({ records }) {
  549. this.tableResult = JSON.parse(JSON.stringify(records))
  550. },
  551. toggleExpandChangeEvent () { },
  552. countAmount (row) {
  553. return row.single * row.number
  554. },
  555. then () {
  556. this.$emit('then')
  557. },
  558. init (row) {
  559. row.page_index = 1
  560. row.page_size = this.pageSize
  561. let params = {
  562. ...this.params,
  563. ...row,
  564. sub_state: 1,
  565. }
  566. this.proxyObj = params
  567. this.parts_tableData = []
  568. this.getData(params)
  569. },
  570. childrenSearch (row) {
  571. switch (this.type) {
  572. case 1:
  573. row.purchase_order_apply_no = this.currencyOrder
  574. break;
  575. case 2:
  576. row.purchase_order_no = this.currencyOrder
  577. break;
  578. case 3:
  579. case 4:
  580. case 5:
  581. case 6:
  582. case 7:
  583. case 8:
  584. case 9:
  585. row.refer_order_no = this.currencyOrder
  586. break;
  587. // case 3:
  588. // row.purchase_order_arrive_no = this.currencyOrder
  589. // break;
  590. // case 4:
  591. // row.purchase_order_quality_no = this.currencyOrder
  592. // break;
  593. }
  594. this.axios({
  595. method: 'get',
  596. url: this.get_child_url,
  597. params: {
  598. ...row,
  599. type: this.refer_type
  600. }
  601. }).then((res) => {
  602. if (res.code == 200) {
  603. const deep_obj = JSON.parse(JSON.stringify(res.data))
  604. this.projectDetail = deep_obj
  605. this.parts_tableData = res.data.list
  606. }
  607. }).catch((err) => { });
  608. },
  609. getData (params) {
  610. params.end_time = Date.parse(params.end_time).toString().slice(0,10)
  611. params.start_time = Date.parse(params.start_time).toString().slice(0,10)
  612. this.axios(this.get_project_url, { params: params }).then((res) => {
  613. if (res.code == 200) {
  614. res.data.data.map((v) => (v.check = false))
  615. this.project_tableData = res.data.data
  616. this.total = res.data.total
  617. }
  618. })
  619. },
  620. renderRadio (h, params) {
  621. const { row, index } = params
  622. return h('Radio', {
  623. props: {
  624. value: row.check,
  625. },
  626. on: {
  627. 'on-change': (e) => {
  628. if (this.type != 14) {
  629. this.project_tableData.forEach((item) => (item.check = false))
  630. this.project_tableData[index].check = true
  631. this.childrenCheck = this.params
  632. this.childrenCheck.id = row.id
  633. this.childrenCheck.project_sub_id = row.project_sub_id
  634. this.changeRadio(this.project_tableData[index])
  635. } else {
  636. // console.log('this.project_tableData[index] :>> ', this.project_tableData[index]);
  637. this.tableResult = [this.project_tableData[index]]
  638. }
  639. },
  640. },
  641. })
  642. },
  643. changeRadio (row) {
  644. console.log('row :>> ', row);
  645. },
  646. changePage (e) {
  647. this.pageIndex = e
  648. this.proxyObj.page_index = this.pageIndex
  649. this.getData(this.proxyObj)
  650. },
  651. changeSize (e) {
  652. this.pageSize = e
  653. this.proxyObj.page_size = this.pageSize
  654. this.getData(this.proxyObj)
  655. },
  656. selectTable (result) {
  657. this.tableResult = result
  658. this.tableResult.forEach(element => {
  659. //入库参照//0未参照1参照采购单2参照到货单3参照质检
  660. //出库参照//0未参照1参照入库单2参照派工单
  661. switch (this.type) {
  662. case 5:
  663. element.type = 1
  664. break;
  665. case 6:
  666. element.type = 2
  667. break;
  668. case 7:
  669. element.type = 3
  670. break;
  671. case 8:
  672. element.type = 1
  673. break;
  674. case 9:
  675. element.type = 2
  676. break;
  677. default:
  678. break;
  679. }
  680. });
  681. },
  682. selectTableProject (selection, row) {
  683. switch (this.type) {
  684. case 1://采购单参照请购单
  685. this.currencyOrder = row.purchase_order_apply_no
  686. this.axios({
  687. method: 'get',
  688. url: this.get_child_url,
  689. params: {
  690. purchase_order_apply_no: row.purchase_order_apply_no
  691. }
  692. }).then((res) => {
  693. res.data.forEach(element => {
  694. element.residential_name = row.residential_name
  695. });
  696. this.parts_tableData = [...this.parts_tableData, ...res.data]
  697. }).catch((err) => { });
  698. break;
  699. case 2://到货单参照采购单
  700. this.currencyOrder = row.purchase_order_no
  701. this.axios({
  702. method: 'get',
  703. url: this.get_child_url,
  704. params: {
  705. purchase_order_no: row.purchase_order_no
  706. }
  707. }).then((res) => {
  708. this.parts_tableData = [...this.parts_tableData, ...res.data]
  709. }).catch((err) => { });
  710. break;
  711. case 3://质检单参照采购单
  712. this.currencyOrder = row.purchase_order_no
  713. this.axios({
  714. method: 'get',
  715. url: this.get_child_url,
  716. params: {
  717. refer_order_no: row.purchase_order_no,
  718. type: this.refer_type
  719. }
  720. }).then((res) => {
  721. this.parts_tableData = [...this.parts_tableData, ...res.data]
  722. }).catch((err) => { });
  723. break;
  724. case 4://质检单参照到货单
  725. this.currencyOrder = row.purchase_order_arrive_no
  726. this.axios({
  727. method: 'get',
  728. url: this.get_child_url,
  729. params: {
  730. refer_order_no: row.purchase_order_arrive_no,
  731. type: this.refer_type
  732. }
  733. }).then((res) => {
  734. this.parts_tableData = [...this.parts_tableData, ...res.data]
  735. }).catch((err) => { });
  736. break;
  737. case 5://入库单参照采购单
  738. this.currencyOrder = row.purchase_order_no
  739. this.axios({
  740. method: 'get',
  741. url: this.get_child_url,
  742. params: {
  743. refer_order_no: row.purchase_order_no,
  744. type: this.refer_type
  745. }
  746. }).then((res) => {
  747. this.parts_tableData = [...this.parts_tableData, ...res.data]
  748. }).catch((err) => { });
  749. break
  750. case 6://入库单参照到货单
  751. this.currencyOrder = row.purchase_order_arrive_no
  752. this.axios({
  753. method: 'get',
  754. url: this.get_child_url,
  755. params: {
  756. refer_order_no: row.purchase_order_arrive_no,
  757. type: this.refer_type
  758. }
  759. }).then((res) => {
  760. this.parts_tableData = [...this.parts_tableData, ...res.data]
  761. }).catch((err) => { });
  762. break
  763. case 7://入库单参照质检单
  764. this.currencyOrder = row.purchase_order_quality_no
  765. this.axios({
  766. method: 'get',
  767. url: this.get_child_url,
  768. params: {
  769. refer_order_no: row.purchase_order_quality_no,
  770. type: this.refer_type
  771. }
  772. }).then((res) => {
  773. this.parts_tableData = [...this.parts_tableData, ...res.data]
  774. }).catch((err) => { });
  775. break
  776. case 8://出库单参照入库单
  777. this.currencyOrder = row.order_in_no
  778. this.axios({
  779. method: 'get',
  780. url: this.get_child_url,
  781. params: {
  782. refer_order_no: row.order_in_no,
  783. type: this.refer_type
  784. }
  785. }).then((res) => {
  786. this.parts_tableData = [...this.parts_tableData, ...res.data]
  787. }).catch((err) => { });
  788. break
  789. default:
  790. break;
  791. }
  792. },
  793. },
  794. }
  795. </script>
  796. <style lang="scss" scoped>
  797. .footer-center {
  798. display: flex;
  799. justify-content: center;
  800. padding: 10px 0;
  801. }
  802. /deep/.ivu-table-fixed-body {
  803. padding-bottom: 20px;
  804. }
  805. </style>