123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <template>
- <div class="page">
- <template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="50"
- :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
- :operation="operation" :exportList="exportList">
-
- <div slot="moreSearch">
- <el-radio-group v-model="flag" size="mini" @change="changeType">
- <el-radio-button label="">全部</el-radio-button>
- <el-radio-button label="PAY_NOT_TAKE">已支付</el-radio-button>
- <el-radio-button label="SUBMIT">未支付</el-radio-button>
- <el-radio-button label="PAY_TAKE">已提货</el-radio-button>
- </el-radio-group>
- <br><br>
- </div>
- </template-page>
- <div class="detail" v-if="formDialog">
- <attachmentSalesOrderDetail :id="id" @back="backList" :formType="formDialogType" :title="'辅材销售订单' + formDialogTitles[formDialogType]"></attachmentSalesOrderDetail>
- </div>
- </div>
- </template>
- <script>
- import TemplatePage from '@/components/template/template-page-1.vue'
- import attachmentSalesOrderDetail from '../components/attachmentSalesOrderDetail.vue'
- import import_mixin from '@/components/template/import_mixin.js'
- import ImageUpload from '@/components/file-upload'
- import { downloadFiles } from '@/utils/util'
- import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
- import { listPageV2,pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
- export default {
- components: { TemplatePage, ImageUpload, attachmentSalesOrderDetail },
- mixins: [import_mixin],
- data() {
- return {
- // 事件组合
- optionsEvensGroup: [
- [
- [
- {
- name: '新建',
- click: this.addData
- }
- ]
- ]
- ],
- // 表格属性
- tableAttributes: {
- // 启用勾选列
- selectColumn: true
- },
- // 表格事件
- tableEvents: {
- 'selection-change': this.selectionChange
- },
- // 勾选选中行
- recordSelected: [],
- /** 表单变量 */
- formDialogType: 0,
- formDialogTitles: ["新增","编辑", "详情"],
- formDialog: false,
- id: '',
- flag: ''
- }
- },
- computed: {
- // 更多参数
- moreParameters() {
- return []
- },
- formItems() {}
- },
- methods: {
- // 切换状态
- changeType(val) {
- this.$refs.pageRef.refreshList()
- },
- backList() {
- this.formDialog = false;
- this.$refs.pageRef.refreshList()
- },
- // 列表请求函数
- getList(p) {
- try {
- var pam = JSON.parse(JSON.stringify(p))
- pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'P' },{'param': 'a.flag', "compare": "=", "value": this.flag})
- return listPageV2(pam)
- } catch (error) {
- console.log(error)
- }
- },
- // 列表导出函数
- exportList: pageExport,
- // 表格列解析渲染数据更改
- columnParsing(item, defaultData) {
- if (item.jname === 'idCardImg') {
- defaultData.render = (h, { row, index, column }) => {
- return (
- <div style="padding:0 6px;cursor: pointer;">
- {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
- </div>
- )
- }
- }
- return defaultData
- },
- // 监听勾选变化
- selectionChange(data) {
- this.recordSelected = data
- },
- // 表格操作列
- operation(h, { row, index, column }) {
- return (
- <div class='operation-btns'>
- <el-button type="text" onClick={() => {
- this.id = row.salesId
- this.formDialogType = 1
- this.openForm()
- }}>编辑</el-button>
- </div>
- )
- },
- addData() {
- this.formDialogType = 0
- this.openForm()
- },
- openForm() {
- this.formDialog = true;
- },
- // 下载导入模版
- handleDownload() {
- // downloadFiles('charging/standard/download');
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .page{
- height: 100%;
- }
- .tab{
- padding: 20px 20px 0 20px;
- }
- </style>
|