Sfoglia il codice sorgente

Merge branch 'feature/pyh_工单结算调整' into develop

pengyh 1 anno fa
parent
commit
fd899f3d52

+ 55 - 0
src/api/thirdPartyAddressLogin.js

@@ -0,0 +1,55 @@
+import request, { postBlob, getBlob, handleImport } from '@/utils/request'
+
+// 获取列表
+export function listPageV2(data) {
+  return request({
+    url: `/thirdPart/list/page?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//导出
+export function pageExport(data, name) {
+  return postBlob({
+    url: '/thirdPart/pageExport',
+    data,
+    name
+  })
+}
+
+// 新增
+export function add(data) {
+  return request({
+    url: `/thirdPart/add`,
+    method: 'post',
+    data
+  })
+}
+
+// 编辑
+export function edit(data) {
+  return request({
+    url: `/thirdPart/update`,
+    method: 'post',
+    data
+  })
+}
+
+// 删除
+export function del(params) {
+  return request({
+    url: `/thirdPart/del`,
+    method: 'post',
+    params
+  })
+}
+
+// 详情
+export function getDetail(params) {
+  return request({
+    url: `/thirdPart/detail`,
+    method: 'post',
+    params
+  })
+}

+ 9 - 0
src/api/workOrder/settlementStandardInstall.js

@@ -61,4 +61,13 @@ export function getTypeList(data) {
     method: 'post',
     data
   })
+}
+
+// 获取来源
+export function getSourceList(data) {
+  return request({
+    url: `/dictCompany/page`,
+    method: 'post',
+    data
+  })
 }

+ 8 - 10
src/views/auxiliaryFittings/salesManagement/components/attachmentSalesOrderDetail.vue

@@ -121,14 +121,10 @@
 						</el-col>
 						<el-col :span="9">
 							<el-form-item label="支付方式" prop="payType" :required="true">
-								<el-select v-model="formData.payType" :disabled="formType == 2" placeholder="请选择" style="width: 100%;">
-								    <el-option
-								      v-for="item in [{name: '现金',id: 'CASH'},{name: '微信',id: 'WECHAT'}]"
-								      :key="item.id"
-								      :label="item.name"
-								      :value="item.id">
-								    </el-option>
-								  </el-select>
+								<el-radio-group v-model="formData.payType">
+								    <el-radio :disabled="formType == 2" label="CASH">现金</el-radio>
+								    <el-radio :disabled="formType == 2" label="WECHAT">微信</el-radio>
+								</el-radio-group>
 							</el-form-item>
 						</el-col>
 						<el-col :span="3" v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'">
@@ -419,6 +415,7 @@
 				this.timer = setInterval(()=>{
 					getDetail({salesId: this.id}).then(res => {
 						if(res.data.payFlag == 'YES'){
+							this.$refs.payQRCode.innerHTML = '';
 							this.clear()
 							this.$message.success('支付成功!')
 							this.goBack()
@@ -436,13 +433,13 @@
 				this.is_submit = false
 				setTimeout(()=>{
 					this.is_submit = true
-				},3000)
+				},2000)
 				getCode({
 					salesId: this.formData.salesId
 				}).then(res => {
 					if(res.code == 200){
 						this.payCodeUrl = res.data.codeUrl
-						this.isPay = true
+						this.$refs.payQRCode.innerHTML = '';
 						this.$nextTick(() => {
 						  this.payUrl = res.data.codeUrl;
 						  new QRCode(this.$refs.payQRCode, {
@@ -457,6 +454,7 @@
 						});
 					}
 				})
+				this.isPay = true
 			},
 			save(){
 				this.$refs.formData.validate((valid, invalidFields, errLabels) => {

+ 8 - 10
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesOrderDetail.vue

@@ -121,14 +121,10 @@
 						</el-col>
 						<el-col :span="9">
 							<el-form-item label="支付方式" prop="payType" :required="true">
-								<el-select v-model="formData.payType" :disabled="formData.flag != 'SAVE' && formType!=0" placeholder="请选择" style="width: 100%;">
-								    <el-option
-								      v-for="item in [{name: '现金',id: 'CASH'},{name: '微信',id: 'WECHAT'}]"
-								      :key="item.id"
-								      :label="item.name"
-								      :value="item.id">
-								    </el-option>
-								  </el-select>
+								<el-radio-group v-model="formData.payType">
+								    <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="CASH">现金</el-radio>
+								    <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="WECHAT">微信</el-radio>
+								</el-radio-group>
 							</el-form-item>
 						</el-col>
 						<el-col :span="3" v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'">
@@ -494,6 +490,7 @@
 				this.timer = setInterval(()=>{
 					getDetail({salesId: this.id}).then(res => {
 						if(res.data.payFlag == 'YES'){
+							this.$refs.payQRCode.innerHTML = '';
 							this.clear()
 							this.$message.success('支付成功!')
 							this.goBack()
@@ -511,13 +508,13 @@
 				this.is_submit = false
 				setTimeout(()=>{
 					this.is_submit = true
-				},3000)
+				},2000)
 				getCode({
 					salesId: this.formData.salesId
 				}).then(res => {
 					if(res.code == 200){
 						this.payCodeUrl = res.data.codeUrl
-						this.isPay = true
+						this.$refs.payQRCode.innerHTML = '';
 						this.$nextTick(() => {
 						  this.payUrl = res.data.codeUrl;
 						  new QRCode(this.$refs.payQRCode, {
@@ -532,6 +529,7 @@
 						});
 					}
 				})
+				this.isPay = true
 			},
 			save(){
 				this.$refs.formData.validate((valid, invalidFields, errLabels) => {

+ 204 - 0
src/views/setting/thirdPartyAddressLogin/index.vue

@@ -0,0 +1,204 @@
+<template>
+  <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
+    :operationColumnWidth="80" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+    :column-parsing="columnParsing" :operation="operation" :exportList="exportList">
+    <el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
+      :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
+      <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+        <zj-form-module :title="formDialogTitles[formDialogType]" label-width="80px" :showPackUp="false"
+          :form-data="formData" :form-items="formItems" :disabled="formDialogType == 2">
+        </zj-form-module>
+      </zj-form-container>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="formCancel">取 消</el-button>
+        <el-button size="mini" type="primary" @click="formConfirm()">确定</el-button>
+      </div>
+    </el-dialog>
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import ImageUpload from '@/components/file-upload'
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+import { listPageV2, pageExport, getDetail, add, edit, del } from "@/api/thirdPartyAddressLogin";
+import operation_mixin from '@/components/template/operation_mixin.js'
+export default {
+  components: { TemplatePage, ImageUpload },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+		// 事件组合
+		optionsEvensGroup: [
+			[
+				[
+					{
+						name: '新增',
+						isRole: JSON.parse(localStorage.getItem('greemall_user')).userName == 'admin',
+						click: this.addData
+					}
+				],
+			],
+		],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ["新增", "编辑", "详情"],
+      formDialog: false,
+      formData: {
+		urlName: '',
+		url: '',
+		remark: '',
+		status: 'ON',
+      }
+    }
+  },
+  computed: {
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {
+      return [{
+        md: 24,
+        isShow: true,
+        name: 'el-input',
+        attributes: { placeholder: '请输入网址名称', },
+        formItemAttributes: {
+          label: '网址名称',
+          prop: 'urlName',
+          rules: [...required]
+        }
+      }, {
+        md: 24,
+        isShow: true,
+        name: 'el-input',
+        attributes: { placeholder: '请输入网址链接', },
+        formItemAttributes: {
+          label: '网址链接',
+          prop: 'url',
+          rules: [...required]
+        }
+      }, {
+	  	md: 24,
+	  	isShow: true,
+	  	name: 'el-input',
+	  	attributes: { placeholder: '请输入说明内容', type: "textarea", rows: 5 },
+	  	formItemAttributes: {
+	  		label: '说明',
+	  		prop: 'remark',
+	  		rules: [...required]
+	  	}
+	  },{
+        md: 24,
+        isShow: true,
+        name: 'slot-component',
+        attributes: {},
+        formItemAttributes: {
+          label: '状态',
+          prop: 'status',
+          rules: [...required]
+        },
+		render: (h, { props, onInput }) => {
+			var { value } = props
+			return (
+				<el-radio-group v-model={this.formData.status}>
+						<el-radio label="ON">启用</el-radio>
+						<el-radio label="OFF">禁用</el-radio>
+				</el-radio-group>
+			)
+		}
+    }]
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList: listPageV2,
+    // 列表导出函数
+    exportList: pageExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+
+    // 表格操作列
+    operation(h, { row, index, column }) {
+    	return (<div class='operation-btns'>
+    		{JSON.parse(localStorage.getItem('greemall_user')).userName == 'admin' ? <el-button type="text" onClick={() => {
+    			getDetail({
+    				id: row.id
+    			}).then(res => {
+    				Object.assign(this.formData, res.data)
+    				this.formDialogType = 1
+    				this.openForm()
+    			})
+    		}}>编辑</el-button> : null}
+    		{JSON.parse(localStorage.getItem('greemall_user')).userName == 'admin' ? <el-popconfirm
+    			title={`是否确定删除?`}
+    			onConfirm={() => {
+    				noticeDel({
+    					id: row.id
+    				}).then(res => {
+    					this.$message({
+    						type: 'success',
+    						message: '删除成功!'
+    					})
+    					this.$refs.pageRef.refreshList()
+    				})
+    			}}
+    		>
+    			<el-button type="text" slot="reference">删除</el-button>
+    		</el-popconfirm> : null}
+			{JSON.parse(localStorage.getItem('greemall_user')).userName != 'admin' ? <el-button type="text" onClick={() => {
+    			window.open(row.url)
+    		}}>登陆</el-button> : null}
+    	</div>)
+    },
+
+    addData() {
+      this.formDialogType = 0
+      this.openForm()
+    },
+    openForm() {
+      this.formDialog = true;
+    },
+    formCancel() {
+      this.$refs.formRef.$refs.inlineForm.clearValidate()
+      this.$data.formData = this.$options.data().formData
+      this.formDialog = false
+    },
+    formConfirm() {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          ([add, edit][this.formDialogType])(this.formData).then(res => {
+            this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
+            this.formCancel()
+            this.$refs.pageRef.refreshList()
+          })
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.tab {
+  padding: 20px 20px 0 20px;
+}
+</style>

+ 36 - 2
src/views/workOrder/basicConfiguration/settlementStandard/components/install.vue

@@ -11,7 +11,7 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2, pageExport, add, edit, del, getMainList, getTypeList } from "@/api/workOrder/settlementStandardInstall";
+import { listPageV2, pageExport, add, edit, del, getMainList, getTypeList, getSourceList } from "@/api/workOrder/settlementStandardInstall";
 import { thousands } from '@/utils/common'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
@@ -40,7 +40,8 @@ export default {
 			editIndex: null,
 			mainList: [],
 			smallList: [],
-			typeList: []
+			typeList: [],
+			sourceList: []
 		}
 	},
 	computed: {
@@ -67,6 +68,7 @@ export default {
 	created() {
 		this.getMainList()
 		this.getTypeList()
+		this.getSourceList()
 	},
 	methods: {
 		// 列表请求函数
@@ -84,6 +86,27 @@ export default {
 		exportList: pageExport,
 		// 表格列解析渲染数据更改
 		columnParsing(item, defaultData) {
+		if (item.jname === 'orderChannelText') {
+			defaultData.render = (h, { row, index, column }) => {
+				return this.editIndex == index ? (
+					<div class="redbordererr">
+						<el-form-item prop={`tableData.${index}.orderChannelId`} rules={[{ required: true, message: '工单来源不能为空', trigger: 'blur' }]}>
+							<el-select value={{ dictCode: row.orderChannelId, dictValue: row.orderChannelText }} value-key="dictCode" placeholder="请选择"
+								onInput={(val) => {
+									row.orderChannelText = val.dictValue
+									row.orderChannelId = val.dictCode
+								}}>
+								{
+									this.sourceList.map((item, index) => {
+										return <el-option key={item.dictCode} label={item.dictValue} value={item}></el-option>
+									})
+								}
+							</el-select>
+						</el-form-item>
+					</div>
+				) : (<div style="padding: 6px;">{row.orderChannelText}</div>)
+			}
+		}
 			if (item.jname === 'typeName') {
 				defaultData.render = (h, { row, index, column }) => {
 					return this.editIndex == index ? (
@@ -281,12 +304,19 @@ export default {
 				this.typeList = res.data.records
 			})
 		},
+		getSourceList(){
+			getSourceList({ pageNum: 1, pageSize: -1, params: [{param: "a.dict_type", compare: "=", value: "ORDER_CHANNEL"}] }).then(res => {
+				this.sourceList = [...[{ dictValue: '通用', dictCode: '0' }], ...res.data.records]
+			})
+		},
 		addData() {
 			this.$refs.pageRef.tableForm().validate((valid) => {
 				if (valid) {
 					this.editIndex = 0
 					this.$refs.pageRef.insertionData(0, {
 						settleNormType: 'INSTALL',
+						orderChannelText: '',
+						orderChannelId: '',
 						typeName: '',
 						type: '',
 						categoryName: '',
@@ -309,6 +339,8 @@ export default {
 		add(row) {
 			add({
 				settleNormType: 'INSTALL',
+				orderChannelText: row.orderChannelText,
+				orderChannelId: row.orderChannelId,
 				typeName: row.typeName,
 				type: row.type,
 				parentCategoryName: row.parentCategoryName,
@@ -330,6 +362,8 @@ export default {
 			edit({
 				id: row.id,
 				settleNormType: 'INSTALL',
+				orderChannelText: row.orderChannelText,
+				orderChannelId: row.orderChannelId,
 				typeName: row.typeName,
 				type: row.type,
 				parentCategoryName: row.parentCategoryName,

+ 36 - 1
src/views/workOrder/basicConfiguration/settlementStandard/components/other.vue

@@ -13,6 +13,7 @@ import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
 import { del } from "@/api/workOrder/settlementStandardInstall";
 import { listPageV2, pageExport, add, edit } from "@/api/workOrder/settlementStandardOther";
+import { getSourceList } from "@/api/workOrder/settlementStandardInstall";
 import { thousands } from '@/utils/common'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
@@ -41,7 +42,8 @@ export default {
 			editIndex: null,
 			mainList: [],
 			smallList: [],
-			typeList: []
+			typeList: [],
+			sourceList: []
 		}
 	},
 	computed: {
@@ -65,6 +67,9 @@ export default {
 			return []
 		}
 	},
+	created() {
+		this.getSourceList()
+	},
 	methods: {
 		// 列表请求函数
 		getList: listPageV2,
@@ -81,6 +86,27 @@ export default {
 		exportList: pageExport,
 		// 表格列解析渲染数据更改
 		columnParsing(item, defaultData) {
+			if (item.jname === 'orderChannelText') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.orderChannelId`} rules={[{ required: true, message: '工单来源不能为空', trigger: 'blur' }]}>
+								<el-select value={{ dictCode: row.orderChannelId, dictValue: row.orderChannelText }} value-key="dictCode" placeholder="请选择"
+									onInput={(val) => {
+										row.orderChannelText = val.dictValue
+										row.orderChannelId = val.dictCode
+									}}>
+									{
+										this.sourceList.map((item, index) => {
+											return <el-option key={item.dictCode} label={item.dictValue} value={item}></el-option>
+										})
+									}
+								</el-select>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.orderChannelText}</div>)
+				}
+			}
 			if (item.jname === 'typeName') {
 				defaultData.render = (h, { row, index, column }) => {
 					return this.editIndex == index ? (
@@ -149,6 +175,11 @@ export default {
 		selectionChange(data) {
 			this.recordSelected = data
 		},
+		getSourceList(){
+			getSourceList({ pageNum: 1, pageSize: -1, params: [{param: "a.dict_type", compare: "=", value: "ORDER_CHANNEL"}] }).then(res => {
+				this.sourceList = [...[{ dictValue: '通用', dictCode: '0' }], ...res.data.records]
+			})
+		},
 
 		operation() {
 			return this.operationBtn({
@@ -219,6 +250,8 @@ export default {
 					this.$refs.pageRef.insertionData(0, {
 						companyWechatName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
 						settleNormType: 'OTHER',
+						orderChannelText: '',
+						orderChannelId: '',
 						typeName: '',
 						type: '',
 						label: '',
@@ -247,6 +280,8 @@ export default {
 			edit({
 				id: row.id,
 				settleNormType: 'OTHER',
+				orderChannelText: row.orderChannelText,
+				orderChannelId: row.orderChannelId,
 				typeName: row.typeName,
 				type: row.type,
 				label: row.label,

+ 36 - 1
src/views/workOrder/basicConfiguration/settlementStandard/components/repair.vue

@@ -12,6 +12,7 @@ import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
 import { del, getMainList, getTypeList } from "@/api/workOrder/settlementStandardInstall";
 import { listPageV2, pageExport, add, edit } from "@/api/workOrder/settlementStandardRepair";
+import { getSourceList } from "@/api/workOrder/settlementStandardInstall";
 import { thousands } from '@/utils/common'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
@@ -40,7 +41,8 @@ export default {
 			editIndex: null,
 			mainList: [],
 			smallList: [],
-			typeList: []
+			typeList: [],
+			sourceList: []
 		}
 	},
 	computed: {
@@ -67,6 +69,7 @@ export default {
 	created() {
 		this.getMainList()
 		this.getTypeList()
+		this.getSourceList()
 	},
 	methods: {
 		// 列表请求函数
@@ -84,6 +87,27 @@ export default {
 		exportList: pageExport,
 		// 表格列解析渲染数据更改
 		columnParsing(item, defaultData) {
+			if (item.jname === 'orderChannelText') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.orderChannelId`} rules={[{ required: true, message: '工单来源不能为空', trigger: 'blur' }]}>
+								<el-select value={{ dictCode: row.orderChannelId, dictValue: row.orderChannelText }} value-key="dictCode" placeholder="请选择"
+									onInput={(val) => {
+										row.orderChannelText = val.dictValue
+										row.orderChannelId = val.dictCode
+									}}>
+									{
+										this.sourceList.map((item, index) => {
+											return <el-option key={item.dictCode} label={item.dictValue} value={item}></el-option>
+										})
+									}
+								</el-select>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.orderChannelText}</div>)
+				}
+			}
 			if (item.jname === 'typeName') {
 				defaultData.render = (h, { row, index, column }) => {
 					return this.editIndex == index ? (
@@ -306,6 +330,11 @@ export default {
 				this.typeList = res.data.records
 			})
 		},
+		getSourceList(){
+			getSourceList({ pageNum: 1, pageSize: -1, params: [{param: "a.dict_type", compare: "=", value: "ORDER_CHANNEL"}] }).then(res => {
+				this.sourceList = [...[{ dictValue: '通用', dictCode: '0' }], ...res.data.records]
+			})
+		},
 		addData() {
 			this.$refs.pageRef.tableForm().validate((valid) => {
 				if (valid) {
@@ -313,6 +342,8 @@ export default {
 					this.$refs.pageRef.insertionData(0, {
 						companyWechatName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
 						settleNormType: 'REPAIR',
+						orderChannelText: '',
+						orderChannelId: '',
 						typeName: '',
 						type: '',
 						categoryName: '',
@@ -336,6 +367,8 @@ export default {
 		add(row) {
 			add({
 				settleNormType: 'REPAIR',
+				orderChannelText: row.orderChannelText,
+				orderChannelId: row.orderChannelId,
 				typeName: row.typeName,
 				type: row.type,
 				parentCategoryName: row.parentCategoryName,
@@ -358,6 +391,8 @@ export default {
 			edit({
 				id: row.id,
 				settleNormType: 'REPAIR',
+				orderChannelText: row.orderChannelText,
+				orderChannelId: row.orderChannelId,
 				typeName: row.typeName,
 				type: row.type,
 				parentCategoryName: row.parentCategoryName,