From 8c51a45d5a220f5ddb4b29a50b3bd732e5ac8521 Mon Sep 17 00:00:00 2001
From: gaoaoy <1042166043@qq.com>
Date: 星期五, 15 三月 2024 18:04:59 +0800
Subject: [PATCH] 检验下单 功能调整

---
 src/components/view/b1-inspection-order.vue |  288 +++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 176 insertions(+), 112 deletions(-)

diff --git a/src/components/view/b1-inspection-order.vue b/src/components/view/b1-inspection-order.vue
index ddf6a65..b180ebf 100644
--- a/src/components/view/b1-inspection-order.vue
+++ b/src/components/view/b1-inspection-order.vue
@@ -69,117 +69,126 @@
 </style>
 
 <template>
-	<div class="role_manage">
-		<div>
-			<el-row class="title">
-				<el-col :span="12" style="padding-left: 20px;">妫�楠屼笅鍗�</el-col>
-				<el-col :span="12" style="text-align: right;">
-					<el-button size="medium" type="primary" @click="playOrder">涓嬪崟</el-button>
-				</el-col>
-			</el-row>
+	<div class="inspection_order">
+		<div style="width: 100%;height: 100%;" v-if="active == 0">
+			<div>
+				<el-row class="title">
+					<el-col :span="12" style="padding-left: 20px;">妫�楠屼笅鍗�</el-col>
+					<el-col :span="12" style="text-align: right;">
+						<el-button size="medium" type="primary" @click="playOrder(1)">涓嬪崟</el-button>
+					</el-col>
+				</el-row>
+			</div>
+			<div class="search">
+				<div class="search_thing">
+					<div class="search_label">濮旀墭缂栧彿锛�</div>
+					<div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
+							v-model="componentData.entity.deviceName" @keyup.enter.native="refreshTable()"></el-input></div>
+				</div>
+				<div class="search_thing">
+					<div class="search_label">鏍峰搧鍚嶇О锛�</div>
+					<div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
+							v-model="componentData.entity.specificationModel" @keyup.enter.native="refreshTable()"></el-input></div>
+				</div>
+				<div class="search_thing" style="padding-left: 30px;">
+					<el-button size="small" @click="refresh()">閲� 缃�</el-button>
+					<el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
+				</div>
+			</div>
+			<div class="table">
+				<ul class="tab">
+					<li v-for="(m,i) in tabList" :key="i" :class="{active:i==tabIndex}" @click="handleTab(m,i)">{{m.label}}</li>
+				</ul>
+				<!-- 璇硶 瀛愮粍浠堕�氳繃 this.$emit +浼犲叆鏂规硶鍚� 璋冪敤鐖剁粍浠舵柟娉� 渚嬪  this.$emit锛坰electAllByOne锛� 灏遍渶鍦ㄧ埗缁勪欢澹版槑骞朵紶鍏�  @selectAllByOne="selectAllByOne"-->
+				<ValueTable ref="ValueTable" :url="$api.insOrder.selectInsOrderParameter" :componentData="componentData"
+					:key="upIndex" style="height: calc(100% - 44px)" @selectAllByOne="selectAllByOne"
+					@handleDataLook="handleDataLook" @download="download" @handleVerify="handleVerify" @handlEquash="handlEquash"
+					@handleIssued="handleIssued" />
+			</div>
+			<!-- 瀹℃牳 -->
+			<el-dialog title="涓嬪崟瀹℃牳" :visible.sync="verifyDialogVisible" width="30%" :before-close="handleClose">
+				<p style="font-size:16px;color:#333333" v-if="!isPass">濮旀墭缂栧彿<span
+						style="color:#34BD66">ZTMS2023071001</span>鐨勪俊鎭槸鍚﹂�氳繃</p>
+				<el-form :label-position="labelPosition" :model="formData" label-width="150px" ref="ruleForm" v-else>
+					<el-form-item label="璇疯緭鍏ユ牱鍝佸簱浣嶅彿锛�">
+						<el-input v-model="formData.specificationModel" size="small" style="width:60%"></el-input>
+					</el-form-item>
+				</el-form>
+				<span slot="footer" class="dialog-footer">
+					<el-row v-if="!isPass">
+						<el-button @click="handleClose">閫� 鍥�</el-button>
+						<el-button type="primary" @click="submitForm" :loading="upLoad">閫� 杩�</el-button>
+					</el-row>
+					<el-row v-else>
+						<el-button @click="handleClose">杩� 鍥�</el-button>
+						<el-button type="primary" @click="submitForm" :loading="upLoad">纭� 瀹�</el-button>
+					</el-row>
+				</span>
+			</el-dialog>
+			<!-- 鎾ら攢 -->
+			<el-dialog title="涓嬪崟鎾ら攢" :visible.sync="quashDialogVisible" width="30%" :before-close="handleClose">
+				<p style="font-size:16px;color:#333333" v-if="!isQuash">濮旀墭缂栧彿<span
+						style="color:#34BD66">ZTMS2023071001</span>鐨勪俊鎭槸鍚︽挙閿�</p>
+				<el-form :label-position="labelPosition" :model="formData" label-width="150px" ref="ruleForm" v-else>
+					<el-form-item label="璇疯緭鍏ユ挙閿�鍘熷洜锛�">
+						<el-input v-model="formData.specificationModel" size="small" style="width:60%"></el-input>
+					</el-form-item>
+				</el-form>
+				<span slot="footer" class="dialog-footer">
+					<el-row v-if="!isQuash">
+						<el-button @click="handleClose">鍙� 娑�</el-button>
+						<el-button type="primary" @click="submitForm" :loading="upLoad">纭� 瀹�</el-button>
+					</el-row>
+					<el-row v-else>
+						<el-button @click="handleClose">杩� 鍥�</el-button>
+						<el-button type="primary" @click="submitForm" :loading="upLoad">纭� 瀹�</el-button>
+					</el-row>
+				</span>
+			</el-dialog>
+			<!-- 涓嬪彂 -->
+			<el-dialog title="妫�楠屼笅鍙�" :visible.sync="issuedDialogVisible" width="30%" :before-close="handleClose">
+				<el-form :label-position="labelPosition" :model="formData2" label-width="150px" ref="ruleForm">
+					<el-form-item label="绾﹀畾鏃堕棿锛�">
+						<el-date-picker style="width:100%" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="formData2.appointed2"
+							type="date" size="small" placeholder="閫夋嫨鏃堕棿">
+						</el-date-picker>
+					</el-form-item>
+					<el-form-item >
+					</el-form-item>
+					<el-form-item label="鎸囨淳浜哄憳锛�">
+						<el-select v-model="formData2.id" placeholder="璇烽�夋嫨" size="small" style="width:100%">
+							<el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value">
+							</el-option>
+						</el-select>
+					</el-form-item>
+				</el-form>
+				<span slot="footer" class="dialog-footer">
+					<el-row>
+						<el-button @click="handleClose2">鍙� 娑�</el-button>
+						<el-button type="primary" @click="submitForm2" :loading="upLoad">纭� 瀹�</el-button>
+					</el-row>
+				</span>
+			</el-dialog>
+			<el-dialog title="鏁版嵁鏌ョ湅" :visible.sync="dataDialogVisible" width="70%" :before-close="handleClose2">
+				<div style="height: 70vh;overflow-y: auto;">
+					<ValueTable ref="ValueTableDataLook" :url="$api.deviceScope.selectDeviceParameter"
+						:componentData="componentDataDataLook" :key="upIndex" />
+				</div>
+			</el-dialog>
 		</div>
-		<div class="search">
-			<div class="search_thing">
-				<div class="search_label">濮旀墭缂栧彿锛�</div>
-				<div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
-						v-model="componentData.entity.deviceName" @keyup.enter.native="refreshTable()"></el-input></div>
-			</div>
-			<div class="search_thing">
-				<div class="search_label">鏍峰搧鍚嶇О锛�</div>
-				<div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
-						v-model="componentData.entity.specificationModel" @keyup.enter.native="refreshTable()"></el-input></div>
-			</div>
-			<div class="search_thing" style="padding-left: 30px;">
-				<el-button size="small" @click="refresh()">閲� 缃�</el-button>
-				<el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
-			</div>
+		<div style="width: 100%;height: 100%;" v-if="active == 1">
+			<Add/>
 		</div>
-		<div class="table">
-			<ul class="tab">
-				<li v-for="(m,i) in tabList" :key="i" :class="{active:i==tabIndex}" @click="handleTab(m,i)">{{m.label}}</li>
-			</ul>
-			<!-- 璇硶 瀛愮粍浠堕�氳繃 this.$emit +浼犲叆鏂规硶鍚� 璋冪敤鐖剁粍浠舵柟娉� 渚嬪  this.$emit锛坰electAllByOne锛� 灏遍渶鍦ㄧ埗缁勪欢澹版槑骞朵紶鍏�  @selectAllByOne="selectAllByOne"-->
-			<ValueTable ref="ValueTable" :url="$api.insOrder.selectInsOrderParameter" :componentData="componentData"
-				:key="upIndex" style="height: calc(100% - 44px)" @selectAllByOne="selectAllByOne"
-				@handleDataLook="handleDataLook" @download="download" @handleVerify="handleVerify" @handlEquash="handlEquash"
-				@handleIssued="handleIssued" />
-		</div>
-		<!-- 瀹℃牳 -->
-		<el-dialog title="涓嬪崟瀹℃牳" :visible.sync="verifyDialogVisible" width="30%" :before-close="handleClose">
-			<p style="font-size:16px;color:#333333" v-if="!isPass">濮旀墭缂栧彿<span
-					style="color:#34BD66">ZTMS2023071001</span>鐨勪俊鎭槸鍚﹂�氳繃</p>
-			<el-form :label-position="labelPosition" :model="formData" label-width="150px" ref="ruleForm" v-else>
-				<el-form-item label="璇疯緭鍏ユ牱鍝佸簱浣嶅彿锛�">
-					<el-input v-model="formData.specificationModel" size="small" style="width:60%"></el-input>
-				</el-form-item>
-			</el-form>
-			<span slot="footer" class="dialog-footer">
-				<el-row v-if="!isPass">
-					<el-button @click="handleClose">閫� 鍥�</el-button>
-					<el-button type="primary" @click="submitForm" :loading="upLoad">閫� 杩�</el-button>
-				</el-row>
-				<el-row v-else>
-					<el-button @click="handleClose">杩� 鍥�</el-button>
-					<el-button type="primary" @click="submitForm" :loading="upLoad">纭� 瀹�</el-button>
-				</el-row>
-			</span>
-		</el-dialog>
-		<!-- 鎾ら攢 -->
-		<el-dialog title="涓嬪崟鎾ら攢" :visible.sync="quashDialogVisible" width="30%" :before-close="handleClose">
-			<p style="font-size:16px;color:#333333" v-if="!isQuash">濮旀墭缂栧彿<span
-					style="color:#34BD66">ZTMS2023071001</span>鐨勪俊鎭槸鍚︽挙閿�</p>
-			<el-form :label-position="labelPosition" :model="formData" label-width="150px" ref="ruleForm" v-else>
-				<el-form-item label="璇疯緭鍏ユ挙閿�鍘熷洜锛�">
-					<el-input v-model="formData.specificationModel" size="small" style="width:60%"></el-input>
-				</el-form-item>
-			</el-form>
-			<span slot="footer" class="dialog-footer">
-				<el-row v-if="!isQuash">
-					<el-button @click="handleClose">鍙� 娑�</el-button>
-					<el-button type="primary" @click="submitForm" :loading="upLoad">纭� 瀹�</el-button>
-				</el-row>
-				<el-row v-else>
-					<el-button @click="handleClose">杩� 鍥�</el-button>
-					<el-button type="primary" @click="submitForm" :loading="upLoad">纭� 瀹�</el-button>
-				</el-row>
-			</span>
-		</el-dialog>
-		<!-- 涓嬪彂 -->
-		<el-dialog title="妫�楠屼笅鍙�" :visible.sync="issuedDialogVisible" width="30%" :before-close="handleClose">
-			<el-form :label-position="labelPosition" :model="formData" label-width="150px" ref="ruleForm">
-				<el-form-item label="绾﹀畾鏃堕棿锛�">
-					<el-date-picker style="width:100%" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="formData.downTime"
-						type="date" size="small" placeholder="閫夋嫨鏃堕棿">
-					</el-date-picker>
-				</el-form-item>
-				<el-form-item label="鎸囨淳浜哄憳锛�">
-					<el-select v-model="formData.equipmentManager" placeholder="璇烽�夋嫨" size="small" style="width:100%">
-						<el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value">
-						</el-option>
-					</el-select>
-				</el-form-item>
-			</el-form>
-			<span slot="footer" class="dialog-footer">
-				<el-row>
-					<el-button @click="handleClose">鍙� 娑�</el-button>
-					<el-button type="primary" @click="submitForm" :loading="upLoad">纭� 瀹�</el-button>
-				</el-row>
-			</span>
-		</el-dialog>
-		<el-dialog title="鏁版嵁鏌ョ湅" :visible.sync="dataDialogVisible" width="70%" :before-close="handleClose">
-			<div style="height: 70vh;overflow-y: auto;">
-				<ValueTable ref="ValueTableDataLook" :url="$api.deviceScope.selectDeviceParameter"
-					:componentData="componentDataDataLook" :key="upIndex" />
-			</div>
-		</el-dialog>
 	</div>
 </template>
 
 <script>
 	import ValueTable from '../tool/value-table.vue'
+	import Add from '../do/b1-ins-order/add.vue'
 	export default {
 		components: {
-			ValueTable
+			ValueTable,
+			Add
 		},
 		data() {
 			return {
@@ -190,13 +199,22 @@
 				verifyDialogVisible: false,
 				quashDialogVisible: false,
 				issuedDialogVisible: false,
+				issuedDialogVisible2: false,
 				dataDialogVisible: false,
 				formData: {},
+				formData0:{},
+				formData1:{},
+				formData2:{
+					id:'',
+					orderName:'',
+					data:'',
+				},
 				// 浜哄憳鍒楄〃
 				personList: [],
 				labelPosition: 'right',
 				componentData: {
 					entity: {
+						state: 1,
 						orderBy: {
 							field: 'id',
 							order: 'asc'
@@ -232,21 +250,21 @@
 						method: 'handleIssued'
 					}],
 					tagField: {
-						deviceStatus: {
+						type: {
 							select: [{
 								value: 0,
 								type: 'success',
-								label: '姝e父'
+								label: '鏅��'
 							}, {
 								value: 1,
 								type: 'warning',
-								label: '鎶ュ簾'
+								label: '浼樺厛'
 							}, {
 								value: 2,
 								type: 'danger',
-								label: '淇濅慨'
+								label: '绱ф��'
 							}]
-						}
+						},
 					},
 					linkEvent:{
 					  deviceName:{
@@ -296,11 +314,11 @@
 				upLoad: false,
 				tabList: [{
 						label: '妫�楠屽鐞�',
-						value: 0
+						value: 1
 					},
 					{
 						label: '寰呭鏍�',
-						value: 1
+						value: 0
 					},
 					{
 						label: '閫�鍥�',
@@ -312,13 +330,27 @@
 					},
 				],
 				tabIndex: 0,
+				active: 0
 			}
 		},
 		mounted() {
 			this.entityCopy = this.HaveJson(this.componentData.entity)
 			this.getPower()
+			this.getAuthorizedPerson()
 		},
 		methods: {
+			getAuthorizedPerson(){
+        	this.$axios.post(this.$api.deviceScope.selectDevicePrincipal).then(res => {
+					let data = []
+					res.data.forEach(a=>{
+						data.push({
+							label: a.name,
+							value: a.id
+						})
+					})
+					this.personList = data
+				})
+      },
 			refreshTable() {
 				this.$refs['ValueTable'].selectList()
 			},
@@ -358,6 +390,13 @@
 				this.dataDialogVisible = false;
 				this.upLoad = false;
 			},
+			handleClose2() {
+				this.verifyDialogVisible = false;
+				this.quashDialogVisible = false;
+				this.issuedDialogVisible = false;
+				this.dataDialogVisible = false;
+				this.upLoad = false;
+			},
 			// 璇︽儏
 			selectAllByOne(row) {
 				//鎵撳紑寮规
@@ -386,6 +425,27 @@
 			handleIssued(row) {
 				this.issuedDialogVisible = true;
 			},
+			submitForm2(){
+				this.upLoad = true;
+				this.$axios.post(this.$api.insOrder.getDeviceManager, this.formData2, {
+					headers: {
+						'Content-Type': 'application/json'
+					}
+				}).then(res => {
+					if (res.code === 201) {
+						this.upLoad = false
+						return
+					}
+					this.$message.success('淇敼鎴愬姛')
+					this.upLoad = false
+					this.refreshTable()
+					this.dialogVisible = false
+				}).catch(e => {
+					this.$message.error('淇敼澶辫触')
+					this.dialogVisible = false
+					this.upLoad = false
+				})
+			},
 			submitForm() {
 				this.upLoad = true;
 				let authorizedPerson = this.formData.authorizedPerson.length > 0 ? this.formData.authorizedPerson.join(',') : ''
@@ -394,7 +454,7 @@
 				delete this.formData.createUser
 				delete this.formData.updateUser
 				this.formData.authorizedPerson = authorizedPerson
-				this.$axios.post(this.$api.deviceScope.upDeviceParameter, this.formData, {
+				this.$axios.post(this.$api.insOrder.getDeviceManager, this.formData, {
 					headers: {
 						'Content-Type': 'application/json'
 					}
@@ -414,10 +474,14 @@
 				})
 			},
 			// 涓嬪崟
-			playOrder() {},
+			playOrder(num) {
+				this.active = num
+			},
 			handleTab(m, i) {
 				this.tabIndex = i;
+				this.componentData.entity.state = m.value
+				this.refreshTable()
 			}
 		}
 	}
-</script>
\ No newline at end of file
+</script>

--
Gitblit v1.9.3