From 3a154bdb0a5aaa2c0ac3eac95a6ba747068bd454 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 13 一月 2026 10:00:37 +0800
Subject: [PATCH] 优化

---
 admin/src/components/business/OperaJkSketchWindow.vue |  140 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 140 insertions(+), 0 deletions(-)

diff --git a/admin/src/components/business/OperaJkSketchWindow.vue b/admin/src/components/business/OperaJkSketchWindow.vue
new file mode 100644
index 0000000..830a411
--- /dev/null
+++ b/admin/src/components/business/OperaJkSketchWindow.vue
@@ -0,0 +1,140 @@
+<template>
+  <GlobalWindow
+    :title="title"
+    width="70%"
+    :visible.sync="visible"
+    :confirm-working="isWorking"
+    @confirm="confirm"
+  >
+    <p class="tip-warn"><i class="el-icon-warning"></i>浼樺寲璇存槑锛�<br>
+      1銆佸綋鍓嶄紭鍖栦换鍔℃渶澶氭敮鎸�<span class="orange">銆� {{lineNum}} 銆�</span>鏉$嚎璺�;<br>
+      2銆佸悎鐞嗛�夋嫨绾胯矾锛岄�夋嫨绾胯矾鐨勬�诲鎴锋暟鍜屾�婚�佽揣閲忛渶瑕佹弧瓒冲綋鏃ヨ鍗曠疮璁″��;<br>
+      3銆佸己鍒朵紭鍖栬〃绀哄拷鐣ヨ涓荤嚎浼樺寲涓殑浠诲姟锛岄噸鏂板紑鍚紭鍖栦换鍔★紙涓嶅缓璁級;<br>
+    </p>
+<!--    <el-form :model="form" ref="form" :rules="rules">
+      <el-form-item label="鐢熸垚绾胯矾鏁伴噺" prop="planLineNum">
+        <el-input type="number" disabled  v-model="form.planLineNum" placeholder="璇疯緭鍏ョ嚎璺暟" v-trim/>
+      </el-form-item>
+    </el-form>-->
+    <div>
+      <el-form :model="form" ref="form" :rules="rules">
+        <el-form-item label="鏄惁寮哄埗浼樺寲" prop="forceUpdate">
+          <el-radio-group v-model="form.forceUpdate">
+            <el-radio :label="0" :value="0">涓嶅己鍒�</el-radio>
+            <el-radio :label="1" :value="1">寮哄埗</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="閫夋嫨鐢熸垚绾胯矾" prop="lineIdList" >
+          <el-table  :data="lineList" stripe    @selection-change="handleSelectionChange">
+            <el-table-column type="selection" width="55"></el-table-column>
+            <el-table-column prop="name" label="閫佽揣绾胯矾" min-width="130px" show-tooltip-when-overflow>  </el-table-column>
+            <el-table-column prop="maxCustomer" label="瀹㈡埛鏁�(鎴�)" min-width="100px"  show-tooltip-when-overflow></el-table-column>
+            <el-table-column prop="maxOrder" label="閫佽揣閲�(鏉�)" min-width="100px"  show-tooltip-when-overflow></el-table-column>
+            <el-table-column prop="carCode" label="杞︾墝鍙�" min-width="100px"></el-table-column>
+            <el-table-column prop="memberName" label="閫佽揣鍙告満" min-width="100px"></el-table-column>
+          </el-table>
+        </el-form-item>
+      </el-form>
+    </div>
+  </GlobalWindow>
+</template>
+
+<script>
+import BaseOpera from '@/components/base/BaseOpera'
+import GlobalWindow from '@/components/common/GlobalWindow'
+import { allList } from '@/api/business/jkLine'
+export default {
+  name: 'OperaJkSketchWindow',
+  extends: BaseOpera,
+  components: { GlobalWindow },
+  data () {
+    return {
+      // 琛ㄥ崟鏁版嵁
+      form: {
+        id: null,
+        planLineNum: '',
+        forceUpdate: 0,
+        lineIdList: []
+      },
+      categoryId: null,
+      lineList: [],
+      lineNum: null,
+      // 楠岃瘉瑙勫垯
+      rules: {
+        lineIdList: [{ required: true, message: '璇烽�夋嫨鐢熸垚绾胯矾鏁伴噺' }],
+        forceUpdate: [{ required: true, message: '璇烽�夋嫨鏄惁寮哄埗浼樺寲' }]
+      }
+    }
+  },
+  created () {
+    this.config({
+      api: '/business/jkSketch',
+      'field.id': 'id'
+    })
+  },
+  methods: {
+    handleSelectionChange (rows) {
+      this.form.lineIdList = []
+      if (rows || rows.length) {
+        rows.forEach(item => {
+          this.form.lineIdList.push(item.id)
+        })
+      }
+    },
+    open (title, target) {
+      if (!target || !target.id) {
+        return
+      }
+      this.lineList = []
+      this.title = title
+      this.visible = true
+      this.categoryId = target.categoryId
+      this.form.id = target.id
+      this.form.planLineNum = target.planLineNum
+      this.form.forceUpdate = 0
+      this.form.lineIdList = []
+      this.loadLines()
+    },
+    confirm () {
+      this.$refs.form.validate((valid) => {
+        if (!valid) {
+          return
+        }
+      /*  if (this.form.planLineNum <= 0 || this.form.planLineNum > this.lineNum) {
+          this.$message.error('浼樺寲绾胯矾鏁板繀椤诲湪[1-' + this.lineNum + ']鑼冨洿鍐咃紒')
+          return
+        }*/
+        this.confirmDo()
+      })
+    },
+    confirmDo () {
+      // 璋冪敤鏂板缓鎺ュ彛
+      this.isWorking = true
+      this.api.updateById({
+        id: this.form.id,
+        lineIdList: this.form.lineIdList,
+        forceUpdate: this.form.forceUpdate
+      })
+        .then(() => {
+          this.visible = false
+          this.$tip.apiSuccess('浼樺寲浠诲姟姝e湪鍚庡彴鎵ц锛岃绛夊緟浼樺寲瀹屾垚鍚庢煡鐪嬩紭鍖栫粨鏋滐紒')
+          this.$emit('success')
+        })
+        .catch(e => {
+          // this.$tip.apiFailed(e)
+        })
+        .finally(() => {
+          this.isWorking = false
+        })
+    },
+    loadLines () {
+      allList({
+        categoryId: this.categoryId
+      }).then(res => {
+        this.lineList = res || []
+        this.lineNum = this.lineList.length
+      })
+    }
+  }
+}
+</script>

--
Gitblit v1.9.3