zhangqiOMG 2 years ago
parent
commit
943b430e5d

+ 10 - 1
src/DRP/SDrpManagement/dispatchAgent/index.vue

@@ -12,6 +12,7 @@
 
 <script setup>
   import utils from '@/utils/utils'
+  import Api from '@/api/api'
   import listTemp from '@/components/listTemplate/index.vue';
   import { ref } from 'vue'
   import { useRouter } from "vue-router";
@@ -19,8 +20,9 @@
   const router = useRouter()
   const list = ref()
   let dataSource = ref([])
+  const statusTypeOptions = ref([])
   let searchType = ref([
-    {label:'状态',key:'status',type:'select',dataSource:[{remarks:'新建',value:'新建'},{remarks:'审核',value:'审核'},{remarks:'复核',value:'复核'},{remarks:'关闭',value:'关闭'}]},
+    {label:'状态',key:'status',type:'select',dataSource:statusTypeOptions},
     {label:'时间范围',key:'dateRange',type:'datepickerRange',objKeys:['begindate','enddate']},
     {label:'搜索',key:'condition',type:'input'},
   ])
@@ -37,6 +39,13 @@
   const onSuccess = ()=>{
     list.value.tableData()
   }
+  const statusType = async ()=>{
+    const res = await Api.optionstype('dealershippingorderscreening')
+    statusTypeOptions.value = res.data
+  }
+  onMounted (()=>{
+    statusType()
+  })
 </script>
 <style>
 </style>

+ 4 - 1
src/DRP/SDrpManagement/order/detail/index.vue

@@ -6,7 +6,8 @@
           <edit v-if="utils.hasPermission('update')" :data="orderData" @onSuccess="mianData" :disabled="utils.isDisabled(orderData.status,['提交','审核','关闭'],specialOrder('编辑'))"></edit>
           <a-button v-if="orderData.type === '特殊订单' && utils.hasPermission('preSubmission')" type="primary" @click="preSubmission" :disabled="utils.isDisabled(orderData.status,['提交','审核','关闭','预提交','确认'])">预提交</a-button>
           <a-button v-if="utils.hasPermission('submit')" type="primary" @click="submitOrder" :disabled="utils.isDisabled(orderData.status,['提交','审核','关闭'],(specialOrder('提交')))">提交</a-button>
-          <!-- <a-button type="primary" @click="backOrder" :disabled="utils.isDisabled(orderData.status,['新建','审核','关闭'],specialOrder('撤回'))">撤回</a-button> -->
+          <!-- <a-button type="primary" @click="backOrder">打印</a-button> -->
+          <report-print :data="orderData" keyname="sa_orderid"></report-print>
         </a-space>
       </template>
       <template #tab0>
@@ -69,6 +70,8 @@ import Api from '@/api/api'
 import productList from '@/template/billProductTable/index.vue'
 import SelectProduct from '@/template/selectProduct/index.vue'
 import detailTemplate from '@/components/detailTemplate/index.vue'
+import reportPrint from '@/components/reportPrint/index.vue'
+
 import edit from './modules/edit.vue'
 import OdProgress from './tabs/progress.vue'
 import DispatchTemp from './tabs/dispatch.vue'

+ 92 - 0
src/components/reportPrint/index.vue

@@ -0,0 +1,92 @@
+<template>
+  <div>
+    <a-button type="primary" @click="showDrawer">打印</a-button>
+    <a-drawer
+      v-model:visible="visible"
+      class="custom-class"
+      title="报表打印"
+      placement="right"
+      width="600"
+      :closable="false"
+      @close="onClose">
+      <a-table :dataSource="dataSource" :columns="columns" size="small">
+        <template #bodyCell="{ column, record }">
+          <template v-if="column.key === 'operation'">
+            <a @click="printData(record)">
+              打印
+            </a>
+          </template>
+        </template>
+      </a-table>
+      <template #extra>
+        <a-space>
+          <a-button @click="onClose">关闭</a-button>
+        </a-space>
+      </template>
+    </a-drawer>
+  </div>
+</template>
+
+<script setup>
+import {ref,defineProps} from 'vue'
+import Api from '@/api/api'
+const props = defineProps(['keyname','data'])
+const visible = ref(false)
+const form = ref({
+  type:'标准订单',
+  enterprisename:''
+})
+const columns = [{
+  title: '报表名称',
+  dataIndex: 'name',
+  key: 'name',
+},
+{
+  title: '操作',
+  dataIndex: 'operation',
+  key: 'operation',
+},]
+const showDrawer = ()=>{
+  console.log(props.data,props.keyname)
+  visible.value = true
+  getData()
+}
+const onClose = () => {
+  visible.value = false;
+};
+const dataSource = ref([])
+const getData = async ()=>{
+  let appid = sessionStorage.getItem('app')?JSON.parse(sessionStorage.getItem('app')).systemappid:''
+  const res = await Api.requested({
+    id:20221213094401,
+    content:{
+      systemappid:appid
+    }
+  })
+  dataSource.value = res.data
+}
+const DynamicAcquisitionURL = ()=> {
+    var str = window.location.href;
+    var index = str.indexOf('/');
+    var num = 0;
+    while(index !== -1) {
+        num++;
+        index = str.indexOf('/',index + 1);
+        if (num++ === 3) {
+            return str.slice(0, index);
+        }
+    }
+}
+const printData = async (record)=>{
+  let res = await Api.requested({
+    "id":20221213094501,
+    "content": {
+      sys_reportid:record.sys_reportid,
+      dataid:props.data[props.keyname]
+    }
+  })
+  window.open(DynamicAcquisitionURL() + res.data + `&${props.keyname}=${props.data[props.keyname]}`)
+}
+</script>
+<style>
+</style>