Browse Source

Merge branch 'master' of http://120.46.159.163:7400/ezhizao/ezhizao_dms_vue

ezhizao\ezhizao_zx 1 year ago
parent
commit
ff8f5bdb20

+ 5 - 4
src/views/business/outsource/form.vue

@@ -23,7 +23,7 @@
         </el-button> -->
 
         <el-button
-          v-if="editStatus && form.isSubmit==1"
+          v-show="editStatus && form.isSubmit==1"
           type="primary"
           icon="Download"
           @click="handleExport"
@@ -31,7 +31,7 @@
           >导出</el-button
         >
         <el-button
-          v-if="!editStatus"
+          v-show="editStatus && form.isSubmit==1"
           type="warning"
           icon="Download"
           @click="handlePrint"
@@ -211,7 +211,7 @@
       <!-- 渲染数据区 -->
       <div class="form-details-btns-container">
         <el-button
-          v-if="editStatus"
+          v-show="editStatus"
           type="primary"
           icon="Plus"
           @click="handleShowDialogProducts"
@@ -582,7 +582,7 @@ function selectText(value, data) {
 /** 取消按钮 */
 function cancel() {
   visible.value = false;
-  reset();
+  // reset();
 }
 
 const handleDelete = (index) => {
@@ -597,6 +597,7 @@ const handleDelete = (index) => {
 
 /** 表单重置 */
 function reset() {
+  // console.log(proxy.parseTime(new Date(), "{y}-{m}-{d}"))
   form.value = {
     id: null,
     tenantId: null,

+ 37 - 20
src/views/business/productionBatch/computedMaterialForm.vue

@@ -23,14 +23,13 @@
               prop="materialpickUpQuantity"
               label-width="100px"
             >
-              <el-input-number
-                v-model="form.materialpickUpQuantity"
-                :min="0"
-                :precision="2"
-                controls-position="right"
-                style="width: 200px; margin-left: 30px"
-                @input="handleInputMaterialpickUpQuantity"
-              />
+            <el-input
+              v-model="form.materialpickUpQuantity"
+              placeholder="0"
+              type="text"
+              style="width: 200px; margin-left: 30px"
+              @input="handleInputMaterialpickUpQuantity"
+            />
             </el-form-item>
           </el-col>
         </el-row>
@@ -41,6 +40,7 @@
               v-model="form.peqty"
               prop="peqty"
               label-width="100px"
+              
               style="margin-top: 30px"
             >
               <span style="margin-left: 40px">{{ form.peqty }}</span>
@@ -62,8 +62,8 @@
         </el-row>
       </el-form>
       <div class="bottom-buttons">
-        <el-button size="large" style="width: 200px;height: 50px;" type="info"  @click="cancel">取 消</el-button>
-      <el-button size="large" style="width: 200px;height: 50px;" type="primary"  @click="handleInputLotNumber"
+        <el-button size="large" style="width: 160px;height: 50px;" type="info"  @click="cancel">取 消</el-button>
+      <el-button size="large" style="width: 160px;height: 50px;" type="primary"  @click="handleInputLotNumber"
         >填入</el-button
       >
     </div>
@@ -93,13 +93,15 @@ const detailInfo = ref({})
 function open(data) {
   reset();
   detailInfo.value = proxy.deepClone(data);
-  getProductionLotAmount({lotno:detailInfo.value.productionPlanNo,lotseq:detailInfo.value.lineNumber}).then(res =>{
-    if(res.code == 200) {
-      form.value.peqty = res.data[0].peqty
-       visible.value = true;
-    }
-  }
-)
+  form.value.peqty = 22.8
+  visible.value =true
+//   getProductionLotAmount({lotno:detailInfo.value.productionPlanNo,lotseq:detailInfo.value.lineNumber}).then(res =>{
+//     if(res.code == 200) {
+//       form.value.peqty = res.data[0].peqty
+//        visible.value = true;
+//     }
+//   }
+// )
  
 }
 
@@ -113,14 +115,29 @@ function cancel() {
 function reset() {
   form.value = {
     lotNumber: 0,
-    materialpickUpQuantity:0
+    materialpickUpQuantity:''
   };
   proxy.resetForm("formRef");
 }
 //填写领料量
 function handleInputMaterialpickUpQuantity(data) {
-   form.value.lotNumber = Math.ceil(data / form.value.peqty);
-}
+  // if (data < 0) {
+  //       form.value.materialpickUpQuantity = 0;
+  //     }else{
+  //  form.value.lotNumber = Math.ceil(data / form.value.peqty);
+  //     }
+  const regex =/^(?!0+(?:\.0+)?$)[1-9]\d*(\.\d*)?$/;
+      // 检查输入值是否符合正则表达式规则
+      if (!regex.test(data)) {
+        // 如果不符合规则,清空输入或设置为0
+        form.value.materialpickUpQuantity = '';
+      } else {
+        // 如果符合规则,更新模型
+        form.value.materialpickUpQuantity = data;
+        form.value.lotNumber = Math.ceil(data / form.value.peqty);
+      }
+      
+    };
 
 // 投产批数带回
 function handleInputLotNumber(){

+ 2 - 1
src/views/business/productionBatch/form.vue

@@ -29,7 +29,8 @@
                 @input="handleUpdateLotNumber"
                 :min="0"
               />
-              <el-button style="margin-left: 10px;" type="primary" @click="handleComputedMaterial"
+              <el-button v-hasPermi="['business:productionBatch:outsourcedAdd']"
+               style="margin-left: 10px;" type="primary" @click="handleComputedMaterial"
         >外协投料计算</el-button>
             </el-form-item>
             <el-form-item label="下达日期" prop="issuanceDate">

+ 53 - 148
src/views/business/supplier/index.vue

@@ -5,24 +5,16 @@
 			<el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
 				<el-form-item class="section-title" label="外协商管理" />
 				<el-form-item label="外协商名称:">
-					<el-input
-						placeholder="请输入关键字"
-						v-model.trim="queryParams.name"
-						style="width: 120px"
-						clearable
-						@keyup.enter="handleQuery"
-						@keydown.enter.prevent
-					/>
+					<el-input placeholder="请输入关键字" v-model.trim="queryParams.name" style="width: 120px" clearable
+						@keyup.enter="handleQuery" @keydown.enter.prevent />
 				</el-form-item>
 				<el-form-item label="助记码:">
-					<el-input
-						placeholder="请输入关键字"
-						v-model.trim="queryParams.mnemonicCode"
-						style="width: 120px"
-						clearable
-						@keyup.enter="handleQuery"
-						@keydown.enter.prevent
-					/>
+					<el-input placeholder="请输入助记码" v-model.trim="queryParams.mnemonicCode" style="width: 120px" clearable
+						@keyup.enter="handleQuery" @keydown.enter.prevent />
+				</el-form-item>
+				<el-form-item label="外协厂编码:">
+					<el-input placeholder="请输入外协厂编码" v-model.trim="queryParams.code" style="width: 120px" clearable
+						@keyup.enter="handleQuery" @keydown.enter.prevent />
 				</el-form-item>
 				<el-form-item>
 					<el-button type="info" icon="Search" @click="handleQuery">搜索</el-button>
@@ -32,18 +24,11 @@
 			<!-- 列表区 -->
 			<div class="el-table-container">
 				<div class="el-table-inner-container">
-					<el-table
-						ref="supplierTable"
-						v-loading="loading"
-						border
-						:data="supplierList"
-						highlight-current-row
-						height="100%"
-						@current-change="handleCurrentSupplierChange"
-					>
+					<el-table ref="supplierTable" v-loading="loading" border :data="supplierList" highlight-current-row
+						height="100%" @current-change="handleCurrentSupplierChange">
 						<el-table-column type="index" label="行号" width="50" align="center" />
 						<el-table-column label="外协商名称" width="320" align="center" prop="name" />
-						<el-table-column label="助记码" width="120" align="center" prop="mnemonicCode" />
+						<el-table-column label="外协厂编码" width="120" align="center" prop="code" />
 						<el-table-column label="发货方式" width="96" align="center" prop="deliveryMethod">
 							<template #default="scope">
 								<dict-tag :options="delivery_method" :value="scope.row.deliveryMethod" />
@@ -58,44 +43,24 @@
 							<template #default="scope"> {{ scope.row.lossLimit }}% </template>
 						</el-table-column>
 						<el-table-column label="默认联系人" width="120" align="center" prop="contactName" />
-							<el-table-column label="默认联系电话" width="120" align="center" prop="contactPhoneNumber" />
+						<el-table-column label="默认联系电话" width="120" align="center" prop="contactPhoneNumber" />
 						<el-table-column label="备注" align="center" prop="remark" />
 						<el-table-column label="操作" width="350" align="center">
 							<template #default="scope">
-								<el-button
-									v-hasPermi="['business:supplier:edit']"
-									link
-									type="primary"
-									icon="User"
-									@click="handleSetSupplierAdmin(scope.row)"
-								>
+								<el-button v-hasPermi="['business:supplier:edit']" link type="primary" icon="User"
+									@click="handleSetSupplierAdmin(scope.row)">
 									设置管理员
 								</el-button>
-								<el-button
-									v-hasPermi="['business:supplier:edit']"
-									link
-									type="success"
-									icon="Iphone"
-									@click="handleSetSupplierContacts(scope.row)"
-								>
+								<el-button v-hasPermi="['business:supplier:edit']" link type="success" icon="Iphone"
+									@click="handleSetSupplierContacts(scope.row)">
 									设置联系人
 								</el-button>
-								<el-button
-									v-hasPermi="['business:supplier:edit']"
-									link
-									type="warning"
-									icon="Edit"
-									@click="handleShowSupplierDialog(scope.row)"
-								>
+								<el-button v-hasPermi="['business:supplier:edit']" link type="warning" icon="Edit"
+									@click="handleShowSupplierDialog(scope.row)">
 									编辑
 								</el-button>
-								<el-button
-									v-hasPermi="['business:supplier:remove']"
-									link
-									type="danger"
-									icon="Delete"
-									@click="handleDelete(scope.row)"
-								>
+								<el-button v-hasPermi="['business:supplier:remove']" link type="danger" icon="Delete"
+									@click="handleDelete(scope.row)">
 									删除
 								</el-button>
 							</template>
@@ -105,13 +70,8 @@
 			</div>
 		</section>
 		<!-- 分页 -->
-		<pagination
-			v-show="supplierTotal > 0"
-			:total="supplierTotal"
-			v-model:page="queryParams.pageNum"
-			v-model:limit="queryParams.pageSize"
-			@pagination="getList"
-		/>
+		<pagination v-show="supplierTotal > 0" :total="supplierTotal" v-model:page="queryParams.pageNum"
+			v-model:limit="queryParams.pageSize" @pagination="getList" />
 
 		<section class="list-part-container row-container" style="flex: 1">
 			<section class="list-part-container" style="flex: 2">
@@ -119,39 +79,22 @@
 				<el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
 					<el-form-item class="section-title" label="产品" />
 					<el-form-item label="产品描述:">
-						<el-input
-							placeholder="请输入关键字"
-							v-model.trim="queryProductParams.productDescription"
-							style="width: 120px"
-							clearable
-							@keyup.enter="handleQuery"
-							@keydown.enter.prevent
-						/>
+						<el-input placeholder="请输入关键字" v-model.trim="queryProductParams.productDescription" style="width: 120px"
+							clearable @keyup.enter="handleQuery" @keydown.enter.prevent />
 					</el-form-item>
 					<el-form-item>
 						<el-button type="info" icon="Search" @click="handleQueryProducts">搜索</el-button>
-						<el-button
-							type="primary"
-							icon="Plus"
-							@click="handleShowProductsDialog(null)"
-							:disabled="!currentSupplier.id"
-						>
+						<el-button type="primary" icon="Plus" @click="handleShowProductsDialog(null)"
+							:disabled="!currentSupplier.id">
 							添加产品
 						</el-button>
 					</el-form-item>
 				</el-form>
 				<div class="el-table-container">
 					<div class="el-table-inner-container">
-						<el-table
-							ref="productTable"
-							:data="supplierProductList ? supplierProductList : []"
-							v-loading="supplierProductLoading"
-							highlight-current-row
-							height="100%"
-							size="small"
-							header-row-class-name="list-header-row"
-							@current-change="handleCurrentProductChange"
-						>
+						<el-table ref="productTable" :data="supplierProductList ? supplierProductList : []"
+							v-loading="supplierProductLoading" highlight-current-row height="100%" size="small"
+							header-row-class-name="list-header-row" @current-change="handleCurrentProductChange">
 							<el-table-column type="index" label="行号" width="50" align="center" />
 							<el-table-column label="料号" width="120" align="center" prop="productCode" />
 							<el-table-column label="产品描述" align="center" prop="productDescription" />
@@ -164,38 +107,21 @@
 					</div>
 				</div>
 				<!-- 分页 -->
-				<pagination
-					v-show="productTotal > 0"
-					:total="productTotal"
-					v-model:page="queryProductParams.pageNum"
-					v-model:limit="queryProductParams.pageSize"
-					@pagination="getCurrentSupplierProduct"
-				/>
+				<pagination v-show="productTotal > 0" :total="productTotal" v-model:page="queryProductParams.pageNum"
+					v-model:limit="queryProductParams.pageSize" @pagination="getCurrentSupplierProduct" />
 			</section>
 			<section class="list-part-container" style="flex: 3">
-				<el-form
-					class="list-search-container list-search-container-child"
-					:model="queryParams"
-					ref="queryRef"
-					:inline="true"
-				>
+				<el-form class="list-search-container list-search-container-child" :model="queryParams" ref="queryRef"
+					:inline="true">
 					<el-form-item class="section-title" label="外协工序" />
 					<el-form-item>
-						<el-button
-							type="primary"
-							icon="Plus"
-							@click="handleShowProcessesDialog"
-							:disabled="!currentProduct.id || processEditStatus"
-						>
+						<el-button type="primary" icon="Plus" @click="handleShowProcessesDialog"
+							:disabled="!currentProduct.id || processEditStatus">
 							添加工序
 						</el-button>
-						<el-button
-							v-if="!processEditStatus"
-							type="warning"
-							icon="Edit"
+						<el-button v-if="!processEditStatus" type="warning" icon="Edit"
 							:disabled="!currentProduct.id || supplierProductProcessList.length === 0"
-							@click="processEditStatus = true"
-						>
+							@click="processEditStatus = true">
 							编辑
 						</el-button>
 						<template v-if="processEditStatus">
@@ -206,38 +132,24 @@
 				</el-form>
 				<div class="el-table-container">
 					<div class="el-table-inner-container">
-						<el-table
-							:data="supplierProductProcessList"
-							v-loading="supplierProductProcessLoading"
-							highlight-current-row
-							height="100%"
-						>
+						<el-table :data="supplierProductProcessList" v-loading="supplierProductProcessLoading" highlight-current-row
+							height="100%">
 							<el-table-column type="index" label="行号" width="50" align="center" />
 							<el-table-column label="工序编码" width="120" align="center" prop="processCode" />
 							<el-table-column label="工序简称" width="120" align="center" prop="processAlias" />
 							<el-table-column label="结算方式" width="120" align="center" prop="settlementType">
 								<template #default="scope">
 									<el-select v-if="processEditStatus" v-model="scope.row.settlementType" clearable placeholder="请选择">
-										<el-option
-											v-for="dict in settlement_type"
-											:key="dict.value"
-											:label="dict.label"
-											:value="dict.value"
-										/>
+										<el-option v-for="dict in settlement_type" :key="dict.value" :label="dict.label"
+											:value="dict.value" />
 									</el-select>
 									<dict-tag v-else :options="settlement_type" :value="scope.row.settlementType" />
 								</template>
 							</el-table-column>
 							<el-table-column label="单价(元)" width="120" align="center" prop="price">
 								<template #default="scope">
-									<el-input-number
-										v-if="processEditStatus"
-										v-model="scope.row.price"
-										:precision="8"
-										:min="0.0"
-										:step="0.00000001"
-										controls-position="right"
-									/>
+									<el-input-number v-if="processEditStatus" v-model="scope.row.price" :precision="8" :min="0.0"
+										:step="0.00000001" controls-position="right" />
 									<span v-else>{{ scope.row.priceLabel }}</span>
 								</template>
 							</el-table-column>
@@ -258,24 +170,17 @@
 			</section>
 		</section>
 		<!-- 供应商表单 -->
-		<dialog-form
-			ref="formRef"
-			@handleSaveSuccess="handleQuery"
-			:delivery-method="delivery_method"
-			:settlement-type="settlement_type"
-		/>
+		<dialog-form ref="formRef" @handleSaveSuccess="handleQuery" :delivery-method="delivery_method"
+			:settlement-type="settlement_type" />
 		<!-- 产品添加对话框 -->
 		<dialog-products ref="productsRef" :supplier-id="currentSupplier.id" :multiple-selected="handleProductSelected" />
 		<!-- 工序添加对话框 -->
-		<dialog-processes
-			ref="processesRef"
-			:product-id="currentProduct.productId"
-			:multiple-selected="handleProcessSelected"
-		/>
+		<dialog-processes ref="processesRef" :product-id="currentProduct.productId"
+			:multiple-selected="handleProcessSelected" />
 		<!-- 管理员设置 -->
 		<dialog-set-admin ref="setAdminRef" />
 		<!-- 联系人设置 -->
-		<contacts-form ref="setContactsRef" @handleSaveSuccess =getList() />
+		<contacts-form ref="setContactsRef" @handleSaveSuccess=getList() />
 	</div>
 </template>
 
@@ -384,7 +289,7 @@ const handleDelete = (row) => {
 				}
 			})
 		})
-		.catch(() => {})
+		.catch(() => { })
 }
 
 /** 设置管理员 **/
@@ -413,7 +318,7 @@ const getCurrentSupplierProduct = () => {
 		if (supplierProductList.value.length > 0) {
 			currentProduct.value = supplierProductList.value[0]
 			proxy.$refs.productTable.setCurrentRow(supplierProductList.value[0])
-		}else{
+		} else {
 			supplierProductProcessList.value = []
 			currentProduct.value = {}
 		}
@@ -463,7 +368,7 @@ const handleDelProduct = (row) => {
 				}
 			})
 		})
-		.catch(() => {})
+		.catch(() => { })
 }
 
 /**************************************** 工序相关 ****************************************/
@@ -505,7 +410,7 @@ const handleProcessSelected = (selection) => {
 			price: 0.0,
 			settlementType: currentSupplier.value.settlementType,
 			remark: '',
-			supplierProductId:currentProduct.value.id
+			supplierProductId: currentProduct.value.id
 		}
 		dataList.push(newProcess)
 	})
@@ -539,7 +444,7 @@ const handleDelProcess = (row) => {
 				}
 			})
 		})
-		.catch(() => {})
+		.catch(() => { })
 }
 
 onMounted(() => {