소스 검색

工程维保增加辅配件配置

pengyh 1 년 전
부모
커밋
148fda891b

+ 46 - 0
src/api/auxiliaryFittings/projectAuxiliaryManage.js

@@ -0,0 +1,46 @@
+import request, { postBlob, getBlob, handleImport } from '@/utils/request'
+
+// 获取列表
+export function listPage(data) {
+  return request({
+    url: `/order/engin/manger/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//导出
+export function pageExport(data, name) {
+  return postBlob({
+    url: '/order/engin/manger/list/export',
+    data,
+    name
+  })
+}
+
+// 详情
+export function getDetail(params) {
+  return request({
+    url: `/order/engin/manger/detail`,
+    method: 'post',
+    params
+  })
+}
+
+// 确定
+export function givePrice(data) {
+  return request({
+    url: `/order/engin/manger/givePrice`,
+    method: 'post',
+    data
+  })
+}
+
+// 收款详情
+export function getPriceDetail(data) {
+  return request({
+    url: `/order/engin/manger/detailPrice`,
+    method: 'post',
+    data
+  })
+}

+ 18 - 0
src/api/engineeringMaintenance/basicData.js

@@ -34,4 +34,22 @@ export function getDetail(params) {
     method: 'post',
     params
   })
+}
+
+// 获取辅材收费标准
+export function getAuxiliaryList(data) {
+  return request({
+    url: `/material/norm/list`,
+    method: 'post',
+    data
+  })
+}
+
+// 获取配件资料
+export function getAttachmentList(data) {
+  return request({
+    url: `/websit/goods/p/list`,
+    method: 'post',
+    data
+  })
 }

+ 1 - 1
src/views/auxiliaryFittings/projectAuxiliaryManage/detail.vue

@@ -154,7 +154,7 @@
 	import ImageUpload from '@/components/file-upload'
 	import { lbsAmapRegion } from '@/api/common.js'
 	import geographicalPosi from '@/components/geographicalPosi/index.vue'
-	import { getDetail, confirm } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+	import { getDetail, givePrice, getPriceDetail } from "@/api/auxiliaryFittings/projectAuxiliaryManage";
 	export default {
 		components: {geographicalPosi,ImageUpload},
 		props: ['id','title','formType'],

+ 4 - 4
src/views/auxiliaryFittings/projectAuxiliaryManage/index.vue

@@ -26,7 +26,7 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2, pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+import { listPage, pageExport } from "@/api/auxiliaryFittings/projectAuxiliaryManage";
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
 	components: { TemplatePage, ImageUpload, detail },
@@ -49,7 +49,7 @@ export default {
 			formDialogTitles: ["新增", "编辑", "详情"],
 			formDialog: false,
 			id: '',
-			flag: 'SAVE',
+			flag: '',
 			isShowTab: true
 		}
 	},
@@ -95,9 +95,9 @@ export default {
 		getList(p, cb) {
 			try {
 				var pam = JSON.parse(JSON.stringify(p))
-				pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'M' }, { 'param': 'a.flag', "compare": "=", "value": this.flag })
+				// pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'M' }, { 'param': 'a.flag', "compare": "=", "value": this.flag })
 				cb && cb(pam)
-				return listPageV2(pam)
+				return listPage(pam)
 			} catch (error) {
 				console.log(error)
 			}

+ 255 - 5
src/views/engineeringMaintenance/basicData/detail.vue

@@ -122,6 +122,8 @@
 				    <el-tab-pane label="项目设备" name="1"></el-tab-pane>
 				    <el-tab-pane label="项目人员" name="2"></el-tab-pane>
 				    <el-tab-pane label="服务网点" name="3"></el-tab-pane>
+					<el-tab-pane label="辅材配置" name="4"></el-tab-pane>
+					<el-tab-pane label="配件配置" name="5"></el-tab-pane>
 				</el-tabs>
 				<el-button size="small" v-if="formType!=2" type="primary" @click="add()">新增</el-button>
 				<div class="table">
@@ -332,6 +334,170 @@
 							</el-table-column>
 						</el-table>
 					</el-form>
+					<!-- 辅材配置 -->
+					<el-form ref="formData4" :model="formData4">
+						<el-table v-show="typeIndex == 4" :data="formData4.itemList" element-loading-text="Loading" border fit highlight-current-row stripe>
+							<el-table-column label="大类" align="center">
+								<template slot-scope="scope">
+									<el-form-item>
+										{{scope.row.parentCategoryName}}
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column label="小类" align="center">
+								<template slot-scope="scope">
+									<el-form-item>
+										{{scope.row.goodsCategoryName}}
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column label="*辅材名称" align="center">
+								<template slot-scope="scope">
+									<el-form-item :prop="'itemList.' + scope.$index + '.auxiliary'" :rules="[{ required: true, message: `请选择辅材名称`, trigger: 'blur' }]">
+										<el-select v-model="scope.row.auxiliary" @change="(e)=>{
+												scope.row.goodsId = e.normId
+												scope.row.goodsName = e.normName
+												scope.row.goodsCategoryName = e.categoryName
+												scope.row.goodsCategoryId = e.categoryId
+												scope.row.parentCategoryName = e.parentCategoryName
+												scope.row.parentCategoryId = e.parentCategoryId
+												scope.row.goodsCode = e.normCode
+												scope.row.goodsSpecification = e.specification
+												scope.row.goodsStockUnit = e.unit
+												scope.row.normType = e.normType
+												scope.row.normAmount = e.normAmount
+											}" :disabled="isEdit4 != scope.$index || formType == 2" value-key="normId" placeholder="请选择" style="width: 100%;">
+										    <el-option
+										      v-for="(item,ind) in auxiliaryList"
+										      :key="ind"
+										      :label="item.normName"
+										      :value="item">
+										    </el-option>
+										  </el-select>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column prop="" align="center" label="商品代码">
+								<template slot-scope="scope">
+									<el-form-item>
+										{{scope.row.goodsCode}}
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column prop="" align="center" label="规格型号">
+								<template slot-scope="scope">
+									<el-form-item>
+										{{scope.row.goodsSpecification}}
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column align="center" label="单位">
+								<template slot-scope="scope">
+									<el-form-item>
+										{{scope.row.goodsStockUnit}}
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column prop="" align="center" label="收费类型" >
+								<template slot-scope="scope">
+									<el-form-item>
+										{{scope.row.normType == 'M'?'配件物料':scope.row.normType == 'S'?'服务收费':''}}
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column prop="" align="center" label="*收费标准(元)">
+								<template slot-scope="scope">
+									<el-form-item :prop="'itemList.' + scope.$index + '.normAmount'"
+										:rules="[{ required: true, message: `请输入收费标准`, trigger: 'blur' }]">
+										<el-input type="number" oninput="if(value < 0) value=0" v-model="scope.row.normAmount" :disabled="isEdit4 != scope.$index || formType == 2" placeholder="请输入"></el-input>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column label="操作" align="right" width="140">
+								<template slot-scope="scope" v-if="formType != 2">
+									<el-button size="mini" type="primary" v-if="scope.$index != isEdit4" @click="edit(4,scope.$index)">编辑</el-button>
+									<el-button size="mini" type="danger" @click="del(scope.$index)">删除</el-button>
+								</template>
+							</el-table-column>
+						</el-table>
+					</el-form>
+					<!-- 配件配置 -->
+					<el-form ref="formData5" :model="formData5">
+						<el-table v-show="typeIndex == 5" :data="formData5.itemList" element-loading-text="Loading" border fit highlight-current-row stripe>
+							<el-table-column label="*配件名称" align="center">
+								<template slot-scope="scope">
+									<el-form-item :prop="'itemList.' + scope.$index + '.attachment'" :rules="[{ required: true, message: `请选择辅材名称`, trigger: 'blur' }]">
+										<el-select v-model="scope.row.attachment" @change="(e)=>{
+												scope.row.goodsId = e.goodsId
+												scope.row.goodsName = e.goodsName
+												scope.row.goodsCode = e.goodsCode
+												scope.row.goodsStockUnit = e.goodsStockUnit
+												scope.row.normType = e.normType
+												scope.row.normAmount = e.normAmount
+												scope.row.brandRelaName = e.brandRelaName
+												scope.row.productRelaName = e.productRelaName
+											}" :disabled="isEdit5 != scope.$index || formType == 2" value-key="goodsId" placeholder="请选择" style="width: 100%;">
+										    <el-option
+										      v-for="(item,ind) in attachmentList"
+										      :key="ind"
+										      :label="item.goodsName"
+										      :value="item">
+										    </el-option>
+										  </el-select>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column align="center" label="单位">
+								<template slot-scope="scope">
+									<el-form-item>
+										{{scope.row.goodsStockUnit}}
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column prop="" align="center" label="商品代码">
+								<template slot-scope="scope">
+									<el-form-item>
+										{{scope.row.goodsCode}}
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column prop="" align="center" label="收费类型" >
+								<template slot-scope="scope">
+									<el-form-item>
+										{{scope.row.normType == 'M'?'配件物料':scope.row.normType == 'S'?'服务收费':''}}
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column prop="" align="center" label="适用品牌">
+								<template slot-scope="scope">
+									<el-form-item>
+										{{scope.row.brandRelaName}}
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column prop="" align="center" label="适用产品大类">
+								<template slot-scope="scope">
+									<el-form-item>
+										{{scope.row.productRelaName}}
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column prop="" align="center" label="*收费标准(元)">
+								<template slot-scope="scope">
+									<el-form-item :prop="'itemList.' + scope.$index + '.normAmount'"
+										:rules="[{ required: true, message: `请输入收费标准`, trigger: 'blur' }]">
+										<el-input type="number" oninput="if(value < 0) value=0" v-model="scope.row.normAmount" :disabled="isEdit5 != scope.$index || formType == 2" placeholder="请输入"></el-input>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column label="操作" align="right" width="140">
+								<template slot-scope="scope" v-if="formType != 2">
+									<el-button size="mini" type="primary" v-if="scope.$index != isEdit5" @click="edit(5,scope.$index)">编辑</el-button>
+									<el-button size="mini" type="danger" @click="del(scope.$index)">删除</el-button>
+								</template>
+							</el-table-column>
+						</el-table>
+					</el-form>
 				</div>
 			</el-card>
 			<div class="page-footer">
@@ -366,7 +532,7 @@
 	import geographicalPosi from '@/components/geographicalPosi/index.vue'
 	import { getMainList } from "@/api/workOrder/settlementStandardInstall";
 	import { getBrand } from '@/api/goods'
-	import { getDetail, save } from "@/api/engineeringMaintenance/basicData";
+	import { getDetail, getAuxiliaryList, getAttachmentList, save } from "@/api/engineeringMaintenance/basicData";
 	import request from '@/utils/request'
 	export default {
 		components: {geographicalPosi},
@@ -375,6 +541,8 @@
 			return {
 				tabIndex: 1,
 				typeIndex: '1',
+				auxiliaryList: [],
+				attachmentList: [],
 				orderTypeList: [],
 				websitData: [],
 				brandList: [],
@@ -417,9 +585,17 @@
 				formData3: {
 					websitList: [],
 				},
+				formData4: {
+					itemList: [],
+				},
+				formData5: {
+					itemList: [],
+				},
 				isEdit1: 0,
 				isEdit2: 0,
 				isEdit3: 0,
+				isEdit4: 0,
+				isEdit5: 0,
 				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
 				rules: {
 					projectName: [
@@ -455,6 +631,8 @@
 				rules1: {},
 				rules2: {},
 				rules3: {},
+				rules4: {},
+				rules5: {},
 				isSave: true
 			};
 		},
@@ -509,7 +687,15 @@
 					})
 					this.formData2.byList = res.data.byList
 					this.formData3.websitList = res.data.websitList
-					
+					res.data.itemList.map(item=>{
+						if(item.goodsType == 'M'){
+							item.auxiliary = {normId: item.goodsId}
+							this.formData4.itemList.push(item)
+						}else{
+							item.attachment = {goodsId: item.goodsId}
+							this.formData5.itemList.push(item)
+						}
+					})
 					
 					console.log(this.formData1.productList,'123123123')
 				})
@@ -519,6 +705,8 @@
 				this.getBrandList()
 				this.getWebsit()
 				this.getMainList()
+				this.getAuxiliaryList()
+				this.getAttachmentList()
 				this.getinitlbslist()
 			},
 			getOrderType(){
@@ -546,6 +734,24 @@
 					this.mainList = res.data
 				})
 			},
+			getAuxiliaryList(){
+				getAuxiliaryList({
+					pageNum: 1,
+					pageSize: -1,
+					params: []
+				}).then(res => {
+					this.auxiliaryList = res.data.records
+				})
+			},
+			getAttachmentList(){
+				getAttachmentList({
+					pageNum: 1,
+					pageSize: -1,
+					params: [{param: "a.norm_type", compare: "=", value: "M"}]
+				}).then(res => {
+					this.attachmentList = res.data.records
+				})
+			},
 			getinitlbslist() {
 			  // 初始化请求省市区街道下拉选项数据
 			  lbsAmapRegion({ pid: 0 }).then(res => {
@@ -657,7 +863,7 @@
 			},
 			add(){
 				if(!this.preserveRuleForm('formData' + this.typeIndex)){return false}
-				let name = this.typeIndex == 1?'productList':this.typeIndex == 2?'byList':'websitList'
+				let name = this.typeIndex == 1?'productList':this.typeIndex == 2?'byList':this.typeIndex == 3?'websitList':'itemList'
 				this['isEdit' + this.typeIndex] = 0
 				// if(this['formData' + this.typeIndex][name].length != 0){this['isEdit' + this.typeIndex] += 1}
 				if(this.typeIndex == 1){
@@ -684,7 +890,7 @@
 						mobile: '',
 						feeExamine: ''
 					})
-				}else{
+				}else if(this.typeIndex == 3){
 					this['formData' + this.typeIndex][name].unshift({
 						websit: null,
 						websitId: '',
@@ -693,6 +899,35 @@
 						mobile: '',
 						address: ''
 					})
+				}else if(this.typeIndex == 4){
+					this['formData' + this.typeIndex][name].unshift({
+						auxiliary: null,
+						goodsId: '',
+						goodsName: '',
+						parentCategoryId: '',
+						parentCategoryName: '',
+						goodsCategoryId: '',
+						goodsCategoryName: '',
+						goodsCode: '',
+						goodsSpecification: '',
+						goodsStockUnit: '',
+						normType: '',
+						normAmount: '',
+						goodsType: 'M'
+					})
+				}else if(this.typeIndex == 5){
+					this['formData' + this.typeIndex][name].unshift({
+						attachment: null,
+						goodsId: '',
+						goodsName: '',
+						goodsCode: '',
+						goodsStockUnit: '',
+						normType: '',
+						normAmount: '',
+						brandRelaName: '',
+						productRelaName: '',
+						goodsType: 'P'
+					})
 				}
 			},
 			del(index){
@@ -715,6 +950,14 @@
 							that.typeIndex = '3'
 							return that.$message.error('请添加服务网点信息');
 						}
+						if(that.formData4.itemList.length == 0){
+							that.typeIndex = '4'
+							return that.$message.error('请添加辅材配置信息');
+						}
+						if(that.formData5.itemList.length == 0){
+							that.typeIndex = '5'
+							return that.$message.error('请添加配件配置信息');
+						}
 						if(!that.preserveRuleForm('formData1')){
 							return that.typeIndex = '1'
 						}
@@ -724,6 +967,12 @@
 						if(!that.preserveRuleForm('formData3')){
 							return that.typeIndex = '3'
 						}
+						if(!that.preserveRuleForm('formData4')){
+							return that.typeIndex = '4'
+						}
+						if(!that.preserveRuleForm('formData5')){
+							return that.typeIndex = '5'
+						}
 						this.save()
 					}
 				})
@@ -747,7 +996,8 @@
 					byList: this.formData2.byList,
 					productList: this.formData1.productList,
 					websitList: this.formData3.websitList,
-					typeList: data
+					typeList: data,
+					itemList: [...this.formData4.itemList,...this.formData5.itemList]
 				}
 				save(params).then(res => {
 					that.$message.success('保存成功!')