cmy 7 mēneši atpakaļ
vecāks
revīzija
a12ca64fcc

+ 0 - 131
.github/workflows/auto-merge.yml

@@ -1,131 +0,0 @@
-name: Automerge
-
-on:
-  pull_request:
-    types:
-      - labeled
-      - unlabeled
-      - synchronize
-      - opened
-      - edited
-      - ready_for_review
-      - reopened
-      - unlocked
-  pull_request_review:
-    types:
-      - submitted
-  status: {}
-
-jobs:
-  # 合并发布版本的 pr 到 master
-  auto-merge:
-    runs-on: ubuntu-latest
-    steps:
-      - name: Automerge
-        uses: 'pascalgn/automerge-action@v0.14.3'
-        env:
-          BASE_BRANCHES: 'release'
-          GITHUB_TOKEN: '${{ secrets.TOKEN }}'
-          MERGE_LABELS: ''
-          MERGE_FILTER_AUTHOR: 'kailong321200875'
-
-  push-to-gh-pages:
-    needs: [auto-merge]
-    runs-on: ubuntu-latest
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v2
-
-      - name: Setup Pnpm
-        uses: pnpm/action-setup@v2
-        with:
-          version: latest
-
-      - name: use Node.js 18
-        uses: actions/setup-node@v2.1.2
-        with:
-          node-version: '18.x'
-
-      - name: Set SSH Environment
-        env:
-          DOCS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
-        run: |
-          mkdir -p ~/.ssh/
-          echo "$ACTIONS_DEPLOY_KEY" > ~/.ssh/id_rsa
-          chmod 600 ~/.ssh/id_rsa
-          ssh-keyscan github.com > ~/.ssh/known_hosts
-          chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
-          git config --local user.email "321200875@qq.com"
-          git config --local user.name "kailong321200875"
-
-      # 发布到 github
-      - name: Build Github
-        run: |
-          pnpm install --no-frozen-lockfile
-          pnpm run build:pro
-
-      - name: Deploy Github
-        uses: peaceiris/actions-gh-pages@v3
-        with:
-          deploy_key: ${{secrets.ACTIONS_DEPLOY_KEY}}
-          publish_branch: gh-pages
-          publish_dir: ./dist-pro
-          force_orphan: true
-          cname: element-plus-admin.cn
-
-  push-to-gh-pages-gitee:
-    needs: [auto-merge]
-    runs-on: ubuntu-latest
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v2
-
-      - name: Setup Pnpm
-        uses: pnpm/action-setup@v2
-        with:
-          version: latest
-
-      - name: use Node.js 18
-        uses: actions/setup-node@v2.1.2
-        with:
-          node-version: '18.x'
-
-      - name: Set SSH Environment
-        env:
-          DOCS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
-        run: |
-          mkdir -p ~/.ssh/
-          echo "$ACTIONS_DEPLOY_KEY" > ~/.ssh/id_rsa
-          chmod 600 ~/.ssh/id_rsa
-          ssh-keyscan github.com > ~/.ssh/known_hosts
-          chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
-          git config --local user.email "321200875@qq.com"
-          git config --local user.name "kailong321200875"
-
-      - name: Build Gitee
-        run: |
-          pnpm install --no-frozen-lockfile
-          pnpm run build:gitee
-
-      # 发布到 gitee
-      - name: Deploy Gitee
-        uses: peaceiris/actions-gh-pages@v3
-        with:
-          deploy_key: ${{secrets.ACTIONS_DEPLOY_KEY}}
-          publish_branch: gh-pages-gitee
-          publish_dir: ./dist-pro
-          force_orphan: true
-
-      - name: Sync Github Repos To Gitee # 名字随便起
-        uses: Yikun/hub-mirror-action@v1.1 # 使用Yikun/hub-mirror-action
-        with:
-          src: github/kailong321200875 # 源端账户名(github)
-          dst: gitee/kailong110120130 # 目的端账户名(gitee)
-          dst_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} # SSH密钥对中的私钥
-          dst_token: ${{ secrets.GITEE_TOKEN }} # Gitee账户的私人令牌
-          account_type: user # 账户类型
-          clone_style: 'https' # 使用https方式进行clone,也可以使用ssh
-          debug: true # 启用后会显示所有执行命令
-          force_update: true # 启用后,强制同步,即强制覆盖目的端仓库
-          static_list: 'vue-element-plus-admin' # 静态同步列表,在此填写需要同步的仓库名称,可填写多个
-          timeout: '600s' # git超时设置,超时后会自动重试git操作

+ 0 - 19
.github/workflows/release.yml

@@ -1,19 +0,0 @@
-on:
-  push:
-    branches:
-      - release
-
-name: Release
-
-jobs:
-  release-please:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: GoogleCloudPlatform/release-please-action@v3
-        id: release
-        with:
-          token: ${{ secrets.TOKEN }}
-          default-branch: release
-          release-type: node
-          package-name: standard-version
-          changelog-types: '[{"type": "types", "section":"Types", "hidden": false},{"type": "revert", "section":"Reverts", "hidden": false},{"type": "feat", "section": "Features", "hidden": false},{"type": "fix", "section": "Bug Fixes", "hidden": false},{"type": "improvement", "section": "Feature Improvements", "hidden": false},{"type": "docs", "section":"Docs", "hidden": false},{"type": "style", "section":"Styling", "hidden": false},{"type": "refactor", "section":"Code Refactoring", "hidden": false},{"type": "perf", "section":"Performance Improvements", "hidden": false},{"type": "test", "section":"Tests", "hidden": false},{"type": "build", "section":"Build System", "hidden": false},{"type": "ci", "section":"CI", "hidden":false}]'

+ 4 - 5
src/api/order/index.ts

@@ -5,19 +5,18 @@ export const getOrderList = (params: searchOrder): Promise<IResponse> => {
   return request.get({ url: `${REQUEST_BASE}/decoration/order`, params })
 }
 export const getOrderDetail = (id: number): Promise<IResponse> => {
-	return request.get({ url: `${REQUEST_BASE}/decoration/order/${id}`})
+  return request.get({ url: `${REQUEST_BASE}/decoration/order/${id}` })
 }
-export const assignSalesman = (id:number,data: any): Promise<IResponse> => {
+export const assignSalesman = (id: number, data: any): Promise<IResponse> => {
   return request.post({ url: `${REQUEST_BASE}/decoration/order/assign/${id}`, data })
 }
-export const assignDesigner = (id:number,data: any): Promise<IResponse> => {
+export const assignDesigner = (id: number, data: any): Promise<IResponse> => {
   return request.post({ url: `${REQUEST_BASE}/decoration/order/designer/${id}`, data })
 }
 export const assignWorker = (params: searchOrder): Promise<IResponse> => {
   return request.post({ url: `${REQUEST_BASE}/decoration/order/`, params })
 }
 export const passAddItem = (id: number): Promise<IResponse> => {
-  return request.post({ url: `${REQUEST_BASE}/decoration/order/pass/${id}`})
+  return request.post({ url: `${REQUEST_BASE}/decoration/order/pass/${id}` })
 }
 //decoration/order/pass/:id
-

+ 111 - 120
src/views/Order/orderList/components/Detail.vue

@@ -2,10 +2,10 @@
 import { PropType, ref } from 'vue'
 import { Descriptions, DescriptionsSchema } from '@/components/Descriptions'
 import { SalespersonButtom } from '@/components/SalespersonList'
-import { DesignerButtom } from '@/components/designerList'
+import { DesignerButtom } from '@/components/DesignerList'
 import { WorkerButtom } from '@/components/WorkerList'
-import  { ElButton,ElMessage} from 'element-plus'
-import { assignSalesman,assignDesigner,assignWorker} from '@/api/order'
+import { ElButton, ElMessage } from 'element-plus'
+import { assignSalesman, assignDesigner, assignWorker } from '@/api/order'
 
 const props = defineProps({
   currentRow: {
@@ -28,105 +28,96 @@ const menu = [
   {
     field: 'address',
     label: '地址',
-	span: 24,
+    span: 24
   },
   {
     field: 'store.name',
     label: '门店',
-	span: 24,
+    span: 24
   },
   {
     field: 'salesperson',
     label: '业务员',
-	span: 24,
-	slots: {
-		default: (data)=> {
-			if(data.salesperson_id) {
-				return (
-					<>{data.salesperson.name}</>
-				)
-			}else if(data.step <= 3){
-				return (
-				  <>
-				    <SalespersonButtom
-				      v-model={data.salesperson_id}
-				      onChange={(res) => {
-				        checkedSalesperson(res)
-				      }}
-				    ></SalespersonButtom>
-					 <ElButton type="primary"  style="margin-left: 10px;" onClick={()=> setSalesperson()}>确定</ElButton>
-				  </>
-				)
-			}else {
-				return (
-				<></>
-				)
-			}
-			
-		}
-	}
+    span: 24,
+    slots: {
+      default: (data) => {
+        if (data.salesperson_id) {
+          return <>{data.salesperson.name}</>
+        } else if (data.step <= 3) {
+          return (
+            <>
+              <SalespersonButtom
+                v-model={data.salesperson_id}
+                onChange={(res) => {
+                  checkedSalesperson(res)
+                }}
+              ></SalespersonButtom>
+              <ElButton type="primary" style="margin-left: 10px;" onClick={() => setSalesperson()}>
+                确定
+              </ElButton>
+            </>
+          )
+        } else {
+          return <></>
+        }
+      }
+    }
   },
   {
     field: 'designer',
     label: '设计师',
-	span: 24,
-	slots: {
-		default: (data)=> {
-			if(data.designer_id > 0) {
-				return (
-					<>{data.designer.name}</>
-				)
-			}else if(data.step == 1){
-				return (
-				  <>
-				    <DesignerButtom
-				      v-model={data.designer_id}
-				      onChange={(res) => {
-				        checkedDesigner(res)
-				      }}
-				    ></DesignerButtom>
-					 <ElButton type="primary"  style="margin-left: 10px;" onClick={()=> setDesigner()}>确定</ElButton>
-				  </>
-				)
-			}else {
-				return (
-				<></>
-				)
-			}
-			
-		}
-	}
+    span: 24,
+    slots: {
+      default: (data) => {
+        if (data.designer_id > 0) {
+          return <>{data.designer.name}</>
+        } else if (data.step == 1) {
+          return (
+            <>
+              <DesignerButtom
+                v-model={data.designer_id}
+                onChange={(res) => {
+                  checkedDesigner(res)
+                }}
+              ></DesignerButtom>
+              <ElButton type="primary" style="margin-left: 10px;" onClick={() => setDesigner()}>
+                确定
+              </ElButton>
+            </>
+          )
+        } else {
+          return <></>
+        }
+      }
+    }
   },
   {
     field: 'worker',
     label: '安装工',
-	span: 24,
-	slots: {
-		default: (data)=> {
-			if(data.worker_id > 0) {
-				return (
-					<>{data.worker.name}</>
-				)
-			}else if(data.step == 3){
-				return (
-				  <>
-				    <WorkerButtom
-				      v-model={data.worker_id}
-				      onChange={(res) => {
-				        checkedWorker(res)
-				      }}
-				    ></WorkerButtom>
-					 <ElButton type="primary"  style="margin-left: 10px;" onClick={()=> setWorker()}>确定</ElButton>
-				  </>
-				)
-			}else {
-				return (
-				<></>
-				)
-			}
-			
-		}
-	}
+    span: 24,
+    slots: {
+      default: (data) => {
+        if (data.worker_id > 0) {
+          return <>{data.worker.name}</>
+        } else if (data.step == 3) {
+          return (
+            <>
+              <WorkerButtom
+                v-model={data.worker_id}
+                onChange={(res) => {
+                  checkedWorker(res)
+                }}
+              ></WorkerButtom>
+              <ElButton type="primary" style="margin-left: 10px;" onClick={() => setWorker()}>
+                确定
+              </ElButton>
+            </>
+          )
+        } else {
+          return <></>
+        }
+      }
+    }
   },
   {
     field: 'price',
@@ -147,53 +138,53 @@ const menu = [
   {
     field: 'mark',
     label: '备注',
-	span: 24,
-  },
+    span: 24
+  }
 ]
-const salesperson = ref({})
-const designer = ref({})
-const worker = ref({})
-const emit = defineEmits(['checkedSalesperson','checkedWorker','checkedDesigner']) // 定义事件
+const salesperson = ref({ id: '' })
+const designer = ref({ id: '' })
+const worker = ref({ id: '' })
+const emit = defineEmits(['checkedSalesperson', 'checkedWorker', 'checkedDesigner']) // 定义事件
 
 const setSalesperson = async () => {
-	console.log(props.currentRow.id)
-	if(!salesperson.value.id) return ElMessage.error('请选择业务员');
-	await assignSalesman(props.currentRow.id,{salesperson_id: salesperson.value.id})
-	ElMessage({
-	  type: 'success',
-	  message: `指派成功`
-	})
-	emit('checkedSalesperson', salesperson)
+  console.log(props.currentRow.id)
+  if (!salesperson.value.id) return ElMessage.error('请选择业务员')
+  await assignSalesman(props.currentRow.id, { salesperson_id: salesperson.value.id })
+  ElMessage({
+    type: 'success',
+    message: `指派成功`
+  })
+  emit('checkedSalesperson', salesperson)
 }
 const setWorker = async () => {
-	if(!worker.value.id) return ElMessage.error('请选择安装工');
-	await assignWorker(props.currentRow.worker_order.id,{designer_id: worker.value.id})
-	ElMessage({
-	  type: 'success',
-	  message: `指派成功`
-	})
-	emit('checkedWorker', worker)
+  if (!worker.value.id) return ElMessage.error('请选择安装工')
+  await assignWorker(props.currentRow.worker_order.id, { designer_id: worker.value.id })
+  ElMessage({
+    type: 'success',
+    message: `指派成功`
+  })
+  emit('checkedWorker', worker)
 }
 const setDesigner = async () => {
-	if(!designer.value.id) return ElMessage.error('请选择设计师');
-	await assignDesigner(props.currentRow.designer_order.id,{designer_id: designer.value.id})
-	ElMessage({
-	  type: 'success',
-	  message: `指派成功`
-	})
-	emit('checkedDesigner', designer)
+  if (!designer.value?.id) return ElMessage.error('请选择设计师')
+  await assignDesigner(props.currentRow.designer_order.id, { designer_id: designer.value.id })
+  ElMessage({
+    type: 'success',
+    message: `指派成功`
+  })
+  emit('checkedDesigner', designer)
 }
 const checkedDesigner = (e) => {
-	console.log(e,'xuanz')
-	designer.value = e
+  console.log(e, 'xuanz')
+  designer.value = e
 }
 const checkedWorker = (e) => {
-	console.log(e,'xuanz')
-	worker.value = e
+  console.log(e, 'xuanz')
+  worker.value = e
 }
 const checkedSalesperson = (e) => {
-	console.log(e,'xuanz')
-	salesperson.value = e
+  console.log(e, 'xuanz')
+  salesperson.value = e
 }
 
 const detailSchema = ref<DescriptionsSchema[]>(menu)

+ 45 - 34
src/views/Order/orderList/components/Draft.vue

@@ -3,7 +3,7 @@ import { PropType, ref } from 'vue'
 import { Descriptions, DescriptionsSchema } from '@/components/Descriptions'
 import { ElImage } from 'element-plus'
 
-const props = defineProps({
+defineProps({
   currentRow: {
     type: Object as PropType<any>,
     default: () => undefined
@@ -27,47 +27,58 @@ const menu = [
   {
     field: 'draft[0].mark',
     label: '备注',
-	span: 24
+    span: 24
   },
   {
     field: 'draft[0].deign_draft_images',
     label: '封面',
-  	span: 24,
-	slots: {
-	  default: (data) => {
-	     if(data.draft.length> 0) {
-			return (
-				<>
-					<ElImage src={data.draft[0].deign_draft_images} preview-src-list={[data.draft[0].deign_draft_images]} style="width: 100px;height: 100px"/>
-				</>
-			)
-		}else {
-			return <></>
-		} 
-	  }
-	}
+    span: 24,
+    slots: {
+      default: (data) => {
+        if (data.draft.length > 0) {
+          return (
+            <>
+              <ElImage
+                src={data.draft[0].deign_draft_images}
+                preview-src-list={[data.draft[0].deign_draft_images]}
+                style="width: 100px;height: 100px"
+              />
+            </>
+          )
+        } else {
+          return <></>
+        }
+      }
+    }
   },
   {
     field: 'draft[0].deign_draft_images_chs',
     label: '详情图',
-  	span: 24,
-  	slots: {
-  	  default: (data) => {
-		 
-  	     if(data.draft.length> 0) {
-  			return (
-  				<>
-				{data.draft[0].deign_draft_images_chs.map((item )=> {
-					return (<><ElImage src={item} preview-src-list={[data.draft[0].deign_draft_images]} style="width: 100px;height: 100px"/></>)
-				})}
-  				</>
-  			)
-  		}else {
-  			return <></>
-  		} 
-  	  }
-  	}
-  },
+    span: 24,
+    slots: {
+      default: (data) => {
+        if (data.draft.length > 0) {
+          return (
+            <>
+              {data.draft[0].deign_draft_images_chs.map((item) => {
+                return (
+                  <>
+                    <ElImage
+                      src={item}
+                      preview-src-list={[data.draft[0].deign_draft_images]}
+                      style="width: 100px;height: 100px"
+                    />
+                  </>
+                )
+              })}
+            </>
+          )
+        } else {
+          return <></>
+        }
+      }
+    }
+  }
 ]
 
 const detailSchema = ref<DescriptionsSchema[]>(menu)

+ 109 - 79
src/views/Order/orderList/components/addItem.vue

@@ -2,8 +2,8 @@
 import { PropType, ref } from 'vue'
 import { Descriptions, DescriptionsSchema } from '@/components/Descriptions'
 // import { Icon } from '@/components/Icon'
-import {ElImage, ElButton, ElMessage, ElMessageBox } from 'element-plus'
-import { passAddItem} from '@/api/order'
+import { ElImage, ElButton, ElMessage, ElMessageBox } from 'element-plus'
+import { passAddItem } from '@/api/order'
 
 const props = defineProps({
   currentRow: {
@@ -11,8 +11,8 @@ const props = defineProps({
     default: () => undefined
   },
   isAuth: {
-	  type: Boolean,
-	  default: false
+    type: Boolean,
+    default: false
   }
 })
 //
@@ -22,10 +22,10 @@ const props = defineProps({
 // }
 
 const menu = [
-	{
-	  field: 'id',
-	  label: '编号'
-	},
+  {
+    field: 'id',
+    label: '编号'
+  },
   {
     field: 'add_time',
     label: '创建时间'
@@ -37,93 +37,118 @@ const menu = [
   {
     field: 'status_chs',
     label: '审核状态',
-	slots: {
-		default: (data) => {
-			if(props.isAuth && data.status == 0) {
-				return (
-					<><ElButton type="primary" link size="small" onClick={()=> goPassAddItem(data)}>通过</ElButton><ElButton type="primary" link size="small">拒绝</ElButton></>
-				)
-			}else {
-				return (
-					<>{data.status_chs}</>
-				)
-			}
-		}
-	}
+    slots: {
+      default: (data) => {
+        if (props.isAuth && data.status == 0) {
+          return (
+            <>
+              <ElButton type="primary" link size="small" onClick={() => goPassAddItem(data)}>
+                通过
+              </ElButton>
+              <ElButton type="primary" link size="small">
+                拒绝
+              </ElButton>
+            </>
+          )
+        } else {
+          return <>{data.status_chs}</>
+        }
+      }
+    }
   },
   {
     field: 'cart_infos',
     label: '商品',
-  	span: 24,
-  	slots: {
-  	  default: (data) => {
-  		 const arr = data.cart_infos;
-  	     return (
-  	     	<>
-  	     	{arr.map((item )=> {
-  	     		return (
-  				<>
-  					<div>{'产品:'}<ElButton type="primary" link size="small">{item.productInfo.name}</ElButton>{' 数量:'}<ElButton type="primary" link size="small">{item.num}</ElButton>{' 规格:'}<ElButton type="primary" link size="small">{item.attrInfo.suk}</ElButton></div>
-  				</>
-  				)
-  	     	})}
-  	     	</>
-  	     )
-  	  }
-  	}
+    span: 24,
+    slots: {
+      default: (data) => {
+        const arr = data.cart_infos
+        return (
+          <>
+            {arr.map((item) => {
+              return (
+                <>
+                  <div>
+                    {'产品:'}
+                    <ElButton type="primary" link size="small">
+                      {item.productInfo.name}
+                    </ElButton>
+                    {' 数量:'}
+                    <ElButton type="primary" link size="small">
+                      {item.num}
+                    </ElButton>
+                    {' 规格:'}
+                    <ElButton type="primary" link size="small">
+                      {item.attrInfo.suk}
+                    </ElButton>
+                  </div>
+                </>
+              )
+            })}
+          </>
+        )
+      }
+    }
   },
   {
     field: 'certificate_images',
     label: '封面',
-  	span: 24,
-  	slots: {
-  	  default: (data) => {
-  	    return (
-  	    	<>
-  	    		<ElImage src={data.certificate_images} preview-src-list={[data.certificate_images]} style="width: 100px;height: 100px"/>
-  	    	</>
-  	    )
-  	  }
-  	}
+    span: 24,
+    slots: {
+      default: (data) => {
+        return (
+          <>
+            <ElImage
+              src={data.certificate_images}
+              preview-src-list={[data.certificate_images]}
+              style="width: 100px;height: 100px"
+            />
+          </>
+        )
+      }
+    }
   },
   {
     field: 'certificate_images_chs',
     label: '详情图',
-  	span: 24,
-  	slots: {
-  	  default: (data) => {
-  		 
-  	     return (
-  	     	<>
-  	     	{data.certificate_images_chs.map((item )=> {
-  	     		return (<><ElImage src={item} preview-src-list={data.certificate_images_chs} style="width: 100px;height: 100px"/></>)
-  	     	})}
-  	     	</>
-  	     )
-  	  }
-  	}
-  },
+    span: 24,
+    slots: {
+      default: (data) => {
+        return (
+          <>
+            {data.certificate_images_chs.map((item) => {
+              return (
+                <>
+                  <ElImage
+                    src={item}
+                    preview-src-list={data.certificate_images_chs}
+                    style="width: 100px;height: 100px"
+                  />
+                </>
+              )
+            })}
+          </>
+        )
+      }
+    }
+  }
 ]
 const emit = defineEmits(['passAddItem']) // 定义事件
 const detailSchema = ref<DescriptionsSchema[]>(menu)
 const goPassAddItem = async (e) => {
-	await passAddItem(e.id)
-	ElMessage({
-	  type: 'success',
-	  message: `审核完成`
-	})
-	emit('passAddItem')
+  await passAddItem(e.id)
+  ElMessage({
+    type: 'success',
+    message: `审核完成`
+  })
+  emit('passAddItem')
 }
 const open = () => {
-  ElMessageBox.confirm(
-    '您确定拒绝当前增项?',
-    'Warning',
-    {
-      confirmButtonText: '确认',
-      cancelButtonText: '取消',
-      type: 'warning',
-    }
-  )
+  ElMessageBox.confirm('您确定拒绝当前增项?', 'Warning', {
+    confirmButtonText: '确认',
+    cancelButtonText: '取消',
+    type: 'warning'
+  })
     .then(() => {
       // ElMessage({
       //   type: 'success',
@@ -133,12 +158,17 @@ const open = () => {
     .catch(() => {
       ElMessage({
         type: 'info',
-        message: 'Delete canceled',
+        message: 'Delete canceled'
       })
     })
 }
 </script>
 
 <template>
-  <Descriptions v-for="item in currentRow.add_item" :schema="detailSchema" :data="item || {}" />
+  <Descriptions
+    :key="index"
+    v-for="(item, index) in currentRow.add_item"
+    :schema="detailSchema"
+    :data="item || {}"
+  />
 </template>