Kaynağa Gözat

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-aps into dev

quwangxin 2 yıl önce
ebeveyn
işleme
56de511bf4

+ 9 - 0
src/api/saleOrder/index.js

@@ -82,4 +82,13 @@ export async function getOrderDetail (code) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
+}
+
+// 删除
+export async function deleteOrder(data) {
+  const res = await request.delete('/aps/salesorder/delete', {data});
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
 }

+ 1 - 0
src/main.js

@@ -69,6 +69,7 @@ export async function mount (props) {
   render(props);
 }
 
+
 export async function unmount () {
   instance.$destroy();
   instance.$el.innerHTML = '';

+ 6 - 0
src/router/index.js

@@ -10,7 +10,13 @@ import { getToken } from '@/utils/token-util';
 import { routes, getMenuRoutes } from './routes';
 import { SYSTEM_NAME } from '@/config/setting';
 
+
 Vue.use(VueRouter);
+	const originalPush = VueRouter.prototype.push
+	VueRouter.prototype.push = function push (location) {
+	  return originalPush.call(this, location).catch(err => err)
+	}
+
 
 const router = new VueRouter({
   base: window.__POWERED_BY_QIANKUN__

+ 0 - 4
src/views/saleOrder/components/create-order.vue

@@ -241,7 +241,6 @@
 			      productCode: item.code,
 			      productName: item.name,
 			      productUnitWeight: item.netWeight,
-			      // id: item.id,
 				  model:item.modelType,
 				  brandNo:item.brandNum
 			    };
@@ -277,9 +276,6 @@
 			if(pos[index].productUnitWeight){
 				this.$set(pos[index],'deliveryWeight', row.contractNum * row.productUnitWeight)
 			}
-			// else{
-			// 	this.$set(pos[index],'deliveryWeight','-')
-			// }
 		}
 	  
     }

+ 6 - 5
src/views/saleOrder/components/order-detail.vue

@@ -12,11 +12,11 @@
 		<el-descriptions title="" :column="6" size="medium" border>
 		  <el-descriptions-item>
 			<template slot="label"> 销售订单号 </template>
-			2100034996
+			{{form.code}}
 		  </el-descriptions-item>
 		  <el-descriptions-item>
 			<template slot="label"> 下达时间 </template>
-			2023/08/05 18:45:36
+			<!-- {{form.form}} -->
 		  </el-descriptions-item>
 		  <el-descriptions-item>
 			<template slot="label"> 合同数量</template>
@@ -209,7 +209,8 @@
     data() {
       return {
         visible: false,
-	    tableList:[]
+	    tableList:[],
+		form:{}
       };
     },
     computed: {
@@ -218,13 +219,13 @@
     created(){
     },
     methods: {
-	  open () {
+	  open (row) {
 		this.getDetail(row.code)
 		this.visible = true;
 	  },
 	  getDetail(code){
 		  getOrderDetail(code).then(res=>{
-			  console.log('返回',res)
+			 this.form = res
 		  })
 	  },
       cancel () {

+ 26 - 2
src/views/saleOrder/components/order-search.vue

@@ -133,7 +133,7 @@
 			  <el-button type="info"> 
 				  <a :href="fileUrl" download="销售订单导入模板.xls" class="button-link">下载模板</a>
 			  </el-button>
-			  <el-button type="danger">批量删除</el-button>
+			  <el-button type="danger" @click="batchDelete">批量删除</el-button>
 		  </el-form-item>
 		</el-col>
 	</el-row>
@@ -153,7 +153,7 @@
 	import GroupOrder from '../components/group-order.vue'
 	import { importFile } from '@/api/saleOrder';
 	import fileUrl from '@/assets/file/销售订单导入模板.xlsx';
-	import { pullSalesOrder  } from '@/api/saleOrder';
+	import { pullSalesOrder , deleteOrder  } from '@/api/saleOrder';
 	export default {
 		props: {
 			selection:Array
@@ -257,6 +257,30 @@
 			 pullSalesOrder().then(res=>{
 			 })
 		},
+		
+		// 点击批量删除
+		batchDelete(){
+			if(!this.selection.length){
+				return this.$message.warning('请先勾选一个或多个订单!') 
+			}
+			let ids = []
+			this.selection.map(item=>{
+				ids.push(item.id)
+			})
+			this.$confirm('此操作将永久删除所选择的订单, 是否继续?', '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				deleteOrder(ids).then(res=>{
+					this.$message.success(res)
+					this.search();
+				})
+			}).catch(() => {
+				  
+			})
+		},
+		
 	  
 	   handleChange(file, fileList) {
 			this.fileList = fileList;

+ 153 - 143
src/views/saleOrder/index.vue

@@ -55,7 +55,7 @@
   import OrderSearch from './components/order-search.vue';
   import OrderDetail from './components/order-detail.vue';
   import CreateOrder from './components/create-order.vue'
-  import { getPageList  } from '@/api/saleOrder';
+  import { getPageList , deleteOrder } from '@/api/saleOrder';
   import dictMixins from '@/mixins/dictMixins';
   
   export default {
@@ -67,169 +67,176 @@
     },
     data () {
       return {
-        // 表格列配置
-        columns: [
+        // 加载状态
+        loading: false,
+		activeName:"first",
+		selection:[]
+      };
+    },
+    computed: {
+      // 表格列配置
+      columns () {
+        const privateColumn = [];
+        if (this.activeName == 'first' ) {
+          privateColumn.push({
+		    columnKey: 'action',
+		    label: '操作',
+		    width: 150,
+		    align: 'center',
+		    resizable: false,
+		    slot: 'action',
+		    showOverflowTooltip: true,
+			fixed:'right'
+		  });
+        }
+        return [
 		  {
-		    width: 45,
-		    type: 'selection',
-		    columnKey: 'selection',
-		    align: 'center'
+			width: 45,
+			type: 'selection',
+			columnKey: 'selection',
+			align: 'center'
 		  },
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            prop: 'code',
-            label: '销售订单号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110,
-            slot: 'code'
-          },
-          {
-            prop: 'lineNumber',
-            label: '行号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'productCode',
-            label: '产品编码',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'brandNo',
-            label: '牌号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'model',
-            label: '型号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'contractNum',
-            label: '合同数量',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'lackNum',
-            label: '欠交数量',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
 		  {
-		    prop: 'orderLibraryType',
-		    label: '按单按库',
-		    align: 'center',
-		    showOverflowTooltip: true,
-		    minWidth: 110,
-			formatter: (_row, _column, cellValue) => {
-			  return this.getDictValue('按单按库', _row.orderLibraryType);
-			}
+			columnKey: 'index',
+			label: '序号',
+			type: 'index',
+			width: 55,
+			align: 'center',
+			showOverflowTooltip: true,
+			fixed: 'left'
 		  },
 		  {
-		    prop: 'deliveryRequirements',
-		    label: '交付要求',
-		    align: 'center',
-		    showOverflowTooltip: true,
-		    minWidth: 110,
-			formatter: (_row, _column, cellValue) => {
-			  return this.getDictValue('交付要求', _row.deliveryRequirements);
-			}
+			prop: 'code',
+			label: '销售订单号',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110,
+			slot: 'code'
 		  },
 		  {
-		    prop: 'orderType',
-		    label: '订单类型',
-		    align: 'center',
-		    showOverflowTooltip: true,
-		    minWidth: 110,
-			formatter: (_row, _column, cellValue) => {
-			  return this.getDictValue('订单类型', _row.orderType);
-			}
+			prop: 'lineNumber',
+			label: '行号',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110
 		  },
 		  {
-		    prop: 'orderSource',
-		    label: '订单来源',
-		    align: 'center',
-		    showOverflowTooltip: true,
-		    minWidth: 110,
-			formatter: (_row, _column, cellValue) => {
-			  return this.getDictValue('订单来源', _row.orderSource);
-			}
+			prop: 'productCode',
+			label: '产品编码',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110
 		  },
 		  {
-		    prop: 'status',
-		    label: '生产状态',
-		    align: 'center',
-		    showOverflowTooltip: true,
-		    minWidth: 110,
-			formatter: (_row, _column, cellValue) => {
-			  return this.getDictValue('生产状态', _row.status);
-			}
+			prop: 'brandNo',
+			label: '牌号',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110
 		  },
 		  {
-		    prop: 'createTime',
-		    label: '下达时间',
-		    align: 'center',
-		    showOverflowTooltip: true,
-		    minWidth: 110
+			prop: 'model',
+			label: '型号',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110
 		  },
 		  {
-		    prop: 'deliveryTime',
-		    label: '交付日期',
-		    align: 'center',
-		    showOverflowTooltip: true,
-		    minWidth: 110
+			prop: 'contractNum',
+			label: '合同数量',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110
 		  },
 		  {
-		    prop: 'customerName',
-		    label: '客户名称',
-		    align: 'center',
-		    showOverflowTooltip: true,
-		    minWidth: 110
+			prop: 'lackNum',
+			label: '欠交数量',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110
 		  },
 		  {
-		    prop: 'salesman',
-		    label: '业务员',
-		    align: 'center',
-		    showOverflowTooltip: true,
-		    minWidth: 110
+			prop: 'orderLibraryType',
+			label: '按单按库',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110,
+				formatter: (_row, _column, cellValue) => {
+				  return this.getDictValue('按单按库', _row.orderLibraryType);
+				}
 		  },
 		  {
-		    columnKey: 'action',
-		    label: '操作',
-		    width: 150,
-		    align: 'center',
-		    resizable: false,
-		    slot: 'action',
-		    showOverflowTooltip: true,
-			fixed:'right'
-		  }
-        ],
-        // 加载状态
-        loading: false,
-		activeName:"first",
-		selection:[]
-      };
+			prop: 'deliveryRequirements',
+			label: '交付要求',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110,
+				formatter: (_row, _column, cellValue) => {
+				  return this.getDictValue('交付要求', _row.deliveryRequirements);
+				}
+		  },
+		  {
+			prop: 'orderType',
+			label: '订单类型',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110,
+				formatter: (_row, _column, cellValue) => {
+				  return this.getDictValue('订单类型', _row.orderType);
+				}
+		  },
+		  {
+			prop: 'orderSource',
+			label: '订单来源',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110,
+				formatter: (_row, _column, cellValue) => {
+				  return this.getDictValue('订单来源', _row.orderSource);
+				}
+		  },
+		  {
+			prop: 'status',
+			label: '生产状态',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110,
+				formatter: (_row, _column, cellValue) => {
+				  return this.getDictValue('生产状态', _row.status);
+				}
+		  },
+		  {
+			prop: 'createTime',
+			label: '下达时间',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110
+		  },
+		  {
+			prop: 'deliveryTime',
+			label: '交付日期',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110
+		  },
+		  {
+			prop: 'customerName',
+			label: '客户名称',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110
+		  },
+		  {
+			prop: 'salesman',
+			label: '业务员',
+			align: 'center',
+			showOverflowTooltip: true,
+			minWidth: 110
+		  },
+		  ...privateColumn
+        ];
+      }
     },
-    computed: {},
     created () {     
 	  this.requestDict('按单按库');
 	  this.requestDict('交付要求');
@@ -276,7 +283,10 @@
 		 this.$refs.createDialog.open(row) 
 	  },
 	  remove(row){
-		  
+		 deleteOrder([row.id]).then(res=>{
+		 	this.$message.success(res)
+		 	this.reload()
+		 }) 
 	  }
     }
   };

+ 13 - 4
src/views/saleOrder/salesToProduction.vue

@@ -430,7 +430,7 @@
         this.$refs.versionRefs.open();
       },
       confirmVersion (data) {
-        this.$set(this.form, 'productVersionName', data.produceVersionName);
+        this.$set(this.form, 'producteVersionName', data.produceVersionName);
         this.$set(this.form, 'produceVersionId', data.produceVersionId);
         this.form.productline = data.lineNames.length ? data.lineNames[0] : '';
       },
@@ -468,13 +468,22 @@
       },
 
       publishData (type) {
-        console.log('type', type);
         let params = deepClone(this.form);
         delete params.id;
         saveSaleToPlan(params).then((res) => {
+          // reloadPageTab({ fullPath: '/saleOrder' });
+          if (type == 1) {
+            // 提交
+            this.$router.push({
+              path: '/productionPlan'
+            });
+          } else {
+            // 提交并发布
+            this.$router.push({
+              path: '/productionPlan'
+            });
+          }
           finishPageTab();
-          reloadPageTab({ fullPath: '/saleOrder' });
-          this.$router.go(-1);
         });
       }
     }