pengyh 1 год назад
Родитель
Сommit
c8ef119138

+ 5 - 0
package-lock.json

@@ -16789,6 +16789,11 @@
       "resolved": "http://121.41.110.30:4873/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz",
       "integrity": "sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ=="
     },
+    "qrcodejs2": {
+      "version": "0.0.2",
+      "resolved": "http://121.41.110.30:4873/qrcodejs2/-/qrcodejs2-0.0.2.tgz",
+      "integrity": "sha512-+Y4HA+cb6qUzdgvI3KML8GYpMFwB24dFwzMkS/yXq6hwtUGNUnZQdUnksrV1XGMc2mid5ROw5SAuY9XhI3ValA=="
+    },
     "qs": {
       "version": "6.5.3",
       "resolved": "https://registry.npmmirror.com/qs/-/qs-6.5.3.tgz",

+ 1 - 0
package.json

@@ -39,6 +39,7 @@
     "openai": "^3.1.0",
     "path-to-regexp": "2.4.0",
     "pl-table": "^2.7.5",
+    "qrcodejs2": "0.0.2",
     "screenfull": "^4.2.0",
     "socket.io-client": "^4.6.0",
     "uuid": "^9.0.0",

+ 2 - 2
src/api/auxiliaryFittings/attachmentNewReturn.js

@@ -37,9 +37,9 @@ export function edit(data) {
 }
 
 // 详情
-export function getDetail(params) {
+export function getNewDetail(params) {
   return request({
-    url: `/websit/goods/detail`,
+    url: `/websitPartsRet/detail`,
     method: 'post',
     params
   })

+ 2 - 2
src/api/auxiliaryFittings/auxiliarySalesReturnOrder.js

@@ -37,9 +37,9 @@ export function edit(data) {
 }
 
 // 详情
-export function getDetail(params) {
+export function getReturnDetail(params) {
   return request({
-    url: `/websit/goods/detail`,
+    url: `/websitSalesRet/detail`,
     method: 'post',
     params
   })

+ 2 - 2
src/views/auxiliaryFittings/attachmentProfile/index.vue

@@ -477,9 +477,9 @@ export default {
 			cancelButtonText: '取消',
 			type: 'warning'
 		}).then(() => {
-			memberInner({
+			updateStatus({
 				stateEnum,
-				ids: this.recordSelected.map(item=>{return item.goodsId}).join(',')
+				ids: this.recordSelected.map(item=>{return item.goodsId})
 			}).then(res => {
 				if (res.code == 200) {
 					this.$message({ type: 'success', message: `${stateEnum=='ON'?'下架':'上架'}成功!` })

+ 36 - 302
src/views/auxiliaryFittings/salesManagement/attachmentNewReturn/index.vue

@@ -1,41 +1,34 @@
 <template>
-	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="50"
-	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-	  :operation="operation" :exportList="exportList">
-	  
-	  <div slot="moreSearch">
-	    <el-radio-group v-model="goodsType" size="mini" @change="changeType">
-	    	<el-radio-button label="">全部</el-radio-button>
-	    	<el-radio-button label="PAY_NOT_TAKE">待确认</el-radio-button>
-	    	<el-radio-button label="SUBMIT">已确认</el-radio-button>
-	    </el-radio-group>
-	    <br><br>
-	  </div>
-	  
-	  <el-dialog title="" width="1200px" 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="160px" :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>
+	<div class="page">
+		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="50"
+		  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
+		  :operation="operation" :exportList="exportList">
+		  
+		  <div slot="moreSearch">
+		    <el-radio-group v-model="flag" size="mini" @change="changeType">
+		    	<el-radio-button label="">全部</el-radio-button>
+		    	<el-radio-button label="SUBMIT">待收货</el-radio-button>
+		    	<el-radio-button label="OK">已收货</el-radio-button>
+		    </el-radio-group>
+		    <br><br>
+		  </div>
+		</template-page>
+		<div class="detail" v-if="formDialog">
+			<attachmentNewReturnDetail :id="id" @back="backList" :formType="formDialogType" :title="'配件新件返还' + formDialogTitles[formDialogType]"></attachmentNewReturnDetail>
+		</div>
+	</div>
 </template>
 
 <script>
 import TemplatePage from '@/components/template/template-page-1.vue'
+import attachmentNewReturnDetail from '../components/attachmentNewReturnDetail.vue'
 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/auxiliarySalesReturnOrder";
+import { listPageV2,pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/attachmentNewReturn";
 export default {
-  components: { TemplatePage, ImageUpload },
+  components: { TemplatePage, ImageUpload, attachmentNewReturnDetail },
   mixins: [import_mixin],
   data() {
     return {
@@ -65,28 +58,8 @@ export default {
       formDialogType: 0,
       formDialogTitles: ["新增","编辑", "详情"],
       formDialog: false,
-      formData: {
-		companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-		venderName: '',
-		linkName: '',
-		linkTel: '',
-		address: '',
-		zipNo: '',
-		email: '',
-		www: '',
-		telNO: '',
-		corporation: '',
-		faxNo: '',
-		licenseId: '',
-		khBank: '',
-		bankRow: '',
-		accNo: '',
-		remark: '',
-		stateEnum: 'ON',
-		venderType: 'M',
-		imageUrl: []
-      },
-	  goodsType: ''
+		id: '',
+		flag: ''
     }
   },
   computed: {
@@ -94,218 +67,23 @@ export default {
     moreParameters() {
       return []
     },
-    formItems() {
-      return [{
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', disabled: true },
-        formItemAttributes: {
-          label: '所属商户',
-          prop: 'companyName',
-          rules: [...required]
-        },
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'slot-component',
-        attributes: { },
-        formItemAttributes: {
-          label: '状态',
-          prop: 'stateEnum',
-          rules: [...required]
-        },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<el-radio-group v-model={this.formData.stateEnum}>
-				    <el-radio disabled={this.formDialogType==2} label="ON">上架</el-radio>
-				    <el-radio disabled={this.formDialogType==2} label="OFF">下架</el-radio>
-				</el-radio-group>
-			)
-		}
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入配件名称', },
-        formItemAttributes: {
-          label: '配件名称',
-          prop: 'goodsName',
-          rules: [...required]
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-select',
-		options: [],
-        attributes: { placeholder: '请选择单位' },
-        formItemAttributes: {
-          label: '单位',
-          prop: 'partsUnitName',
-          rules: [...required]
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入配件代码' },
-        formItemAttributes: {
-          label: '配件代码',
-          prop: 'goodsCode',
-          rules: [...required]
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'slot-component',
-        attributes: {},
-        formItemAttributes: {
-          label: '收费类型',
-          prop: 'venderType',
-          rules: [...required]
-        },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<el-radio-group v-model={this.formData.venderType}>
-				    <el-radio disabled={this.formDialogType==2} label="P">配件物料</el-radio>
-					<el-radio disabled={this.formDialogType==2} label="A">服务收费</el-radio>
-				</el-radio-group>
-			)
-		}
-      }, {
-        md: 24,
-        isShow: true,
-        name: 'el-radio',
-        attributes: {},
-		options: [{
-			label: `通用`,
-			value: "通用"
-		},
-		{
-			label: `格力`,
-			value: "格力"
-		},{
-			label: `美的`,
-			value: "美的"
-		},
-		{
-			label: `海尔`,
-			value: "海尔"
-		},
-		{
-			label: `华凌`,
-			value: "华凌"
-		}],
-        formItemAttributes: {
-          label: '适用品牌',
-          prop: 'address',
-          rules: [...required]
-        }
-      }, {
-        md: 24,
-        isShow: true,
-        name: 'el-radio',
-        attributes: {},
-		options: [{
-			label: `通用`,
-			value: "通用"
-		},
-		{
-			label: `家用空调`,
-			value: "家用空调"
-		}],
-        formItemAttributes: {
-          label: '适用产品大类',
-          prop: 'zipNo',
-          rules: [...required]
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', type: 'number' },
-        formItemAttributes: {
-          label: '销售价格',
-          prop: 'www',
-          rules: [...required]
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', type: 'number' },
-        formItemAttributes: {
-          label: '收费标准',
-          prop: 'email',
-          rules: [...email]
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', type: 'number' },
-        formItemAttributes: {
-          label: '自有库存师傅分账金额',
-          prop: 'telNo',
-          rules: [...required]
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', type: 'number' },
-        formItemAttributes: {
-          label: '外购辅材师傅分账金额',
-          prop: 'faxNo',
-          rules: [...required]
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', type: 'number' },
-        formItemAttributes: {
-          label: '自有库存网点分账金额',
-          prop: 'telNo',
-          rules: [...required]
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', type: 'number' },
-        formItemAttributes: {
-          label: '外购辅材网点分账金额',
-          prop: 'faxNo',
-          rules: [...required]
-        }
-      }, {
-        md: 24,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入备注内容',type: "textarea", rows: 5 },
-        formItemAttributes: {
-          label: '备注',
-          prop: 'remark',
-          rules: []
-        }
-      }]
-    }
+    formItems() {}
   },
   methods: {
 	// 切换状态
 	changeType(val) {
 	  this.$refs.pageRef.refreshList()
 	},
+	backList() {
+		this.id = ''
+		this.formDialog = false;
+		this.getList()
+	},
     // 列表请求函数
 	getList(p) {
 	  try {
 	    var pam = JSON.parse(JSON.stringify(p))
-	    if (this.examineStatus) {
-	      pam.params.push({ "param": "b.examine_status", "compare": "=", "value": this.examineStatus })
-	    }
+	    pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'P' },{ "param": "a.type", "compare": "=", "value": 'NEW' },{'param': 'a.flag', "compare": "=", "value": this.flag})
 	    return listPageV2(pam)
 	  } catch (error) {
 	    console.log(error)
@@ -335,14 +113,9 @@ export default {
       return (
         <div class='operation-btns'>
 		  <el-button type="text" onClick={() => {
-		    getDetail({ id: row.venderId }).then(res => {
-		      Object.assign(this.formData, res.data,{
-				  imageUrl:res.data?.imageUrl?  res.data?.imageUrl?.split(",").map(item=>({url:item})) : []
-			  })
-			   console.log(this.formData)
-		      this.formDialogType = 1
-		      this.openForm()
-		    })
+				this.id = row.partsRetId
+		    this.formDialogType = 1
+		    this.openForm()
 		  }}>编辑</el-button>
         </div>
       )
@@ -354,48 +127,6 @@ export default {
     openForm() {
       this.formDialog = true;
     },
-    formCancel() {
-      this.$refs.formRef.$refs.inlineForm.clearValidate()
-      this.$data.formData = this.$options.data().formData
-      this.formDialog = false
-    },
-	updateStatus(stateEnum){
-		if(this.recordSelected.length == 0){
-			return this.$message.warning('请至少勾选一条数据!');
-		}
-		console.log(this.recordSelected)
-		this.$confirm(`请确认是否${stateEnum=='OFF'?'下架':'上架'}该配件, 是否继续?`, '提示', {
-			confirmButtonText: '确定',
-			cancelButtonText: '取消',
-			type: 'warning'
-		}).then(() => {
-			memberInner({
-				stateEnum,
-				ids: this.recordSelected.map(item=>{return item.goodsId}).join(',')
-			}).then(res => {
-				if (res.code == 200) {
-					this.$message({ type: 'success', message: `${stateEnum=='ON'?'下架':'上架'}成功!` })
-					this.$refs.pageRef.refreshList()
-				} else {
-					this.$message.error(res.msg);
-				}
-			})
-		});
-	},
-    formConfirm() {
-      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
-        if (valid) {
-          ([add, edit][this.formDialogType])({
-			  ...this.formData,
-			  imageUrl:this.formData.imageUrl.map(item=>item.url).join(",")
-		  }).then(res => {
-            this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
-            this.formCancel()
-            this.$refs.pageRef.refreshList()
-          })
-        }
-      })
-    },
 	// 下载导入模版
 	handleDownload() {
 	  // downloadFiles('charging/standard/download');
@@ -405,6 +136,9 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+	.page{
+		height: 100%;
+	}
 	.tab{
 		padding: 20px 20px 0 20px;
 	}

+ 139 - 2
src/views/auxiliaryFittings/salesManagement/attachmentOldReturn/index.vue

@@ -1,8 +1,145 @@
 <template>
+	<div class="page">
+		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="50"
+		  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
+		  :operation="operation" :exportList="exportList">
+		  
+		  <div slot="moreSearch">
+		    <el-radio-group v-model="flag" size="mini" @change="changeType">
+		    	<el-radio-button label="">全部</el-radio-button>
+		    	<el-radio-button label="SUBMIT">待收货</el-radio-button>
+		    	<el-radio-button label="OK">已收货</el-radio-button>
+		    </el-radio-group>
+		    <br><br>
+		  </div>
+		</template-page>
+		<div class="detail" v-if="formDialog">
+			<attachmentOldReturnDetail :id="id" @back="backList" :formType="formDialogType" :title="'配件旧件返还' + formDialogTitles[formDialogType]"></attachmentOldReturnDetail>
+		</div>
+	</div>
 </template>
 
 <script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import attachmentOldReturnDetail from '../components/attachmentOldReturnDetail.vue'
+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/attachmentNewReturn";
+export default {
+  components: { TemplatePage, ImageUpload, attachmentOldReturnDetail },
+  mixins: [import_mixin],
+  data() {
+    return {
+      // 事件组合
+      optionsEvensGroup: [
+	  	[
+	  		[
+	  			{
+	  				name: '新建',
+	  				click: this.addData
+	  			}
+	  		]
+	  	]
+	  ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ["新增","编辑", "详情"],
+      formDialog: false,
+		id: '',
+		flag: ''
+    }
+  },
+  computed: {
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {}
+  },
+  methods: {
+	// 切换状态
+	changeType(val) {
+	  this.$refs.pageRef.refreshList()
+	},
+	backList() {
+		this.id = ''
+		this.formDialog = false;
+		this.getList()
+	},
+    // 列表请求函数
+	getList(p) {
+	  try {
+	    var pam = JSON.parse(JSON.stringify(p))
+	    pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'P' },{ "param": "a.type", "compare": "=", "value": 'OLD' },{'param': 'a.flag', "compare": "=", "value": this.flag})
+	    return listPageV2(pam)
+	  } catch (error) {
+	    console.log(error)
+	  }
+	},
+    // 列表导出函数
+    exportList: pageExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+		if (item.jname === 'idCardImg') {
+		        defaultData.render = (h, { row, index, column }) => {
+		          return (
+		            <div style="padding:0 6px;cursor: pointer;">
+		              {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+		            </div>
+		          )
+		        }
+		      }
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    // 表格操作列
+    operation(h, { row, index, column }) {
+      return (
+        <div class='operation-btns'>
+		  <el-button type="text" onClick={() => {
+				this.id = row.partsRetId
+		    this.formDialogType = 1
+		    this.openForm()
+		  }}>编辑</el-button>
+        </div>
+      )
+    },
+    addData() {
+      this.formDialogType = 0
+      this.openForm()
+    },
+    openForm() {
+      this.formDialog = true;
+    },
+	// 下载导入模版
+	handleDownload() {
+	  // downloadFiles('charging/standard/download');
+	},
+  }
+}
 </script>
 
-<style>
-</style>
+<style lang="scss" scoped>
+	.page{
+		height: 100%;
+	}
+	.tab{
+		padding: 20px 20px 0 20px;
+	}
+</style>

+ 5 - 5
src/views/auxiliaryFittings/salesManagement/auxiliarySalesReturnOrder/index.vue

@@ -14,7 +14,7 @@
 		  </div>
 		</template-page>
 		<div class="detail" v-if="formDialog">
-			<auxiliarySalesReturnOrderDetail :id="id" @back="backList" :formType="formDialogType" :title="'辅材销售单' + formDialogTitles[formDialogType]"></auxiliarySalesReturnOrderDetail>
+			<auxiliarySalesReturnOrderDetail :id="id" @back="backList" :formType="formDialogType" :title="'辅材销售退货单' + formDialogTitles[formDialogType]"></auxiliarySalesReturnOrderDetail>
 		</div>
 	</div>
 </template>
@@ -83,7 +83,7 @@ export default {
 	getList(p) {
 	  try {
 	    var pam = JSON.parse(JSON.stringify(p))
-	    pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'M' },{'param': 'a.retState', "compare": "=", "value": this.retState})
+	    pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'M' },{'param': 'a.ret_state', "compare": "=", "value": this.retState})
 	    return listPageV2(pam)
 	  } catch (error) {
 	    console.log(error)
@@ -113,10 +113,10 @@ export default {
       return (
         <div class='operation-btns'>
 		  <el-button type="text" onClick={() => {
-				this.id = row.salesId
-		    this.formDialogType = 1
+				this.id = row.salesRetId
+		    this.formDialogType = row.retState == 'OK'?2:1
 		    this.openForm()
-		  }}>编辑</el-button>
+		  }}>{row.retState == 'OK'?'详情':'编辑'}</el-button>
         </div>
       )
     },

+ 479 - 0
src/views/auxiliaryFittings/salesManagement/components/attachmentNewReturnDetail.vue

@@ -0,0 +1,479 @@
+<template>
+	<div class="s-page">
+		<el-page-header @back="goBack" :content="title"></el-page-header>
+		<el-divider></el-divider>
+		<el-card class="box-card">
+			<div slot="header" class="clearfix">
+				<span>单据信息</span>
+			</div>
+			<div class="mymain-container">
+				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
+					<el-row :gutter="20" justify="start">
+						<el-col :span="8" v-if="id">
+							<el-form-item label="单据状态">
+								<el-input type="text" :value="formData.flag == 'SAVE'?'保存':formData.flag == 'SUBMIT'?'已提交':formData.flag == 'OK'?'确认收货':''" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="8" v-if="id">
+							<el-form-item label="单据编号">
+								<el-input type="text" :value="formData.partsRetId" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="8">
+							<el-form-item label="所属商户" :required="true" >
+								<el-input type="text" :value="companyName" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="12">
+							<el-form-item label="网点名称" prop="websitId" :required="true">
+								<el-select v-model="formData.websit" value-key="websitId" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
+								    <el-option
+								      v-for="item in websitList"
+								      :key="item.websitId"
+								      :label="item.name"
+								      :value="item">
+								    </el-option>
+								  </el-select>
+							</el-form-item>
+						</el-col>
+						<el-col :span="8">
+							<el-form-item label="师傅姓名" prop="worker" :required="true">
+								<el-select v-model="formData.worker" value-key="nickName" @focus="()=>{
+									if(!this.formData.websitId){return this.$message.warning('请先选择网点名称!');}
+								}" filterable @change="changeWorker" @blur="workerBlur" placeholder="请选择" style="width: 100%;">
+								    <el-option
+								      v-for="item in workerList"
+								      :key="item.id"
+								      :label="item.nickName"
+								      :value="item">
+								    </el-option>
+								  </el-select>
+							</el-form-item>
+						</el-col>
+						<el-col :span="8">
+							<el-form-item label="师傅身份证" prop="idcard" :required="true">
+								<el-input type="text" v-model="formData.idcard" placeholder="请输入"></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="8">
+							<el-form-item label="师傅联系电话" prop="phone" :required="true">
+								<el-input type="text" v-model="formData.phone" placeholder="请输入"></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6">
+							<el-form-item label="销售订单号" :required="true">
+								<el-input type="text" v-model="formData.salesId" @change="getDetail" placeholder="请输入销售订单号"></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6">
+							<el-form-item label="销售金额">
+								<el-input type="text" :value="salesDetail.createBy" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6">
+							<el-form-item label="时间">
+								<el-input type="text" :value="salesDetail.createBy" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="制单人">
+								<el-input type="text" :value="formData.createBy" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="制单时间">
+								<el-input type="text" :value="formData.createTime" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="审核人">
+								<el-input type="text" :value="formData.confirmBy" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="审核时间">
+								<el-input type="text" :value="formData.confirmTime" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="24">
+							<el-form-item label="附件">
+								<ImageUpload :fileList="formData.file_url" :limit="1" :isEdit="formType !== 2" />
+							</el-form-item>
+						</el-col>
+						<el-col :span="24">
+							<el-form-item label="备注">
+								<el-input type="textarea" :rows="4" v-model="formData.remark" placeholder="请输入"></el-input>
+							</el-form-item>
+						</el-col>
+					</el-row>
+				</el-form>
+			</div>
+		</el-card>
+		<el-card class="box-card">
+			<div slot="header" class="clearfix">
+				<span>配件信息</span>
+			</div>
+			<!-- <el-button size="small" type="primary" @click="add()">添加</el-button> -->
+			<div class="table">
+				<el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+					<el-table-column label="配件名称" align="center">
+						<template slot-scope="scope">
+							<el-select v-model="scope.row.goods" @change="changeGoods" value-key="goodsId" :disabled="isEdit != scope.$index" placeholder="请选择" style="width: 100%;">
+							    <el-option
+							      v-for="item in scope.row.goodsList"
+							      :key="item.goodsId"
+							      :label="item.goodsName"
+							      :value="item">
+							    </el-option>
+							  </el-select>
+						</template>
+					</el-table-column>
+					<el-table-column prop="goods.goodsSalesUnit" align="center" label="单位" ></el-table-column>
+					<el-table-column prop="" align="center" label="数量" >
+						<template slot-scope="scope">
+							<el-input type="number" v-model="scope.row.salesQty" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
+						</template>
+					</el-table-column>
+					<el-table-column prop="goods.goodsCode" align="center" label="配件编码"></el-table-column>
+					<el-table-column prop="goods.brandRelaName" align="center" label="适用品牌"></el-table-column>
+					<el-table-column prop="goods.productRelaName" align="center" label="适用产品大类"></el-table-column>
+					<el-table-column prop="goods.price" align="center" label="销售价格"></el-table-column>
+					<el-table-column prop="goods.saleAmount" align="center" label="销售金额" ></el-table-column>
+					<!-- <el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column> -->
+					<el-table-column prop="" align="center" label="退款金额" >
+						<template slot-scope="scope">
+							<el-input type="number" v-model="scope.row.refundAmount" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
+						</template>
+					</el-table-column>
+					<el-table-column label="操作" align="right" width="140">
+						<template slot-scope="scope">
+							<el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index">编辑</el-button>
+							<el-button size="mini" type="danger" @click="dataList.splice(scope.$index,1)">删除</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+			</div>
+		</el-card>
+		<div class="page-footer">
+			<div class="footer">
+				<el-button v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')" size="small" type="primary" @click="save()">保存</el-button>
+				<el-button v-if="formData.flag == 'SUBMIT'" size="small" type="primary"  @click="confirm()">确认收货</el-button>
+				<el-button size="small" type="info" @click="goBack">返回</el-button>
+			</div>
+		</div>
+		<el-dialog title="微信支付" :visible.sync="isPay" width="50%" :close-on-click-modal="false" :modal-append-to-body="false" @close="payCodeUrl = ''">
+			<h3>扫二维码支付</h3>
+			<el-image :src="payCodeUrl" fit="fit"></el-image>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+	import { getWebsit } from "@/api/customerManagement";
+	import ImageUpload from '@/components/file-upload'
+	import { getWorker, getCategory, getGoods, getDetail } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+	import { add, edit, getNewDetail } from "@/api/auxiliaryFittings/attachmentNewReturn";
+	export default {
+		components: { ImageUpload },
+		props: ['id','title','formType'],
+		data() {
+			return {
+				dataList: [],
+				websitList: [],
+				workerList: [],
+				mainList: [],
+				isPay: false,
+				payCodeUrl: '',
+				salesDetail: {},
+				formData: {
+					websit: {},
+					websitId: '',
+					websitName: '',
+					file_url: [],
+					salesId: '',
+					partsRetId: '',
+					flag: '',
+					createBy: '',
+					createTime: '',
+					confirmBy: '',
+					confirmTime: '',
+					worker: {},
+					workerName: '',
+					workerId: '',
+					idcard: '',
+					phone: ''
+				},
+				isEdit: 0,
+				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+				rules: {
+					websitId: [
+						{ required: true, message: '请选择网点', trigger: 'change' }
+					],
+					worker: [
+						{ required: true, message: '请选择师傅', trigger: 'change' }
+					],
+					idcard: [
+						{ required: true, message: '请输入师傅身份证', trigger: 'blur' },
+					],
+					phone: [
+						{ required: true, message: '请输入师傅联系电话', trigger: 'blur' },
+					],
+				}
+			};
+		},
+		computed: {},
+		created() {
+			if(this.id){
+				this.getNewDetail()
+			}
+			this.getWebsit()
+		},
+		methods: {
+			// 返回
+			goBack() {
+				this.$emit('back');
+			},
+			getDetail(salesId){
+				const that = this
+				getDetail({salesId}).then(res => {
+					this.formData.flag = res.data.flag
+					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
+					this.formData.websitId = res.data.websitId
+					this.formData.websitName = res.data.websitName
+					this.getWorker()
+					this.formData.salesId = res.data.salesId
+					this.formData.createBy = res.data.createBy
+					this.formData.createTime = res.data.createTime
+					this.formData.confirmBy = res.data.confirmBy
+					this.formData.confirmTime = res.data.confirmTime
+					this.formData.worker = {nickName: res.data.workerName,userId: res.data.workerId}
+					this.formData.workerName = res.data.workerName
+					this.formData.workerId = res.data.workerId
+					this.formData.idcard = res.data.identity
+					this.formData.phone = res.data.workerMobile
+					this.formData.remark = res.data.remark
+					res.data.items.forEach(item=>{
+						that.getGoods(item.goodsName,1).then(ress => {
+							item.goods = {...ress.data,oldPrice:ress.data.price}
+							item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
+						})
+					})
+					setTimeout(()=>{
+						this.dataList = res.data.items
+					},200)
+					console.log(this.dataList)
+				})
+			},
+			getNewDetail(){
+				const that = this
+				getNewDetail({id: this.id}).then(res => {
+					this.formData.flag = res.data.flag
+					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
+					this.formData.websitId = res.data.websitId
+					this.formData.websitName = res.data.websitName
+					this.getWorker()
+					this.formData.salesId = res.data.salesId
+					this.formData.partsRetId = res.data.partsRetId
+					this.formData.createBy = res.data.createBy
+					this.formData.createTime = res.data.createTime
+					this.formData.confirmBy = res.data.confirmBy
+					this.formData.confirmTime = res.data.confirmTime
+					this.formData.worker = {nickName: res.data.workerName,userId: res.data.workerId}
+					this.formData.workerName = res.data.workerName
+					this.formData.workerId = res.data.workerId
+					this.formData.idcard = res.data.identity
+					this.formData.phone = res.data.workerMobile
+					this.formData.remark = res.data.remark
+					res.data.websitPartsRetItemList.forEach(item=>{
+						that.getGoods(item.goodsName,1).then(ress => {
+							item.goods = {...ress.data,oldPrice:ress.data.price}
+							item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
+						})
+					})
+					setTimeout(()=>{
+						this.dataList = res.data.websitPartsRetItemList
+					},200)
+					console.log(this.dataList)
+				})
+			},
+			getWebsit(){
+				getWebsit({type: 'C'}).then(res => {
+					this.websitList = res.data
+				})
+			},
+			changeWebsit(e){
+				this.formData.websitId = e.websitId
+				this.formData.websitName = e.name
+				this.getWorker()
+				this.getCategory(e.websitId)
+			},
+			async getGoods(goodsName,type){
+				const that = this
+				if(type == 1){
+					return new Promise((resolve, reject) => {
+						getGoods({websitId: this.formData.websitId,type: 'P',goodsName: goodsName}).then(res => {
+							resolve({
+								data: res.data[0]
+							})
+						})
+					})
+				}else{
+					getGoods({websitId: this.formData.websitId,type: 'P'}).then(res => {
+						that.dataList[that.isEdit].goodsList = res.data
+						console.log(this.dataList)
+					})
+				}
+			},
+			getWorker(){
+				getWorker({pageNum: 1,pageSize: -1,params: [{param: 'b.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
+					this.workerList = res.data.records
+				})
+			},
+			changeWorker(e){
+				this.formData.idcard = e.idCard
+				this.formData.phone = e.mobile
+				this.formData.workerId = e.userId
+				this.formData.workerName = e.nickName
+			},
+			workerBlur(e){
+				this.formData.worker = e.target.value
+				this.$forceUpdate()
+			},
+			changeGoods(e){
+				console.log(e)
+				this.dataList[this.isEdit].goodsId = e.goodsId
+				this.dataList[this.isEdit].goodsName = e.goodsName
+				this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
+				this.dataList[this.isEdit].brandRelaName = e.brandRelaName
+				this.dataList[this.isEdit].productRelaName = e.productRelaName
+				this.dataList[this.isEdit].price = e.price
+				this.dataList[this.isEdit].goodsCode = e. goodsCode
+				this.dataList[this.isEdit].qty = e.qty
+			},
+			add(){
+				this.dataList.push({
+					goodsList: [],
+					goods: {},
+					goodsId: '',
+					goodsName: '',
+					goodsSalesUnit: '',
+					brandRelaName: '',
+					productRelaName: '',
+					goodsCode: '',
+					price: '',
+					refundAmount: '',
+					saleAmount: '',
+					salesQty: 1,
+					qty: '',
+					goodsType: 'P'
+				})
+			},
+			confirm(){
+				this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					edit({
+						flag: 'OK',
+						partsRetId: this.formData.partsRetId,
+					}).then(res => {
+						if(res.code == 200){
+							this.$message.success('确认提货成功!')
+							this.goBack()
+						}
+					})
+				});
+			},
+			save(){
+				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+					if (valid) {
+						if(this.formType == 0){
+							add({
+								salesId: this.formData.salesId,
+								goodsType: 'P',
+								type: 'NEW',
+								remark: this.formData.remark,
+								websitId: this.formData.websitId,
+								websitName: this.formData.websitName,
+								workerName: this.formData.workerName,
+								workerId: this.formData.workerId,
+								identity: this.formData.idcard,
+								workerMobile: this.formData.phone,
+								websitPartsRetItems: this.dataList,
+								file_url: this.formData.file_url.map(item=>item.url).join(","),
+							}).then(res => {
+								if(res.code == 200){
+									this.$message.success('提交成功!')
+									this.goBack()
+								}
+							})
+						}else if(this.formType == 1){
+							edit({
+								salesId: this.formData.salesId,
+								partsRetId: this.formData.partsRetId,
+								goodsType: 'P',
+								type: 'NEW',
+								remark: this.formData.remark,
+								websitId: this.formData.websitId,
+								websitName: this.formData.websitName,
+								workerName: this.formData.workerName,
+								workerId: this.formData.workerId,
+								identity: this.formData.idcard,
+								workerMobile: this.formData.phone,
+								websitPartsRetItems: this.dataList,
+								file_url: this.formData.file_url.map(item=>item.url).join(","),
+							}).then(res => {
+								if(res.code == 200){
+									this.dataList = []
+									this.$message.success('提交成功!')
+									this.goBack()
+								}
+							})
+						}
+					}
+				})
+			}
+		}
+	};
+</script>
+
+<style scoped="scoped" lang="scss">
+	.s-page {
+		padding: 20px;
+		background-color: #ffffff;
+	}
+	.page-footer {
+		height: 70px;
+	}
+	
+	.footer {
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		z-index: 1;
+		width: 100%;
+		background: #fff;
+		padding: 15px 40px;
+		box-sizing: border-box;
+		transition: all 0.28s;
+		text-align: right;
+		box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
+	
+		&.hideSidebar {
+			margin-left: 54px;
+			width: calc(100vw - 54px);
+		}
+	
+		&.openSidebar {
+			margin-left: 210px;
+			width: calc(100vw - 210px);
+		}
+	
+		.tips {
+			font-size: 12px;
+			color: red;
+			margin-top: 10px;
+		}
+	}
+</style>

+ 479 - 0
src/views/auxiliaryFittings/salesManagement/components/attachmentOldReturnDetail.vue

@@ -0,0 +1,479 @@
+<template>
+	<div class="s-page">
+		<el-page-header @back="goBack" :content="title"></el-page-header>
+		<el-divider></el-divider>
+		<el-card class="box-card">
+			<div slot="header" class="clearfix">
+				<span>单据信息</span>
+			</div>
+			<div class="mymain-container">
+				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
+					<el-row :gutter="20" justify="start">
+						<el-col :span="8" v-if="id">
+							<el-form-item label="单据状态">
+								<el-input type="text" :value="formData.flag == 'SAVE'?'保存':formData.flag == 'SUBMIT'?'已提交':formData.flag == 'OK'?'确认收货':''" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="8" v-if="id">
+							<el-form-item label="单据编号">
+								<el-input type="text" :value="formData.partsRetId" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="8">
+							<el-form-item label="所属商户" :required="true" >
+								<el-input type="text" :value="companyName" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="12">
+							<el-form-item label="网点名称" prop="websitId" :required="true">
+								<el-select v-model="formData.websit" value-key="websitId" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
+								    <el-option
+								      v-for="item in websitList"
+								      :key="item.websitId"
+								      :label="item.name"
+								      :value="item">
+								    </el-option>
+								  </el-select>
+							</el-form-item>
+						</el-col>
+						<el-col :span="8">
+							<el-form-item label="师傅姓名" prop="worker" :required="true">
+								<el-select v-model="formData.worker" value-key="nickName" @focus="()=>{
+									if(!this.formData.websitId){return this.$message.warning('请先选择网点名称!');}
+								}" filterable @change="changeWorker" @blur="workerBlur" placeholder="请选择" style="width: 100%;">
+								    <el-option
+								      v-for="item in workerList"
+								      :key="item.id"
+								      :label="item.nickName"
+								      :value="item">
+								    </el-option>
+								  </el-select>
+							</el-form-item>
+						</el-col>
+						<el-col :span="8">
+							<el-form-item label="师傅身份证" prop="idcard" :required="true">
+								<el-input type="text" v-model="formData.idcard" placeholder="请输入"></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="8">
+							<el-form-item label="师傅联系电话" prop="phone" :required="true">
+								<el-input type="text" v-model="formData.phone" placeholder="请输入"></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6">
+							<el-form-item label="销售订单号" :required="true">
+								<el-input type="text" v-model="formData.salesId" @change="getDetail" placeholder="请输入销售订单号"></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6">
+							<el-form-item label="销售金额">
+								<el-input type="text" :value="salesDetail.createBy" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6">
+							<el-form-item label="时间">
+								<el-input type="text" :value="salesDetail.createBy" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="制单人">
+								<el-input type="text" :value="formData.createBy" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="制单时间">
+								<el-input type="text" :value="formData.createTime" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="审核人">
+								<el-input type="text" :value="formData.confirmBy" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="审核时间">
+								<el-input type="text" :value="formData.confirmTime" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="24">
+							<el-form-item label="附件">
+								<ImageUpload :fileList="formData.file_url" :limit="1" :isEdit="formType !== 2" />
+							</el-form-item>
+						</el-col>
+						<el-col :span="24">
+							<el-form-item label="备注">
+								<el-input type="textarea" :rows="4" v-model="formData.remark" placeholder="请输入"></el-input>
+							</el-form-item>
+						</el-col>
+					</el-row>
+				</el-form>
+			</div>
+		</el-card>
+		<el-card class="box-card">
+			<div slot="header" class="clearfix">
+				<span>配件信息</span>
+			</div>
+			<!-- <el-button size="small" type="primary" @click="add()">添加</el-button> -->
+			<div class="table">
+				<el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+					<el-table-column label="配件名称" align="center">
+						<template slot-scope="scope">
+							<el-select v-model="scope.row.goods" @change="changeGoods" value-key="goodsId" :disabled="isEdit != scope.$index" placeholder="请选择" style="width: 100%;">
+							    <el-option
+							      v-for="item in scope.row.goodsList"
+							      :key="item.goodsId"
+							      :label="item.goodsName"
+							      :value="item">
+							    </el-option>
+							  </el-select>
+						</template>
+					</el-table-column>
+					<el-table-column prop="goods.goodsSalesUnit" align="center" label="单位" ></el-table-column>
+					<el-table-column prop="" align="center" label="数量" >
+						<template slot-scope="scope">
+							<el-input type="number" v-model="scope.row.retQty" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
+						</template>
+					</el-table-column>
+					<el-table-column prop="goods.goodsCode" align="center" label="配件编码"></el-table-column>
+					<el-table-column prop="goods.brandRelaName" align="center" label="适用品牌"></el-table-column>
+					<el-table-column prop="goods.productRelaName" align="center" label="适用产品大类"></el-table-column>
+					<el-table-column prop="goods.price" align="center" label="销售价格"></el-table-column>
+					<el-table-column prop="goods.saleAmount" align="center" label="销售金额" ></el-table-column>
+					<!-- <el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column> -->
+					<el-table-column prop="" align="center" label="退款金额" >
+						<template slot-scope="scope">
+							<el-input type="number" v-model="scope.row.refundAmount" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
+						</template>
+					</el-table-column>
+					<el-table-column label="操作" align="right" width="140">
+						<template slot-scope="scope">
+							<el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index">编辑</el-button>
+							<el-button size="mini" type="danger" @click="dataList.splice(scope.$index,1)">删除</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+			</div>
+		</el-card>
+		<div class="page-footer">
+			<div class="footer">
+				<el-button v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')" size="small" type="primary" @click="save()">保存</el-button>
+				<el-button v-if="formData.flag == 'SUBMIT'" size="small" type="primary"  @click="confirm()">确认收货</el-button>
+				<el-button size="small" type="info" @click="goBack">返回</el-button>
+			</div>
+		</div>
+		<el-dialog title="微信支付" :visible.sync="isPay" width="50%" :close-on-click-modal="false" :modal-append-to-body="false" @close="payCodeUrl = ''">
+			<h3>扫二维码支付</h3>
+			<el-image :src="payCodeUrl" fit="fit"></el-image>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+	import { getWebsit } from "@/api/customerManagement";
+	import ImageUpload from '@/components/file-upload'
+	import { getWorker, getCategory, getGoods, getDetail } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+	import { add, edit, getNewDetail } from "@/api/auxiliaryFittings/attachmentNewReturn";
+	export default {
+		components: { ImageUpload },
+		props: ['id','title','formType'],
+		data() {
+			return {
+				dataList: [],
+				websitList: [],
+				workerList: [],
+				mainList: [],
+				isPay: false,
+				payCodeUrl: '',
+				salesDetail: {},
+				formData: {
+					websit: {},
+					websitId: '',
+					websitName: '',
+					file_url: [],
+					salesId: '',
+					partsRetId: '',
+					flag: '',
+					createBy: '',
+					createTime: '',
+					confirmBy: '',
+					confirmTime: '',
+					worker: {},
+					workerName: '',
+					workerId: '',
+					idcard: '',
+					phone: ''
+				},
+				isEdit: 0,
+				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+				rules: {
+					websitId: [
+						{ required: true, message: '请选择网点', trigger: 'change' }
+					],
+					worker: [
+						{ required: true, message: '请选择师傅', trigger: 'change' }
+					],
+					idcard: [
+						{ required: true, message: '请输入师傅身份证', trigger: 'blur' },
+					],
+					phone: [
+						{ required: true, message: '请输入师傅联系电话', trigger: 'blur' },
+					],
+				}
+			};
+		},
+		computed: {},
+		created() {
+			if(this.id){
+				this.getNewDetail()
+			}
+			this.getWebsit()
+		},
+		methods: {
+			// 返回
+			goBack() {
+				this.$emit('back');
+			},
+			getDetail(salesId){
+				const that = this
+				getDetail({salesId}).then(res => {
+					this.formData.flag = res.data.flag
+					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
+					this.formData.websitId = res.data.websitId
+					this.formData.websitName = res.data.websitName
+					this.getWorker()
+					this.formData.salesId = res.data.salesId
+					this.formData.createBy = res.data.createBy
+					this.formData.createTime = res.data.createTime
+					this.formData.confirmBy = res.data.confirmBy
+					this.formData.confirmTime = res.data.confirmTime
+					this.formData.worker = {nickName: res.data.workerName,userId: res.data.workerId}
+					this.formData.workerName = res.data.workerName
+					this.formData.workerId = res.data.workerId
+					this.formData.idcard = res.data.identity
+					this.formData.phone = res.data.workerMobile
+					this.formData.remark = res.data.remark
+					res.data.items.forEach(item=>{
+						that.getGoods(item.goodsName,1).then(ress => {
+							item.goods = {...ress.data,oldPrice:ress.data.price}
+							item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
+						})
+					})
+					setTimeout(()=>{
+						this.dataList = res.data.items
+					},200)
+					console.log(this.dataList)
+				})
+			},
+			getNewDetail(){
+				const that = this
+				getNewDetail({id: this.id}).then(res => {
+					this.formData.flag = res.data.flag
+					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
+					this.formData.websitId = res.data.websitId
+					this.formData.websitName = res.data.websitName
+					this.getWorker()
+					this.formData.salesId = res.data.salesId
+					this.formData.partsRetId = res.data.partsRetId
+					this.formData.createBy = res.data.createBy
+					this.formData.createTime = res.data.createTime
+					this.formData.confirmBy = res.data.confirmBy
+					this.formData.confirmTime = res.data.confirmTime
+					this.formData.worker = {nickName: res.data.workerName,userId: res.data.workerId}
+					this.formData.workerName = res.data.workerName
+					this.formData.workerId = res.data.workerId
+					this.formData.idcard = res.data.identity
+					this.formData.phone = res.data.workerMobile
+					this.formData.remark = res.data.remark
+					res.data.websitPartsRetItemList.forEach(item=>{
+						that.getGoods(item.goodsName,1).then(ress => {
+							item.goods = {...ress.data,oldPrice:ress.data.price}
+							item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
+						})
+					})
+					setTimeout(()=>{
+						this.dataList = res.data.websitPartsRetItemList
+					},200)
+					console.log(this.dataList)
+				})
+			},
+			getWebsit(){
+				getWebsit({type: 'C'}).then(res => {
+					this.websitList = res.data
+				})
+			},
+			changeWebsit(e){
+				this.formData.websitId = e.websitId
+				this.formData.websitName = e.name
+				this.getWorker()
+				this.getCategory(e.websitId)
+			},
+			async getGoods(goodsName,type){
+				const that = this
+				if(type == 1){
+					return new Promise((resolve, reject) => {
+						getGoods({websitId: this.formData.websitId,type: 'P',goodsName: goodsName}).then(res => {
+							resolve({
+								data: res.data[0]
+							})
+						})
+					})
+				}else{
+					getGoods({websitId: this.formData.websitId,type: 'P'}).then(res => {
+						that.dataList[that.isEdit].goodsList = res.data
+						console.log(this.dataList)
+					})
+				}
+			},
+			getWorker(){
+				getWorker({pageNum: 1,pageSize: -1,params: [{param: 'b.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
+					this.workerList = res.data.records
+				})
+			},
+			changeWorker(e){
+				this.formData.idcard = e.idCard
+				this.formData.phone = e.mobile
+				this.formData.workerId = e.userId
+				this.formData.workerName = e.nickName
+			},
+			workerBlur(e){
+				this.formData.worker = e.target.value
+				this.$forceUpdate()
+			},
+			changeGoods(e){
+				console.log(e)
+				this.dataList[this.isEdit].goodsId = e.goodsId
+				this.dataList[this.isEdit].goodsName = e.goodsName
+				this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
+				this.dataList[this.isEdit].brandRelaName = e.brandRelaName
+				this.dataList[this.isEdit].productRelaName = e.productRelaName
+				this.dataList[this.isEdit].price = e.price
+				this.dataList[this.isEdit].goodsCode = e. goodsCode
+				this.dataList[this.isEdit].qty = e.qty
+			},
+			add(){
+				this.dataList.push({
+					goodsList: [],
+					goods: {},
+					goodsId: '',
+					goodsName: '',
+					goodsSalesUnit: '',
+					brandRelaName: '',
+					productRelaName: '',
+					goodsCode: '',
+					price: '',
+					refundAmount: '',
+					saleAmount: '',
+					salesQty: 1,
+					qty: '',
+					goodsType: 'P'
+				})
+			},
+			confirm(){
+				this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					edit({
+						flag: 'OK',
+						partsRetId: this.formData.partsRetId,
+					}).then(res => {
+						if(res.code == 200){
+							this.$message.success('确认提货成功!')
+							this.goBack()
+						}
+					})
+				});
+			},
+			save(){
+				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+					if (valid) {
+						if(this.formType == 0){
+							add({
+								salesId: this.formData.salesId,
+								goodsType: 'P',
+								type: 'OLD',
+								remark: this.formData.remark,
+								websitId: this.formData.websitId,
+								websitName: this.formData.websitName,
+								workerName: this.formData.workerName,
+								workerId: this.formData.workerId,
+								identity: this.formData.idcard,
+								workerMobile: this.formData.phone,
+								websitPartsRetItems: this.dataList,
+								file_url: this.formData.file_url.map(item=>item.url).join(","),
+							}).then(res => {
+								if(res.code == 200){
+									this.$message.success('提交成功!')
+									this.goBack()
+								}
+							})
+						}else if(this.formType == 1){
+							edit({
+								salesId: this.formData.salesId,
+								partsRetId: this.formData.partsRetId,
+								goodsType: 'P',
+								type: 'OLD',
+								remark: this.formData.remark,
+								websitId: this.formData.websitId,
+								websitName: this.formData.websitName,
+								workerName: this.formData.workerName,
+								workerId: this.formData.workerId,
+								identity: this.formData.idcard,
+								workerMobile: this.formData.phone,
+								websitPartsRetItems: this.dataList,
+								file_url: this.formData.file_url.map(item=>item.url).join(","),
+							}).then(res => {
+								if(res.code == 200){
+									this.dataList = []
+									this.$message.success('提交成功!')
+									this.goBack()
+								}
+							})
+						}
+					}
+				})
+			}
+		}
+	};
+</script>
+
+<style scoped="scoped" lang="scss">
+	.s-page {
+		padding: 20px;
+		background-color: #ffffff;
+	}
+	.page-footer {
+		height: 70px;
+	}
+	
+	.footer {
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		z-index: 1;
+		width: 100%;
+		background: #fff;
+		padding: 15px 40px;
+		box-sizing: border-box;
+		transition: all 0.28s;
+		text-align: right;
+		box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
+	
+		&.hideSidebar {
+			margin-left: 54px;
+			width: calc(100vw - 54px);
+		}
+	
+		&.openSidebar {
+			margin-left: 210px;
+			width: calc(100vw - 210px);
+		}
+	
+		.tips {
+			font-size: 12px;
+			color: red;
+			margin-top: 10px;
+		}
+	}
+</style>

+ 27 - 5
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesOrderDetail.vue

@@ -110,7 +110,7 @@
 							</el-form-item>
 						</el-col>
 						<el-col :span="3" v-if="formData.payType == 'WECHAT'">
-							<div style="height: 32px;display: flex;align-items: center;cursor: pointer;">微信支付<i class="el-icon-full-screen"></i></div>
+							<div style="height: 32px;display: flex;align-items: center;cursor: pointer;" @click="wxPay()">微信支付<i class="el-icon-full-screen"></i></div>
 						</el-col>
 						<el-col :span="24">
 							<el-form-item label="备注">
@@ -196,14 +196,24 @@
 			</div>
 		</div>
 		<el-dialog title="微信支付" :visible.sync="isPay" width="50%" :close-on-click-modal="false" :modal-append-to-body="false" @close="payCodeUrl = ''">
-			<h3>扫二维码支付</h3>
-			<el-image :src="payCodeUrl" fit="fit"></el-image>
+			<h3 style="text-align: center;">扫二维码支付</h3>
+<!-- 			<el-image :src="payCodeUrl" fit="fit"></el-image> -->
+			<div
+			  ref="payQRCode"
+			  style="display: flex; justify-content: center;"
+			/>
+			<div style="color: #EA8000;text-align: center;margin-top: 20px;">注:支付成功后,方可操作确认提货!</div>
+			<div style="display: flex;justify-content: flex-end;margin-top: 30px;">
+				<el-button size="mini" type="text" @click="isPay = false">取消</el-button>
+				<el-button size="small" type="primary"  @click="isPay = false;getDetail()">确定</el-button>
+			</div>
 		</el-dialog>
 	</div>
 </template>
 
 <script>
 	import { getWebsit } from "@/api/customerManagement";
+	import QRCode from "qrcodejs2";
 	import { getWorker, getCategory, getGoods, getDetail, add, edit, confirm, submit, getCode } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
 	export default {
 		props: ['id','title','formType'],
@@ -434,7 +444,7 @@
 						if(res.code == 200){
 							this.$message.success('提交成功!')
 							if(this.formData.payType == 'WECHAT'){
-								this.isPay = true
+								this.wxPay()
 							}else{
 								this.goBack()
 							}
@@ -463,7 +473,19 @@
 					salesId: this.formData.salesId
 				}).then(res => {
 					if(res.code == 200){
-						
+						this.payCodeUrl = res.data.codeUrl
+						this.isPay = true
+						this.$nextTick(() => {
+						  this.payUrl = res.data.codeUrl;
+						  new QRCode(this.$refs.payQRCode, {
+						    text: res.data.codeUrl,
+						    width: 200,
+						    height: 200,
+						    colorDark: "#333333", // 二维码颜色
+						    colorLight: "#ffffff", // 二维码背景色
+						    correctLevel: QRCode.CorrectLevel.L // 容错率,L/M/H
+						  });
+						});
 					}
 				})
 			},

+ 83 - 77
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesReturnOrderDetail.vue

@@ -7,16 +7,16 @@
 				<span>单据信息</span>
 			</div>
 			<div class="mymain-container">
-				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
+				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left" :disabled="formType == 2">
 					<el-row :gutter="20" justify="start">
 						<el-col :span="8" v-if="id">
 							<el-form-item label="单据状态">
-								<el-input type="text" :value="formData.flag == 'SAVE'?'已保存':formData.flag == 'OK'?'审核通过':formData.flag == 'OK'?'FAIL':''" disabled></el-input>
+								<el-input type="text" :value="formData.retState == 'WAIT'?'待确认':formData.retState == 'OK'?'已确认':''" disabled></el-input>
 							</el-form-item>
 						</el-col>
 						<el-col :span="8" v-if="id">
 							<el-form-item label="单据编号">
-								<el-input type="text" :value="formData.salesId" disabled></el-input>
+								<el-input type="text" :value="formData.salesRetId" disabled></el-input>
 							</el-form-item>
 						</el-col>
 						<el-col :span="8">
@@ -60,9 +60,19 @@
 								<el-input type="text" v-model="formData.phone" placeholder="请输入"></el-input>
 							</el-form-item>
 						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="单据金额">
-								<el-input type="text" :value="formData.createBy" disabled></el-input>
+						<el-col :span="6">
+							<el-form-item label="销售订单号" :required="true">
+								<el-input type="text" v-model="formData.salesId" @change="getDetail" placeholder="请输入销售订单号"></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6">
+							<el-form-item label="销售金额">
+								<el-input type="text" :value="salesDetail.createBy" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6">
+							<el-form-item label="时间">
+								<el-input type="text" :value="salesDetail.createBy" disabled></el-input>
 							</el-form-item>
 						</el-col>
 						<el-col :span="6" v-if="id">
@@ -103,12 +113,12 @@
 			<div slot="header" class="clearfix">
 				<span>辅材信息</span>
 			</div>
-			<el-button size="small" type="primary" @click="add()">添加</el-button>
+			<!-- <el-button size="small" type="primary" @click="add()">添加</el-button> -->
 			<div class="table">
 				<el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
 					<el-table-column label="大类名称" align="center">
 						<template slot-scope="scope">
-							<el-select v-model="scope.row.parentCategory" value-key="categoryId" @change="changeMain" :disabled="isEdit != scope.$index" placeholder="请选择" style="width: 100%;">
+							<el-select v-model="scope.row.parentCategory" value-key="categoryId" @change="changeMain" :disabled="isEdit != scope.$index || formType == 2" placeholder="请选择" style="width: 100%;">
 							    <el-option
 							      v-for="item in mainList"
 							      :key="item.categoryId"
@@ -122,7 +132,7 @@
 						<template slot-scope="scope">
 							<el-select v-model="scope.row.goodsCategory" @change="changeSmall" @focus="()=>{
 									if(!scope.row.parentCategory){return this.$message.warning('请先选择大类!');}
-								}" :disabled="isEdit != scope.$index" value-key="categoryId" placeholder="请选择" style="width: 100%;">
+								}" :disabled="isEdit != scope.$index || formType == 2" value-key="categoryId" placeholder="请选择" style="width: 100%;">
 							    <el-option
 							      v-for="item in scope.row.parentCategory.items"
 							      :key="item.categoryId"
@@ -134,7 +144,7 @@
 					</el-table-column>
 					<el-table-column label="辅材名称" align="center">
 						<template slot-scope="scope">
-							<el-select v-model="scope.row.goods" @change="changeGoods" value-key="goodsId" :disabled="isEdit != scope.$index" placeholder="请选择" style="width: 100%;">
+							<el-select v-model="scope.row.goods" @change="changeGoods" value-key="goodsId" :disabled="isEdit != scope.$index || formType == 2" placeholder="请选择" style="width: 100%;">
 							    <el-option
 							      v-for="item in scope.row.goodsList"
 							      :key="item.goodsId"
@@ -145,18 +155,18 @@
 						</template>
 					</el-table-column>
 					<el-table-column prop="goods.goodsSalesUnit" align="center" label="单位" ></el-table-column>
-					<el-table-column prop="" align="center" label="数量" >
+					<el-table-column prop="" align="center" label="退货数量" >
 						<template slot-scope="scope">
-							<el-input type="number" v-model="scope.row.salesQty" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
+							<el-input type="number" v-model="scope.row.retQty" :disabled="isEdit != scope.$index || formType == 2" placeholder="请输入"></el-input>
 						</template>
 					</el-table-column>
 					<el-table-column prop="goods.goodsCode" align="center" label="商品代码"></el-table-column>
 					<el-table-column prop="goods.goodsSpecification" align="center" label="规格型号"></el-table-column>
-					<el-table-column prop="goods.price" align="center" label="销售价格"></el-table-column>
-					<el-table-column prop="goods.saleAmount" align="center" label="销售金额" ></el-table-column>
+					<el-table-column prop="goods.price" align="center" label="采购价格"></el-table-column>
+					<el-table-column prop="goods.saleAmount" align="center" label="采购金额" ></el-table-column>
 					<el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column>
 					<el-table-column label="操作" align="right" width="140">
-						<template slot-scope="scope">
+						<template slot-scope="scope" v-if="formType != 2">
 							<el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index">编辑</el-button>
 							<el-button size="mini" type="danger" @click="dataList.splice(scope.$index,1)">删除</el-button>
 						</template>
@@ -166,10 +176,8 @@
 		</el-card>
 		<div class="page-footer">
 			<div class="footer">
-				<el-button v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')" size="small" type="primary" @click="save()">保存</el-button>
-				<el-button v-if="formType != 0 && formData.flag == 'SAVE'" size="small" type="primary" @click="submit()">提交</el-button>
-				<el-button v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'" size="small" type="primary" @click="wxPay()">微信支付</el-button>
-				<el-button v-if="formData.flag == 'PAY_NOT_TAKE'" size="small" type="primary"  @click="confirm()">确认收货</el-button>
+				<el-button v-if="formType == 0 || (formType == 1 && formData.retState == 'WAIT')" size="small" type="primary" @click="save()">保存</el-button>
+				<el-button v-if="formData.retState == 'WAIT'" size="small" type="primary"  @click="confirm()">确认收货</el-button>
 				<el-button size="small" type="info" @click="goBack">返回</el-button>
 			</div>
 		</div>
@@ -183,7 +191,8 @@
 <script>
 	import { getWebsit } from "@/api/customerManagement";
 	import ImageUpload from '@/components/file-upload'
-	import { getWorker, getCategory, getGoods, getDetail, add, edit, confirm, submit, getCode } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+	import { getWorker, getCategory, getGoods, getDetail } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+	import { add, edit, getReturnDetail } from "@/api/auxiliaryFittings/auxiliarySalesReturnOrder";
 	export default {
 		components: { ImageUpload },
 		props: ['id','title','formType'],
@@ -195,13 +204,15 @@
 				mainList: [],
 				isPay: false,
 				payCodeUrl: '',
+				salesDetail: {},
 				formData: {
 					websit: {},
 					websitId: '',
 					websitName: '',
 					file_url: [],
 					salesId: '',
-					flag: '',
+					salesRetId: '',
+					retState: '',
 					createBy: '',
 					createTime: '',
 					confirmBy: '',
@@ -210,9 +221,7 @@
 					workerName: '',
 					workerId: '',
 					idcard: '',
-					phone: '',
-					source: '',
-					payType: ''
+					phone: ''
 				},
 				isEdit: 0,
 				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
@@ -223,12 +232,6 @@
 					worker: [
 						{ required: true, message: '请选择师傅', trigger: 'change' }
 					],
-					source: [
-						{ required: true, message: '请选择订单来源', trigger: 'change' }
-					],
-					payType: [
-						{ required: true, message: '请选择订单来源', trigger: 'change' }
-					],
 					idcard: [
 						{ required: true, message: '请输入师傅身份证', trigger: 'blur' },
 					],
@@ -241,7 +244,7 @@
 		computed: {},
 		created() {
 			if(this.id){
-				this.getDetail()
+				this.getReturnDetail()
 			}
 			this.getWebsit()
 		},
@@ -250,10 +253,10 @@
 			goBack() {
 				this.$emit('back');
 			},
-			async getDetail(){
+			getDetail(salesId){
 				const that = this
-				getDetail({salesId: this.id}).then(res => {
-					this.formData.flag = res.data.flag
+				getDetail({salesId}).then(res => {
+					this.formData.retState = res.data.retState
 					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
 					this.formData.websitId = res.data.websitId
 					this.formData.websitName = res.data.websitName
@@ -268,8 +271,6 @@
 					this.formData.workerId = res.data.workerId
 					this.formData.idcard = res.data.identity
 					this.formData.phone = res.data.workerMobile
-					this.formData.source = res.data.source
-					this.formData.payType = res.data.payType
 					this.getCategory(res.data.websitId)
 					this.formData.remark = res.data.remark
 					res.data.items.forEach(item=>{
@@ -286,6 +287,41 @@
 					console.log(this.dataList)
 				})
 			},
+			getReturnDetail(){
+				const that = this
+				getReturnDetail({id: this.id}).then(res => {
+					this.formData.retState = res.data.retState
+					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
+					this.formData.websitId = res.data.websitId
+					this.formData.websitName = res.data.websitName
+					this.getWorker()
+					this.formData.salesId = res.data.salesId
+					this.formData.salesRetId = res.data.salesRetId
+					this.formData.createBy = res.data.createBy
+					this.formData.createTime = res.data.createTime
+					this.formData.confirmBy = res.data.confirmBy
+					this.formData.confirmTime = res.data.confirmTime
+					this.formData.worker = {nickName: res.data.workerName,userId: res.data.workerId}
+					this.formData.workerName = res.data.workerName
+					this.formData.workerId = res.data.workerId
+					this.formData.idcard = res.data.identity
+					this.formData.phone = res.data.workerMobile
+					this.getCategory(res.data.websitId)
+					this.formData.remark = res.data.remark
+					res.data.websitSalesRetItems.forEach(item=>{
+						item.parentCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName,items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
+						item.goodsCategory = {categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}
+						that.getGoods(item.goodsCategoryId,item.goodsName,1).then(ress => {
+							item.goods = {...ress.data,oldPrice:ress.data.price}
+							item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
+						})
+					})
+					setTimeout(()=>{
+						this.dataList = res.data.websitSalesRetItems
+					},200)
+					console.log(this.dataList)
+				})
+			},
 			getWebsit(){
 				getWebsit({type: 'C'}).then(res => {
 					this.websitList = res.data
@@ -349,7 +385,7 @@
 				this.dataList[this.isEdit].goodsCode = '',
 				this.dataList[this.isEdit].price = '',
 				this.dataList[this.isEdit].saleAmount = '',
-				this.dataList[this.isEdit].salesQty = ''
+				this.dataList[this.isEdit].retQty = ''
 				this.dataList[this.isEdit].qty = '',
 				this.dataList[this.isEdit].goodsType = 'M'
 			},
@@ -362,7 +398,7 @@
 				this.dataList[this.isEdit].goodsCode = '',
 				this.dataList[this.isEdit].price = '',
 				this.dataList[this.isEdit].saleAmount = '',
-				this.dataList[this.isEdit].salesQty = ''
+				this.dataList[this.isEdit].retQty = ''
 				this.dataList[this.isEdit].qty = '',
 				this.dataList[this.isEdit].goodsCategoryId = e.categoryId
 				this.dataList[this.isEdit].goodsCategoryName = e.categoryName
@@ -397,64 +433,35 @@
 					goodsCode: '',
 					price: '',
 					saleAmount: '',
-					salesQty: 1,
+					retQty: 1,
 					qty: '',
 					goodsType: 'M'
 				})
 			},
-			submit(){
-				this.$confirm(`请确定是否提交订单, 是否继续?`, '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
-					submit({
-						salesId: this.formData.salesId
-					}).then(res => {
-						if(res.code == 200){
-							this.$message.success('提交成功!')
-							if(this.formData.payType == 'WECHAT'){
-								this.isPay = true
-							}else{
-								this.goBack()
-							}
-						}
-					})
-				});
-			},
 			confirm(){
 				this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
 					confirmButtonText: '确定',
 					cancelButtonText: '取消',
 					type: 'warning'
 				}).then(() => {
-					confirm({
-						salesId: this.formData.salesId
+					edit({
+						retState: 'OK',
+						salesRetId: this.formData.salesRetId,
 					}).then(res => {
 						if(res.code == 200){
-							this.$message.success('审核成功!')
+							this.$message.success('确认提货成功!')
 							this.goBack()
 						}
 					})
 				});
 			},
-			wxPay(){
-				getCode({
-					salesId: this.formData.salesId
-				}).then(res => {
-					if(res.code == 200){
-						
-					}
-				})
-			},
 			save(){
 				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
 					if (valid) {
 						if(this.formType == 0){
 							add({
+								salesId: this.formData.salesId,
 								goodsType: 'M',
-								source: this.formData.source,
-								payType: this.formData.payType,
 								remark: this.formData.remark,
 								websitId: this.formData.websitId,
 								websitName: this.formData.websitName,
@@ -462,7 +469,7 @@
 								workerId: this.formData.workerId,
 								identity: this.formData.idcard,
 								workerMobile: this.formData.phone,
-								items: this.dataList,
+								websitSalesRetItems: this.dataList,
 								file_url: this.formData.file_url.map(item=>item.url).join(","),
 							}).then(res => {
 								if(res.code == 200){
@@ -473,9 +480,8 @@
 						}else if(this.formType == 1){
 							edit({
 								salesId: this.formData.salesId,
+								salesRetId: this.formData.salesRetId,
 								goodsType: 'M',
-								source: this.formData.source,
-								payType: this.formData.payType,
 								remark: this.formData.remark,
 								websitId: this.formData.websitId,
 								websitName: this.formData.websitName,
@@ -483,7 +489,7 @@
 								workerId: this.formData.workerId,
 								identity: this.formData.idcard,
 								workerMobile: this.formData.phone,
-								items: this.dataList,
+								websitSalesRetItems: this.dataList,
 								file_url: this.formData.file_url.map(item=>item.url).join(","),
 							}).then(res => {
 								if(res.code == 200){